0

I want to use pyenv and conda. Pyenv for managing my python versions and conda mostly for Jupiter Notebook. However, every time I use conda it overrides pyenv paths and sets local python version for it's one.

This is the .zshrc file on my MacBook pro with os 12 on it.

#<<<<<<<<<<<<<<<<CONDA>>>>>>>>>>>>>>>>>
export PATH="/Users/potato/anaconda3/bin:$PATH"
#<<<<<<<<<<<<<<<<CONDA>>>>>>>>>>>>>>>>>

#<<<<<<<<<<<<<<<<PYENV>>>>>>>>>>>>>>>>>
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
export PATH="$HOME/.pyenv/bin:$PATH"
export PATH="/usr/local/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/zlib/lib -L/usr/local/opt/bzip2/lib"
export CPPFLAGS="-I/usr/local/opt/zlib/include -I/usr/local/opt/bzip2/include"
#<<<<<<<<<<<<<<<<PYENV>>>>>>>>>>>>>>>>>

I tried different solutions like this: Installing anaconda with pyenv, unable to configure virtual environment

Still doesn't work

Ideally, I would want to just switch from python to conda and be able to use Jupiter notebook, then when I'm done write a simple command that would return to pyenv control of versions.

  • 1
    I don't get the motivation here; seems like a bunch of config hassle with none of the convenience. Maybe add to the question an example of how you envision your ideal workflow playing out. Also, why install Anaconda? - that's hundreds of packages you don't plan to use. Consider Miniconda or Miniforge, and then install Jupyter. Have a look at Conda's configuration options (`conda config --describe`) - probably just want to disable a few of the defaults, like `auto_activate_base` and `changeps1`. This should not involve any manual hacking of `.zshrc`. – merv Feb 17 '22 at 01:18

1 Answers1

0

Thank you merv.

I could've done it much easier.

Here's what I did.

I created virtualenv with pyenv, downloaded jupyter notebook with pip while in the virtual environment and voila, so easy. Almost like I didn't have to download whole anaconda to do it XD