2

I have installed Ubuntu 14.04 a few weeks ago, and start and learn Python/Django. At the beginning I installed virtualenv and virtualenvwrapper via pip, and worked like a train. Yesterday I messed up the .bashrc file and had to recover it from /etc/skel/.bashrc (my bad, sorry!)

Since then I couldn't use the workon command anymore. So I re-applied the required WORKON_HOME and PROJECT_HOME and source path, which was missing. When attempting to use the workon command again, it said that my previous env didn't exist (which actually did in the ~/.virtualenvs folder. When I created a new virtualenv (mkvirutalenv), it worked, and created a new env. However, when attempting to install some packages like Django (sudo pip install Django) it gave a path error. After investigating the current virtual env's path, I found out the path was '~/.virtualenvs?' for saving the envs (yes, with that question mark)

So I decided to remove the virtualenvwarpper, virtualenv (pip uninstall ...) and remove the .virtualenvs and .virtualenvs? directories,.

When reinstalling both virtualenv and virtualenvwrapper, virtualenvwrapper came up with this message

Downloading virtualenvwrapper-4.7.1-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): stevedore in /usr/local/lib/python2.7/dist-packages (from virtualenvwrapper)
Requirement already satisfied (use --upgrade to upgrade): virtualenv-clone in /usr/local/lib/python2.7/dist-packages (from virtualenvwrapper)
Requirement already satisfied (use --upgrade to upgrade): virtualenv in /usr/local/lib/python2.7/dist-packages (from virtualenvwrapper) 

Installing collected packages: virtualenvwrapper Successfully installed virtualenvwrapper

And once again when making an env (mkvirtualenvs) it creates envs in the .virtualenvs? (with the question mark) directory. I've been installing, removing, changing paths in the .bashrc, but nothing seems to work. Searching on google has no success either, I can't find an identical issue (or I am simply failing in combining the right search-words)

Who can give me a push in the right direction to get my virtualenv and virtualenvwrapper back to work. Thanks for your help in advance!

*Edit in response of:

What error did the ? actually give? Are you sure that was the problem? – terdon 8 mins ago

Thank you for your reply. I am not completely sure this is the problem, I found it quite odd that it added a question mark at the end of the filename. Due to that I assumed it might cause the issues. Anyway, I recreated the error:

edwin@edwin:~$ workon mysite
workon: command not found
edwin@edwin:~$ notepad .bashrc
// ADDED FOLLOWING LINES TO .BASHRC
// export WORKON_HOME=$HOME/.virtualenvs
// export PROJECT_HOME=~/media/edwin/DEV/python/mysite/
// source /usr/local/bin/virtualenvwrapper.sh

edwin@edwin:~$ source .bashrc
/premkprojectpper.user_scripts creating /home/edwin/.virtualenvs
/postmkprojectper.user_scripts creating /home/edwin/.virtualenvs
/initializerapper.user_scripts creating /home/edwin/.virtualenvs
/premkvirtualenvr.user_scripts creating /home/edwin/.virtualenvs
/postmkvirtualenv.user_scripts creating /home/edwin/.virtualenvs
/prermvirtualenvr.user_scripts creating /home/edwin/.virtualenvs
/postrmvirtualenv.user_scripts creating /home/edwin/.virtualenvs
/predeactivateper.user_scripts creating /home/edwin/.virtualenvs
/postdeactivateer.user_scripts creating /home/edwin/.virtualenvs
/preactivateapper.user_scripts creating /home/edwin/.virtualenvs
/postactivatepper.user_scripts creating /home/edwin/.virtualenvs
/get_env_detailsr.user_scripts creating /home/edwin/.virtualenvs
edwin@edwin:~$ workon mysite
(mysite)edwin@edwin:~$ cd /media/edwin/DEV/python/mysite
(mysite)edwin@edwin:/media/edwin/DEV/python/mysite$ pip install Django
/mysite/bin/pip", line 2tualenvs
/mysite/bin/python
^
SyntaxError: invalid syntax

Thanks again!

3
  • What error did the ? actually give? Are you sure that was the problem?
    – terdon
    Sep 27, 2015 at 15:30
  • Thank you for your reply. I reproduced the error, and edited the original question message.
    – Nrzonline
    Sep 27, 2015 at 15:50
  • It doesn't look like the ? is causing the problem. It seems to be complaining about .... but I don't really know enough about pip to be able to help. Sorry :(
    – terdon
    Sep 27, 2015 at 16:12

0

You must log in to answer this question.

Browse other questions tagged .