How can I install Anaconda aside an existing pyenv installation on OSX?(除了 OSX 上现有的 pyenv 安装之外,如何安装 Anaconda?)
问题描述
如果这在其他地方很容易找到,我们深表歉意,但尽管我找到了一些带有 pyenv 和 Anaconda 解释的帖子,但没有一个专门解决这个问题.但是,我经常是个白痴.
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.
我现在需要在 Anaconda 中做一些工作.我以前没用过.我可以简单地安装 Anaconda 通过分发站点 并使用它的导航器,当我需要旧的 python 版本时使用pyenv和VS Code,还是安装Anaconda的时候会冲突?如果会发生冲突,是否有在 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?
我当然可以安装它,看看会发生什么,如果它很乱,可以从备份中恢复.但我希望 pyenv/Anaconda 大师可能会提出一些明智的建议,这可能会节省我数小时的清理时间.
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.
提前致谢!
推荐答案
有冲突,导致 pyenv 和 conda 都尝试默认暴露全局 Python 环境.
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设置的Python作为默认Python - 仅公开命令
conda但不激活任何环境
- Alway initialize
pyenv, use the Python set bypyenv globalas the default Python - Only expose command
condabut do NOT activate any environment from it
详情
由于你的机器上已经安装了pyenv,你只需要安装Anaconda即可.
Detail
Since pyenv has been installed on your machine, you only need to install Anaconda.
brew cask install anaconda
初始化 conda 而不暴露 conda 的基础"环境.
Init conda without exposing the "base" environment from conda.
# init conda, the following command write scripts into your shell init file automatically
conda init
# disable init of env "base"
conda config --set auto_activate_base false
完成.
注意:在此设置之后,默认的 Python 是 pyenv global 设置的那个.使用 pyenv 和 conda 分别管理环境.
Note: After this setup, the default Python is the one set by pyenv global. Use pyenv and conda to manage environments separately.
管理虚拟环境的示例.
# virtual environments from pyenv
pyenv install 3.6.9
pyenv virtualenv 3.6.9 new-env
pyenv activate new-env
pyenv deactive
# You can also use `pyenv local`
# virtual environments from conda
conda create -n new-env python=3.6
conda env list
conda activate new-env
conda deactivate
pyenv 的默认环境位置是 ~/.pyenv/versions.
Default env location for pyenv is ~/.pyenv/versions.
conda 的默认环境位置,检查 conda info 的输出.
Default env location for conda, check output from conda info.
- conda 入门李>
- 在 Conda 环境中使用 Pip,非常重要
- 如何防止 Conda 默认激活基础环境?
这篇关于除了 OSX 上现有的 pyenv 安装之外,如何安装 Anaconda?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:除了 OSX 上现有的 pyenv 安装之外,如何安装 Ana
- pytorch 中的自适应池是如何工作的? 2022-07-12
- 分析异常:路径不存在:dbfs:/databricks/python/lib/python3.7/site-packages/sampleFolder/data; 2022-01-01
- padding='same' 转换为 PyTorch padding=# 2022-01-01
- 如何在 Python 的元组列表中对每个元组中的第一个值求和? 2022-01-01
- 如何将一个类的函数分成多个文件? 2022-01-01
- 如何在 python3 中将 OrderedDict 转换为常规字典 2022-01-01
- 沿轴计算直方图 2022-01-01
- python check_output 失败,退出状态为 1,但 Popen 适用于相同的命令 2022-01-01
- python-m http.server 443--使用SSL? 2022-01-01
- 使用Heroku上托管的Selenium登录Instagram时,找不到元素';用户名'; 2022-01-01
