How can I add a package to an existing conda environment?
If it is a python package I can use pip install <package>
, but what if pip does not work?
Is it sufficient to activate the environment and use conda install <package>
?
It's fully recommended to use pip inside of conda. It's better to install using conda, but for any packages that don't have a conda build, it's perfectly acceptable to use pip.
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>
.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With