...
Aside: You can also use conda to manage packages and environments for any programming language. Please see the Conda Wiki article for more information about using conda in IDAS. For more general information about conda, see the Conda User Guide.
...
Code Block |
---|
python3 -m venv $HOME/virtenvs/projectName |
...
Additional notes:
You will probably have several virtual environments for unrelated projects; that’s why we created the
virtenvs
directory to organize them. You can create another (separate) virtual environment in the future like so:
Code Block |
---|
python3 -m venv $HOME/virtenvs/another-project |
...
In some cases, you might want your virtual environment to have access to the packages provided by IDAS. You can include the
--system-site-packages
flag in the command like so:
Code Block |
---|
python3 -m venv --system-site-packages $HOME/virtenvs/projectName |
This way, the packages that are installed at the system level in IDAS, outside of the virtual environment, will be available inside the virtual environment, and you don’t have to install those packages inside of the virtual environment. This can save you time and efforts if you want to use the system-level packages that were already installed in IDAS.
On the other hand, if you want packages in your virtual environment to be separated from the system-level packages in IDAS, you can omit the --system-site-packages
flag. This can be helpful if, for example, you want to use a package with a different
...
version than
...
the version provided by IDAS.
There are other flags (options) available with the venv
command. For more information, please see the official Python documentation.
4. Once this environment is created, we can activate it.
...
If you have any questions or comments, please contact research-computing@uiowa.edu.