Skip to content

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

Closed

Description

@iodbh

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

Activity

  1. yyuu commented on May 17, 2015

    @yyuu
    Collaborator

    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
  2. iodbh commented on May 18, 2015

    @iodbh
    Author

    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).

  3. yyuu commented on Jun 26, 2015

    @yyuu
    Collaborator

    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?
  4. yyuu commented on Sep 22, 2015

    @yyuu
    Collaborator

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

  5. iodbh commented on Sep 22, 2015

    @iodbh
    Author

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions