FS#48305 - [python-virtualenvwrapper] Creating an environment makes a bash script with invalid syntax.
Attached to Project:
Community Packages
Opened by Joseph Fox-Rabinovitz (MadPhysicist) - Tuesday, 23 February 2016, 03:55 GMT
Last edited by Doug Newgard (Scimmia) - Sunday, 13 March 2016, 08:30 GMT
Opened by Joseph Fox-Rabinovitz (MadPhysicist) - Tuesday, 23 February 2016, 03:55 GMT
Last edited by Doug Newgard (Scimmia) - Sunday, 13 March 2016, 08:30 GMT
|
Details
I installed python-virtualenv and python-virtualenvwrapper
as described in
https://wiki.archlinux.org/index.php/Python/Virtualenv. The install went fine:
pacman -S python-virtualenv python-virtualenvwrapper I added the following to the bottom of my .bashrc: export PATH="${PATH}:${HOME}/bin" export WORKON_HOME="${HOME}"/.virtualenvs [ ! -d "${WORKON_HOME}" ] && mkdir -p "${WORKON_HOME}" source /usr/bin/virtualenvwrapper.sh The next time I sourced it, it created some scripts in ${WORKON_HOME}. When I tried to do mkvirtualenv npt I got the following error output: Using base prefix '/usr' New python executable in /home/joe/.virtualenvs/npt/bin/python3 Also creating executable in /home/joe/.virtualenvs/npt/bin/python Installing setuptools, pip, wheel...done. virtualenvwrapper.user_scripts creating /home/joe/.virtualenvs/npt/bin/predeactivate virtualenvwrapper.user_scripts creating /home/joe/.virtualenvs/npt/bin/postdeactivate virtualenvwrapper.user_scripts creating /home/joe/.virtualenvs/npt/bin/preactivate virtualenvwrapper.user_scripts creating /home/joe/.virtualenvs/npt/bin/postactivate virtualenvwrapper.user_scripts creating /home/joe/.virtualenvs/npt/bin/get_env_details bash: deactivate: No such file or directory bash: /home/joe/.virtualenvs/npt/bin/activate: line 4: syntax error near unexpected token `(' bash: /home/joe/.virtualenvs/npt/bin/activate: line 4: `deactivate () {' bash: syntax error near unexpected token `(' Line 4 of `/home/joe/.virtualenvs/npt/bin/activate` contains the following: deactivate () { Similarly, line 69 contains the following: pydoc () { In both cases, the function definition is missing the `function` keyword. |
This task depends upon
CONDA_HOME=/opt/miniconda2
PATH="${CONDA_HOME}/bin:${PATH}"
alias deactivate='source deactivate'
Of course the last line was a stupud idea in hindsight, expecially since I did not get rid of the script once I uninstalled miniconda. The redefinition of `deactivate` was messing with `virtualenvwrapper`. This is not a real bug and there is nothing to fix, so I am requesting closure.