[WINDOWS] Creating a Python Environment & Installing Packages on IPEA's Windows STATA server - jamiefogel/Networks GitHub Wiki
CREATING OUR OWN VIRTUAL ENVIRONMENT:
-
go to the windows menu and look for the Anaconda prompt (not the powershell prompt)
-
List existing environments (@ C:\ProgramData\anaconda3\envs)
conda env list
- create a new environment called 'ENVIRONMENT-NAME'
conda create --name ENVIRONMENT-NAME python=3.12
- activate the environment to install packages (to return to the base environment, conda deactivate)
conda activate ENVIRONMENT-NAME
- installing packages (pip3 preferred)
pip3 install PACKAGE-NAME
or
conda install PACKAGE-NAME
- make sure to install the spyder plugin depending on the spyder's version
pip3 install spyder-kernels=2.4
- link spyder to our new environment
Go to the menu Tools, Preferences, Interpreter, and then choose the python exe that is here: C:\ProgramData\anaconda3\envs\ENVIRONMENT-NAME and apply changes. Restart spyder.
- Delete an environment
conda env remove --name ENVIRONMENT-NAME