Installing Python Packages under Windows
To install Python packages (“eggs”) from the Python language’s package manager “pip,” follow our instructions below. This can be done without Administrator access in a per-user, per-project clean manner with virtualenv. Virtualenv is the industry-standard way of developing and running Python. Virtualenv is available in our environment for current Python 3 packages.
This Guide applies to the following MCECS labs where Python is installed:
EB General lab (Eb 325), FAB General Lab (FAB 55-17), MCAE Lab (EB 420) and Civil 3D lab (EB 385).
Setup
From a command prompt:
- First navigate to the D: drive which has ample scratch storage space, or N: drive which has less storage space but is backed up and follows you across machines.
- Create a directory to use for your python project in a location which you have write access ( such as N:\My Documents\myPyProject , D:\myPyProject ).
- Run the command
python -m venv "path\to\project"
. This creates the virtual environment in your project folder. - Navigate into your project directory.
- Run the activation.
- Use `pip` to install your package of choice.
You should be returned with a prompt similar to: (myPyProject)>
The following is a complete example of the steps above:
-
cd N:
-
mkdir myPyProject
-
python -m venv "N:\myPyProject"
-
cd myPyProject
-
Scripts\activate.bat
-
pip install numPy
For more information, you can read Python’s official documentation on virtualenv here.