問題描述
如果這在其他地方很容易找到,我們深表歉意,但盡管我找到了一些帶有 pyenv 和 Anaconda 解釋的帖子,但沒有一個專門解決這個問題.但是,我經(jīng)常是個白癡.
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. However, I am often an idiot.
在 Mac OSX (Mojave 10.14.6) 上,我通過 Homebrew 安裝了 pyenv
On Mac OSX (Mojave 10.14.6) I installed pyenv via Homebrew
brew install pyenv
我很樂意安裝并在 Python 版本之間切換
And I happily install and switch between Python versions with
pyenv 安裝 ...
和
pyenv 全局 ...
我通常使用 VS Code 作為我的 IDE.
I typically use VS Code as my IDE.
我現(xiàn)在需要在 Anaconda 中做一些工作.我以前沒用過.我可以簡單地安裝 Anaconda 通過分發(fā)站點 并使用它的導(dǎo)航器,當(dāng)我需要舊的 python 版本時使用pyenv和VS Code,還是安裝Anaconda的時候會沖突?如果會發(fā)生沖突,是否有在 OSX 上同時運行兩者的路徑?
I now have need to do some work in Anaconda. I haven't used it before. Can I simply install Anaconda via the distribution site and use its navigator, and when I need my old python versions use pyenv and VS Code, or will there be a conflict when I install Anaconda? If there would be a conflict, is there a path to running both on OSX?
我當(dāng)然可以安裝它,看看會發(fā)生什么,如果它很亂,可以從備份中恢復(fù).但我希望 pyenv/Anaconda 大師可能會提出一些明智的建議,這可能會節(jié)省我數(shù)小時的清理時間.
I could install it and see what happens of course, and restore from backup if it's a big mess. But I'm hoping that a pyenv / Anaconda guru might have some sage words of advice that would save me potentially hours of cleaning up.
提前致謝!
推薦答案
有沖突,導(dǎo)致 pyenv
和 conda
都嘗試默認暴露全局 Python 環(huán)境.
There is a conflict, cause both pyenv
and conda
try to expose a global Python environment by default.
我一直在使用這些工具,我找到的最佳解決方案是
I've been using these tools together and best solution found by me is to
- 始終初始化
pyenv
,使用pyenv global
設(shè)置的Python作為默認Python - 僅公開命令
conda
但不激活任何環(huán)境
- Alway initialize
pyenv
, use the Python set bypyenv global
as the default Python - Only expose command
conda
but do NOT activate any environment from it
詳情
由于你的機器上已經(jīng)安裝了pyenv
,你只需要安裝Anaconda即可.
Detail
Since pyenv
has been installed on your machine, you only need to install Anaconda.
初始化 conda
而不暴露 conda
的基礎(chǔ)"環(huán)境.
Init conda
without exposing the "base" environment from conda
.
完成.
注意:在此設(shè)置之后,默認的 Python 是 pyenv global
設(shè)置的那個.使用 pyenv
和 conda
分別管理環(huán)境.
Note: After this setup, the default Python is the one set by pyenv global
. Use pyenv
and conda
to manage environments separately.
管理虛擬環(huán)境的示例.
pyenv
的默認環(huán)境位置是 ~/.pyenv/versions
.
Default env location for pyenv
is ~/.pyenv/versions
.
conda
的默認環(huán)境位置,檢查 conda info
的輸出.
Default env location for conda
, check output from conda info
.
- conda 入門李>
- 在 Conda 環(huán)境中使用 Pip,非常重要
- 如何防止 Conda 默認激活基礎(chǔ)環(huán)境?
這篇關(guān)于除了 OSX 上現(xiàn)有的 pyenv 安裝之外,如何安裝 Anaconda?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!