set up Conda Environment - spacemedicinelab/public-wiki GitHub Wiki

Anaconda is an all-in-one Python development suite.

Conda is an open-source package management system and environment management system for Python. Essentially, it allows you to create isolated programming "environments" in your computer that resolves dependencies in Python and Python packages.

1. Install Anaconda

Download and install Anaconda: https://www.anaconda.com/download

2. Create conda environment for Python 3.11.0

Open the Terminal app on your computer, run the following command to create a new conda environment named py-11 with python 3.11 and a few essential packages pre-installed. (Wait a few minutes to download and install everything)

conda create --name py-11 python==3.11.0 numpy==1.23.5 scipy==1.9.3 notebook==6.5.4 nbconvert=7.10.0 pandas==1.5.3 statsmodels==0.14.0 seaborn==0.11.2

NOTE: the part --name py-11 can be changed to any name you prefer, e.g. --name py-7-dev. This is useful for creating new conda environments for projects that are incompatible with Python 3.11 or any of the packages listed above.

If prompted "The following NEW packages will be INSTALLED: ..." Proceed ([y]/n)?, enter y and hit Enter to continue installation.

3. Switch to the new conda environment

conda activate py-11

Now you should see the text (py-11) in your Terminal like so:

activate the new conda environment "py-11"

A list of conda commands for future reference (not required for this guide): conda-cheatsheet.pdf

4. Install pip packages

Run the following command to install a few packages (only available on pip3 and not conda)

pip3 install scikit-learn==1.4.1.post1 statannotations==0.5.0

If you encounter any error, double check if you have the correct conda environment activated--it should say (py-11) in your Terminal. If not, go back to step 3.

After all packages is installed (all dependencies are resolved, no version conflicts), you should see the following success message:
Successfully installed scikit-learn-1.4.1.post1 statannotations-0.5.0 ...

Next Step

Now you can proceed to the next step in the wiki: Set up VS Code

⚠️ **GitHub.com Fallback** ⚠️