Skip to content

pyenv-virtualenv breaks fish shell when using pyenv global #80

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
iodbh opened this issue May 13, 2015 · 5 comments
Closed

pyenv-virtualenv breaks fish shell when using pyenv global #80

iodbh opened this issue May 13, 2015 · 5 comments

Comments

@iodbh
Copy link

iodbh commented May 13, 2015

I've been successfully using pyenv-virtualenv with fish, but using pyenv global breaks my shell: every new shell opens on an error traceback starting with:

 pyenv-virtualenv: activate newdefault
    fish: Could not locate end of block. The 'end' command is missing, misspelled or a ';' is missing.
    /private/tmp/.psub.kRftWGHW9n (line 6): function _old_fish_prompt
                                    ^
in . (source) call of file '/private/tmp/.psub.d9D37vvhaa',
    called on line 14 of file '/private/tmp/.psub.kRftWGHW9n',

in . (source) call of file '/Users/zeitgeist/.pyenv/versions/newdefault/bin/activate.fish',
    called on line 14 of file '/private/tmp/.psub.kRftWGHW9n',

in . (source) call of file '-',
    called on line 39 of file '/private/tmp/.psub.kRftWGHW9n',

in function 'pyenv',
     called on line 19 of file '/private/tmp/.psub.HG02t3zPHZ',
    with parameter list 'activate --no-error --verbose'

in function '_pyenv_virtualenv_hook',
    called on standard input,

 in event handler: handler for generic event 'fish_prompt'

       function − function ‐ create a function

and ending with:

source: Error while reading file '/private/tmp/.psub.d9D37vvhaa'
fish: Unknown command '_old_fish_prompt'
/Users/username/.pyenv/versions/newdefault/bin/activate.fish (line 57): _old_fish_prompt
                                                                     ^
in command substitution
    called on line 59 of file '/Users/username/.pyenv/versions/newdefault/bin/activate.fish',

in function 'fish_prompt',
    called on standard input,

in command substitution
    called on standard input,
  • Before using pyenv global, I had the same problem with shells inside Pycharm (no issue whith "regular" shells then).
  • Using bash then fish in the broken shell creates a new fish shell without any error
@yyuu
Copy link
Collaborator

yyuu commented May 17, 2015

I couldn't reproduce the behaviour. Please let me know the following

  • The output from pyenv versions
  • The output from pyenv virtualenvs
  • The output from pyenv global

@iodbh
Copy link
Author

iodbh commented May 18, 2015

Here it is:

  • pyenv versions
  system
  2.7.9
  3.4.2
* 3.4.3 (set by /Users/username/.pyenv/version)
  booklook
  charon
  cptsms
  dokuwikiparser
  lpmawagtail
  newdefault
  newdefaultbrew
  pediscript
  ugstream
  wikimport
  • pyenv virtualenvs
  booklook (created from /Users/username/.pyenv/versions/3.4.3)
  charon (created from /Users/username/.pyenv/versions/2.7.9)
  cptsms (created from /Users/username/.pyenv/versions/3.4.3)
  dokuwikiparser (created from /Users/username/.pyenv/versions/3.4.3)
  lpmawagtail (created from /Users/username/.pyenv/versions/3.4.3)
* newdefault (created from /Users/username/.pyenv/versions/3.4.3)
  newdefaultbrew (created from /Users/username/.pyenv/versions/3.4.3)
  pediscript (created from /Users/username/.pyenv/versions/3.4.2)
  ugstream (created from /Users/username/.pyenv/versions/3.4.2)
  wikimport (created from /Users/username/.pyenv/versions/3.4.3)
  • pyenv global
newdefault

This issue only arises with virtualenvs : if I set a "regular" version (e.g. 3.4.3) as the global, everything works smoothly.

I have the same problem with 2 different computers (both macs running Yosemite).

@yyuu
Copy link
Collaborator

yyuu commented Jun 26, 2015

Is this still a problem for you? I've not yet reproduced the problem. From the error output, the activate.fish script created by virtualenv might be corrupted. But I don't know why....

  1. What is virtualenv did you use to create virtualenv? virtualenv or pyvenv?
    • pyenv virtualenv --version shows your configuration
  2. Does the problem persist even after once you recreate new virtualenv?

@yyuu
Copy link
Collaborator

yyuu commented Sep 22, 2015

I'll close this issue for now as stale issue. Feel free to reopen the issue if this is still a problem for you.

@yyuu yyuu closed this as completed Sep 22, 2015
@iodbh
Copy link
Author

iodbh commented Sep 22, 2015

I just saw your previous comment, as I was off the grid for a while. The issue persisted for a while, but disappeared after several environment updates so it's hard to pinpoint the cause. Thank you for your support !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants