
Use the pip tool from this environment to install or upgrade a package (for example, SymPy) under ~/myenv/lib/python3.9/site-packages, and run the pip list command to check whether the installation is completed properly. Your prompt should now include the virtual environment.
% source ~/myenv/bin/activate.csh (for csh)
If you want this virtual environment to be able to access packages already available in the global site-packages (in this example, /nasa/pkgsrc/toss3/2021Q2/lib/python3.9/site-packages), so that you do not have to install everything from scratch, run: % virtualenv -system-site-packages ~/myenvĪt the end of this step, you should see the python (which is linked to python3.9), pip (which is same as pip3 or pip3.9), wheel, and multiple activate scripts under ~/myenv/bin. The virtualenv tool will create the directory for you.
Create a virtual environment with a new directory name, such as ~/myenv. If it is not available, or if you want to install your own private copy, continue with the steps below. In the output, look for a package with the version you want. View the packages and versions that are available under python3/3.9.5:. Load the latest Python module (currently python3/3.9.5), which already has virtualenv, pip and many other Python packages installed:. You can create separate virtual environments for separate projects that may need different versions of the same package.Ĭomplete these steps to check whether a package is available on NAS systems, create a virtual environment, install a package from the Python Package Index (PyPI), and use the package in this virtual environment:. When activated, you can install and use packages through this environment, instead of through /usr/bin/python or the NAS-provided Python modules.
It creates an isolated Python virtual environment. To install a Python package or version, we recommend using the virtualenv tool, which provides these benefits: However, if you need a Python package or version that is not available in these environments, we recommend that you install it in your own directory. These environments provide a variety of Python packages and versions. NAS provides several Python environments including the system default, /usr/bin/python3 (currently version 3.6.8), and modules such as python3/3.9.5, and so on.