I'm a bit of a newbie to Python and definitely to virtual environments and Django. I want to install Django but it first recommends a
virtualenvwrapper. A video I am watching recommends installing
virtualenvwrapper so I just tried this, following these instructions:
I first ran
pip install virtualenvwrapper
which seemed to work fine. It generated some messages, ending with:
Downloading https://files.pythonhosted.org/packages/e1/ba/f95e3ec83f93919b1437028e989cf3fa5ff4f5cae4a1f62255f71deddb5b/pbr-4.0.2-py2.py3-none-any.whl (98kB) 100% |████████████████████████████████| 102kB 5.3MB/s Requirement already satisfied: six>=1.10.0 in /Users/rishi/anaconda3/lib/python3.6/site-packages (from stevedore->virtualenvwrapper) Installing collected packages: virtualenv-clone, pbr, stevedore, virtualenv, virtualenvwrapper Successfully installed pbr-4.0.2 stevedore-1.28.0 virtualenv-15.2.0 virtualenv-clone-0.3.0 virtualenvwrapper-4.8.2
I then had to follow the "shell startup" guidelines which mentioned adding these lines to be shell startup file:
export WORKON_HOME=$HOME/.virtualenvs export PROJECT_HOME=$HOME/Devel source /usr/local/bin/virtualenvwrapper.sh
I did this. Once I run
$ source ~/.bash_profile on terminal, I am presented with this error:
-bash: /usr/local/bin/virtualenvwrapper.sh: No such file or directory
After searching online, a forum post recommended that I run:
and this gives me the result:
Note I have Anaconda installed for some (previous) learning. I now want to install/learn Django.
Searching online, one person recommended to copy the
virtualenvwrapper.sh from the one directory to the
/usr/local/bin/ directory. It also seems like I should have done this with
sudo - i.e. should I have run the following?
sudo pip install virtualenvwrapper
I'm super confused - I never was good with server/installing stuff so I'd really appreciate guidance on how/what to install correctly in order to get my virtual environment working, and then hopefully I can use Django.
Perhaps you may recommend
- just copying the Anaconda
virtualenvwrapper.shfile as suggested?
- Or if I should install again using
sudothen please let me know how to uninstall virtualenvwrapper (that I just installed) so I can re-install it,
or please simply let me know the steps I should follow as I don't want to mess anything up, if I haven't already!
I copied the file from Anandonda to the main folder as explained above, and then ran this. The following messages were generated, and now I seem to be good, I can use the
workon command for example.
Rishi:bin rishi$ source ~/.bash_profile virtualenvwrapper.user_scripts creating /Users/rishi/.virtualenvs/premkproject virtualenvwrapper.user_scripts creating /Users/rishi/.virtualenvs/postmkproject virtualenvwrapper.user_scripts creating /Users/rishi/.virtualenvs/initialize virtualenvwrapper.user_scripts creating /Users/rishi/.virtualenvs/premkvirtualenv virtualenvwrapper.user_scripts creating /Users/rishi/.virtualenvs/postmkvirtualenv virtualenvwrapper.user_scripts creating /Users/rishi/.virtualenvs/prermvirtualenv virtualenvwrapper.user_scripts creating /Users/rishi/.virtualenvs/postrmvirtualenv virtualenvwrapper.user_scripts creating /Users/rishi/.virtualenvs/predeactivate virtualenvwrapper.user_scripts creating /Users/rishi/.virtualenvs/postdeactivate virtualenvwrapper.user_scripts creating /Users/rishi/.virtualenvs/preactivate virtualenvwrapper.user_scripts creating /Users/rishi/.virtualenvs/postactivate virtualenvwrapper.user_scripts creating /Users/rishi/.virtualenvs/get_env_details