conda 无法正确处理鱼 shell
conda not working correctly with fish shell
当在 macOS 上使用 fish shell 内部的 conda 环境时,python
仍然指向系统 python (/usr/local/bin/python
) 而不是指向 [= 的版本50=]由conda环境安装(<PATH TO MINICONDA>/envs/<ENV NAME>/bin/python
)。其他所有内容(例如 ipython
、jupyter
)都指向正确的路径,只是 python
没有按预期运行。我该如何解决这个问题?
详情:
在 macOS Mojave 10.14.3 上按以下顺序执行以下步骤:
- 通过 bash 安装脚本安装了 miniconda(不久前)
- 使用自制软件安装鱼
- 更新
config.fish
根据:
此时我可以在 fish 中成功激活和停用 conda 环境,但正如该问题顶部所述,python
没有指向它应该指向的位置。其他一切(例如 ipython
)都正常工作。
conf info
returns(bash和fish里面一样):
active environment : base
active env location : /Users/salamon/dev/miniconda3
shell level : 1
user config file : /Users/salamon/.condarc
populated config files :
conda version : 4.6.11
conda-build version : not installed
python version : 3.7.1.final.0
base environment : /Users/salamon/dev/miniconda3 (writable)
channel URLs : https://repo.anaconda.com/pkgs/main/osx-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/free/osx-64
https://repo.anaconda.com/pkgs/free/noarch
https://repo.anaconda.com/pkgs/r/osx-64
https://repo.anaconda.com/pkgs/r/noarch
package cache : /Users/salamon/dev/miniconda3/pkgs
/Users/salamon/.conda/pkgs
envs directories : /Users/salamon/dev/miniconda3/envs
/Users/salamon/.conda/envs
platform : osx-64
user-agent : conda/4.6.11 requests/2.21.0 CPython/3.7.1 Darwin/18.2.0 OSX/10.14.3
UID:GID : 501:20
netrc file : None
offline mode : False
在 bash 中调用 which python
:
/Users/salamon/dev/miniconda3/bin/python
在鱼中:
/usr/local/bin/python
非常感谢任何帮助,谢谢。
python doesn't point to where it should
很简单,这意味着有一个路径组件在你想要的那个之前包含一个python。在这种情况下,/usr/local/bin 在 $PATH 中的 /envs//bin/ 之前(如果它在那里的话)。
参见 command -sa python
,它应该打印 all pythons 它可以,并相应地调整你的 $PATH,可能通过将你想要的那个放入$fish_user_paths,这是 $PATH 的前缀。
当在 macOS 上使用 fish shell 内部的 conda 环境时,python
仍然指向系统 python (/usr/local/bin/python
) 而不是指向 [= 的版本50=]由conda环境安装(<PATH TO MINICONDA>/envs/<ENV NAME>/bin/python
)。其他所有内容(例如 ipython
、jupyter
)都指向正确的路径,只是 python
没有按预期运行。我该如何解决这个问题?
详情:
在 macOS Mojave 10.14.3 上按以下顺序执行以下步骤:
- 通过 bash 安装脚本安装了 miniconda(不久前)
- 使用自制软件安装鱼
- 更新
config.fish
根据:
此时我可以在 fish 中成功激活和停用 conda 环境,但正如该问题顶部所述,python
没有指向它应该指向的位置。其他一切(例如 ipython
)都正常工作。
conf info
returns(bash和fish里面一样):
active environment : base
active env location : /Users/salamon/dev/miniconda3
shell level : 1
user config file : /Users/salamon/.condarc
populated config files :
conda version : 4.6.11
conda-build version : not installed
python version : 3.7.1.final.0
base environment : /Users/salamon/dev/miniconda3 (writable)
channel URLs : https://repo.anaconda.com/pkgs/main/osx-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/free/osx-64
https://repo.anaconda.com/pkgs/free/noarch
https://repo.anaconda.com/pkgs/r/osx-64
https://repo.anaconda.com/pkgs/r/noarch
package cache : /Users/salamon/dev/miniconda3/pkgs
/Users/salamon/.conda/pkgs
envs directories : /Users/salamon/dev/miniconda3/envs
/Users/salamon/.conda/envs
platform : osx-64
user-agent : conda/4.6.11 requests/2.21.0 CPython/3.7.1 Darwin/18.2.0 OSX/10.14.3
UID:GID : 501:20
netrc file : None
offline mode : False
在 bash 中调用 which python
:
/Users/salamon/dev/miniconda3/bin/python
在鱼中:
/usr/local/bin/python
非常感谢任何帮助,谢谢。
python doesn't point to where it should
很简单,这意味着有一个路径组件在你想要的那个之前包含一个python。在这种情况下,/usr/local/bin 在 $PATH 中的 /envs//bin/ 之前(如果它在那里的话)。
参见 command -sa python
,它应该打印 all pythons 它可以,并相应地调整你的 $PATH,可能通过将你想要的那个放入$fish_user_paths,这是 $PATH 的前缀。