![]() To get back into your virtualenv: $ export PYTHONPATH= $ when you want to work on it again, use workon If you want to get back out of your virtualenv, you can deactivate it or just close/exit the terminal window. when you are done, run deactivate to end the virtualenv ![]() If you want, start using it and run your programs in it. Here are some examples: (my_project) pip install numpyĪt this point your virtualenv is ready to use. Use pip to install any packages you need! Use pip list to see what’s installed. Your prompt should have changed to include (my_project) at the beginning. Mkvirtualenv -p /usr/bin/python3 my_projectĪt this point you have made and are in the virtual environment. ![]() Source /usr/local/bin/virtualenvwrapper.sh Here’s how to make a virtual environment, called my_project, that uses python 3: export PYTHONPATH= Or mkdir /scratch/csmajor1/pip # if not, make one Ln -s /scratch/csmajor1/pip ~/.cache/pip # and link it back Here are the commands: mv ~/.cache/pip /scratch/csmajor1 # if you already have one, mv If not, just make one in /scratch/csmajor1 and link it back. If you already have a ~/.cache/pip directory, move it to /scratch/csmajor1 and link it back. Ln -s /scratch/csmajor1/Envs ~/Envs put pip cache on /scratch Here are the commands for using scratch (again, assuming you are csmajor1): mkdir /scratch/csmajor1/Envs If you use /local instead of /scratch, it will be faster, but local to the machine you are on (i.e., only accessible from that lab machine). Make a directory in /scratch/csmajor1 for your venvs, so you don’t go over your disk quota. If you have, you can skip down to the next section (make the virtual env).įall2018 Note: all new accounts as of Fall 2018 already have these preliminary steps done, so you can skip to the next section. Here are the steps needed to set up your own python virtualenv:Īll of these assume your CS username is csmajor1 (i.e., when you execute the commands below, please change csmajor1 to your username).Īlso, all of these are if you haven’t already done this. If you need python libraries installed that we don’t have, or that are newer than the versions we currently have installed, you should be able to install everything you need on your own using a virtual environment. Virtualenv SwatCS Help Pages - Virtualenv Virtualenv
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |