简体   繁体   中英

“Installing From Source” Within Anaconda Environment

What I would like to do:

  • I am using macOS and Anaconda 2.
  • I would like to install a Python package (specifically PyTorch) from source.
  • I would like to install all the dependencies and the package itself within an Anaconda environment.
  • I don't want this Anaconda environment to be the default/ root Anaconda environment, but an environment I particularly created for installing this package and its dependencies from source.

What I have done:

First, I created the environment as follows

conda create --name my_env python=3.5

Now, the instructions for installing PyTorch from source are as follows:

export CMAKE_PREFIX_PATH=[anaconda root directory]
conda install numpy pyyaml setuptools cmake cffi
git clone --recursive https://github.com/pytorch/pytorch
MACOSX_DEPLOYMENT_TARGET=10.9 CC=clang CXX=clang++ python setup.py install

Now, my questions are:

  1. Following this instructions, requires me to specify anaconda root directory for the CMAKE_PREFIX_PATH. What should that directory be given that I want everything set-up in my_env ?
  2. Is it reasonable to create an extra environment for a package installed from source and its dependencies? Why would one do or not do it? My motivation is mainly fear that one day I may screw my system up big time and hence want things to be cleanly separated.

If you can only answer one of the two questions, that is already greatly appreciated. Thanks!

I received this answer from the Anaconda Google discussion group and re-post it here in case anyone else is interested.

  1. It is the path to my_env. If you created it with -n my_env and you haven't otherwise changed your envs dir, it'll be in <anaconda root>/envs/my_env

  2. Yes, this is definitely good practice. The cleanest way to use conda is to install miniconda, not anaconda, and to install as little as possible into the root environment.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM