Issues

Issue #54 resolved

source virtualenvwrapper.sh fails in Ubuntu 10.04

Ryan May
created an issue

I've just upgraded to v2.2.1 and converted from virtualenvwrapper_bashrc to virtualenvwrapper.sh

However, when I try to source .bashrc, I get the following error:

{{{ bash: /usr/local/bin/virtualenvwrapper.sh: line 192: syntax error near unexpected token `('

bash: /usr/local/bin/virtualenvwrapper.sh: line 192: `mkvirtualenv () {' }}}

I'm running Linux Mint 9 (based on Ubuntu 10.04) with bash version 4.1.5. virtualenvwrapper was installed via pip.

Comments (11)

  1. Doug Hellmann repo owner
    • changed status to open

    That's strange behavior. There are several function definitions on earlier lines in the file. I wonder if it's really something else wrong with the file that bash is reporting as a syntax error on that line.

    Can you post the output of "bash -x virtualenvwrapper.sh" in an attachment so I can see what bash is doing with the file? I don't have easy access to Mint to test with.

  2. Doug Hellmann repo owner

    I don't see any errors in the bashout file you attached to the ticket. Does that mean you only see the error when sourcing the script on login?

    Unfortunately the wrapper script is highly dependent on other settings in your shell environment. Can you upload your bashrc so I can look at your other configuration values?

  3. Ryan May reporter

    Yes, I only see the errors when I open a new terminal or run source.

    My .bashrc is attached. I did have a virtualenvwrapper alias defined, but removing it had no effect.

  4. Doug Hellmann repo owner

    I don't see anything obvious. I'll have to see if I can get an environment with the same version of bash configured so I can test that way.

    You could try a brute-force debugging technique of turning off all of the other bash customization to see if there is something in the environment causing it. :-/

  5. Ryan May reporter

    I've found the issue. It was my alias:

    alias mkvirtualenv="mkvirtualenv --no-site-packages"
    
    

    Causes the errors.

    This alias was in place and working with virtualenvwrapper 1.x.

  6. Log in to comment