Reputation: 15642
I'm trying to get started with a book called "TDD with Python", OS W10. As part of the setup it wants you to install virtualenvwrapper. The recommendation is to use GitBash in Windows... but I've been using Cygwin for quite a bit and didn't like GitBash when I looked at it some time ago.
Python version is 3.6. I installed virtualenvwrapper by going
pip install virtualenvwrapper
This seemed to work OK.
Trying to add the relevant setup line to my .bashrc did not go so well:
echo "source virtualenvwrapper.sh" >> ~/.bashrc
source ~/.bashrc
output:
/usr/bin/python: No module named virtualenvwrapper virtualenvwrapper.sh: There was a problem running the initialization hooks.
If Python could not import the module virtualenvwrapper.hook_loader, check that virtualenvwrapper has been installed for VIRTUALENVWRAPPER_PYTHON=/usr/bin/python and that PATH is set properly.
At least this proves that virtualenvwrapper.sh is being run...
In fact there is no such directory as /usr/bin
... so I added a preceding line in .bashrc pointing to what I hoped might be what it might be wanting to see for this VIRTUALENVWRAPPER_PYTHON environment variable (do we call them that in Linux?).
VIRTUALENVWRAPPER_PYTHON=/cygdrive/d/apps/Python/Python36/Lib/site-packages/virtualenvwrapper
Now I get
bash: /cygdrive/d/apps/Python/Python36/Lib/site-packages/virtualenvwrapper: Is a directory virtualenvwrapper.sh: There was a problem running the initialization hooks.
If Python could not import the module virtualenvwrapper.hook_loader, check that virtualenvwrapper has been installed for VIRTUALENVWRAPPER_PYTHON=/cygdrive/d/apps/Python/Python36/Lib/site-packages/virtualenvwrapper and that PATH is set properly.
Main question: what is VIRTUALENVWRAPPER_PYTHON meant to point at? An executable file? Any clues to help me recognise the desired target would be much appreciated!
POST-ANSWER ENLIGHTENMENT Just in case anyone stumbles this way, just to let you know: after phd gave me the answer to this I found other problems.
Eventually I managed to install virtualenvwrapper by doing this:
pip uninstall virtualenvwrapper
... use the latest Cygwin setup .exe to install pip3. Note the 3!
then go
pip3 install virtualenvwrapper
echo "source virtualenvwrapper.sh" >> ~/.bashrc
source ~/.bashrc
... success! but quickly followed by another puzzle: see here.
Upvotes: 1
Views: 436
Reputation: 94483
VIRTUALENVWRAPPER_PYTHON
should point to python binary: /usr/bin/python
, e.g.
Upvotes: 1