How to add package to conda environment without pip
Solution 1:
You've answered your own question. In fact you really want to do conda install ...
instead of using pip if you can.
You can install a conda package also without activating the environment. Just use conda install -n <env_name> <package>
or conda install -p <path/to/env> <package>
.
Solution 2:
If you want to install a specific package inside a specific conda environment, you can use the following command.
First activate the conda environment and then do:
$ conda install --name <conda_env_name> -c <channel_name> <package_name>
For a concrete example, let's assume that you want to install chainer from the channel anaconda
to an already created conda environment named chainerenv
, then you can do:
$ conda install --name chainerenv -c anaconda chainer