Skip to content

Instantly share code, notes, and snippets.

@icyveins7
Last active July 13, 2021 08:48
Show Gist options
  • Save icyveins7/682160975957b4e2b833d42b7a1f82e1 to your computer and use it in GitHub Desktop.
Save icyveins7/682160975957b4e2b833d42b7a1f82e1 to your computer and use it in GitHub Desktop.
Guidelines for migrating to non-anaconda based environments

In light of the recent Anaconda commerical license changes, the most obvious way around this is to move entirely to using the free PyPI repositories using pip alone.

This method outlines the steps succinctly to reproduce somewhat a starting conda environment, without ever having to visit the Anaconda website.

  1. Download your python from here.

  2. During install for Windows, remember to click the option 'Add to environment variables' (NOT 'add to PATH') This will essentially turn your cmd.exe into Anaconda Prompt.

  3. Pip is bundled with the installation, so open a command prompt (no admin required) and

pip install virtualenv
pip install virtualenvwrapper-win

If you are okay with using venv then you can use that. If using Linux then use

pip install virtualenv
pip install virtualenvwrapper

instead.

  1. Create a main environment to mimic the Anaconda original environment. First create a folder to store your environments (the default will be somewhere in C:\Users\YourUser).
mkdir H:\Python\Python39\envs

Add this as a permanent environment variable called "WORKON_HOME" (this is what virtualenvwrapper uses) and restart the command prompt. Then do

mkvirtualenv main
workon main
  1. Install some standard libraries that would have been packaged with Anaconda's install.
pip install numpy scipy numba spyder matplotlib scikit-learn jupyter pandas

Or, for myself..

pip install numpy scipy numba spyder matplotlib scikit-learn jupyter pandas pyqtgraph cython
  1. Good to go! Might be worth checking out virtualenvwrapper's functions to know how to navigate the virtualenvs. Some common ones:
lsvirtualenv == conda info --envs
pip list == conda list
rmvirtualenv == conda remove (environment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment