DEV Community

Cover image for Conda equivalent of `pipenv run`
Mikołaj Buchwald
Mikołaj Buchwald

Posted on

Conda equivalent of `pipenv run`

If you wish to run a single command using a Python environment created with conda (i.e., you don't want to activate the environment first), you can use the following command:

conda run -n your_env_name some_command
Enter fullscreen mode Exit fullscreen mode

E.g.:

conda run -n webprojects python --version
Enter fullscreen mode Exit fullscreen mode

or:

conda run -n datascience jupyter lab
Enter fullscreen mode Exit fullscreen mode

Make sure that you are using the -n argument; pipenv does not require specifying an "optional" argument, hence it took me some time to get this working (i.e., it works just like pipenv run jupyter lab).

References:


Cover Photo by Thomas Oldenburger on Unsplash

Top comments (0)