How can I install Anaconda aside an existing pyenv installation on OSX?

后端 未结 2 1503
既然无缘
既然无缘 2020-12-30 10:34

Sincerest apologies if this is easily found elsewhere, but although I found a number of posts with pyenv and Anaconda explanations, none addressed this issue specifically. H

2条回答
  •  星月不相逢
    2020-12-30 11:16

    Not super familiar with conda but I do use pyenv a lot.

    Pyenv has its own virtualenv manager that you can use. You can always check which virtualenv version is active with:

    pyenv versions
    

    You should see something like:

      system
      20190814_125309
    * 3.7.4 (set by /home/tzhuang/.pyenv/version)
      3.7.4/envs/20190814_125309
      3.7.4/envs/buildmaster-sandbox
      3.7.4/envs/HEAD
      3.7.4/envs/myenv
      3.7.4/envs/sandbox
      buildmaster-sandbox
      HEAD
      myenv
      sandbox
    

    Where the * indicates the currently active virtualenv (this can be set using pyenv global like you mentioned). You can manually activate any virtualenv with:

    pyenv shell
    

    Eg.

    pyenv shell sandbox
    

    Then running pyenv versions gives:

      system
      20190814_125309
      3.7.4 (set by /home/tzhuang/.pyenv/version)
      3.7.4/envs/20190814_125309
      3.7.4/envs/buildmaster-sandbox
      3.7.4/envs/HEAD
      3.7.4/envs/myenv
      3.7.4/envs/sandbox
      buildmaster-sandbox
      HEAD
      myenv
    * sandbox
    

    It's generally a good idea to install any packages you want into a new virtualenv instead of the global virtualenv. It makes it easier to debug environment/dependency issues should you run into any.

提交回复
热议问题