Skip to content

Instantly share code, notes, and snippets.

@andreberg
Last active March 2, 2020 15:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andreberg/583fc3642a06621c14cade300a0fb89f to your computer and use it in GitHub Desktop.
Save andreberg/583fc3642a06621c14cade300a0fb89f to your computer and use it in GitHub Desktop.
[Anaconda: Add Custom Env Manually] Configure environment with external Python interpreter. #anaconda #python #env #environment

NOTE: This solution is not permanent! Everytime Anaconda Navigator is being used to update the envs, ~/.conda/environments.txt will be re-created which will lose all manually added envs.

Add New Custom Env

  1. Navigate to ~/.conda
  2. Make directory <new_env_name> in ~/.conda/envs
  3. Edit ~/.conda/environments.txt to include ~/.conda/envs/<new_env_name>

Add Pre-Existing Env (soft-linked)

  1. Navigate to ~/.conda
  2. Open terminal and create a link <new_env_name> to the directory containing python.exe of the pre-existing environment (see Creating Links below).
  3. Edit ~/.conda/environments.txt to include ~/.conda/envs/<new_env_name>

Add Pre-Existing Env (directly)

  1. Navigate to ~/.conda
  2. Edit ~/.conda/environments.txt and to include path to directory containing python.exe of the pre-existing environment
Creating Links

Windows:

  1. Right-click cmd.exe and choose Run as Administrator
  2. Navigate to ~/.conda/envs dir with cd %USERPROFILE%\.conda\envs
  3. Create soft-link in envs with mklink /D <new_env_name> "<path_to_pre_existing_env_dir>"

macOS:

  1. Open Terminal
  2. Navigate to ~/.conda/envs dir with cd ~/.conda/envs
  3. Create symlink in envs with ln -sfv "<path_to_pre_existing_env_dir>" <new_env_name>

Example:
(Windows) mklink /D hou170 "C:\Program Files\Side Effects Software\Houdini 17.0.755\python27"
(macOS) TODO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment