-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Goal
I want to be able to activate my miniconda virtual environment and then run conda and jupyter like this:
# Activates miniconda virtual environment
$ python -m conda
$ python -m jupyter
I want to do this because when my virtual environment is activated I know that I am running my specified version of python, and using the verbose python -m <module_name> syntax ensures I am running the subcommand of my specified python version, and not a globally installed equivalent.
The issue is, I can't seem to get this to work reliably. After installing my specified miniconda python version with pyenv, I then create a virtual environment using the virtualenv command. This gives me access to do python -m jupyter but not python -m conda.
If I install pyenv-virtualenv as a pyenv plugin and then do pyenv install miniconda3-3.9-24.9.2-0 and then run pyenv activate <python_version_name>, like in pyenv activate miniconda3-3.9-24.9.2-0, then I will be able to run python -m conda but not python -m jupyter.
As an edge case, I noticed if I instead use pyenv-virtualenv to create a new miniconda environment (instead of using the default one) by giving it a custom name with the pyenv <python_version> <environment_name> command and then activate the environment with pyenv activate <environment_name> I will not be able to use python -m conda nor python -m jupyter.
I am not sure what I am doing wrong... I just want to be able to run both subcommands in a miniconda virtual environment using the verbose python -m <module_name> syntax.