OSX Catalina更新后找不到pip,conda,python模块 [英] Can't find pip, conda, python modules after OSX Catalina update
问题描述
我最近更新为OSX Catalina.我注意到的第一件事是anaconda3文件夹在'Relocated Items'文件夹中,因此我将其移至/Users/ethanfuerst/.现在,conda和pip都不会在我的终端上运行.当我尝试运行python文件时,它说我的模块都没有导入.
I recently updated to OSX Catalina. First thing I noticed is that the anaconda3 folder was in the 'Relocated Items' folder so I moved it to /Users/ethanfuerst/. Now, neither conda nor pip will run in my terminal. When I try to run python files, it says none of my modules are imported.
我在这里做了推荐的修复程序,但此修复程序给我这个错误:
I did the fix recommended here but this fix gives me this error:
zsh: /Users/ethanfuerst/anaconda3/bin/conda: bad interpreter: /anaconda3/bin/python: no such file or directory
要使我的模块在终端机上运行并运行pip和conda,我需要做些什么?
What do I need to do to get my modules to run and pip and conda to work in my Terminal?
推荐答案
I was able to develop a workaround for this issue by installing miniconda from Homebrew (https://brew.sh/). After installing Homebrew, type the following into Terminal:
brew cask install miniconda
一旦安装了miniconda,conda命令应该可以通过终端访问,并且您可能还希望运行conda update conda
以确保环境中的软件包一致.
Once miniconda is installed, conda commands should be accessible through Terminal and you may also want to run conda update conda
to ensure the packages in your environment are consistent.
pip命令
要使pip
被识别,请按照上述步骤运行conda install pip
.
To get pip
to be recognized, run conda install pip
after following the above steps.
最后,您将不得不重新安装Jupyter Notebook之类的工具,并且可能不得不更改打开它们的方法.可以通过带有前缀conda run ...
Finally, you will have to reinstall tools such as Jupyter Notebook and may have to change your approach to opening them. Such tools can be accessed via Terminal with the prefix conda run ...
例如:
conda run jupyter notebook
将打开Jupyter Notebook,但是命令
will open Jupyter Notebook, but the command
jupyter notebook
可能无法正常工作.
重新安装Jupyter Notebook
conda install -c conda-forge jupyter_contrib_nbextensions
将安装Jupyter Notebook,其依赖项及其扩展名.
conda install -c conda-forge jupyter_contrib_nbextensions
will install Jupyter Notebook, its dependencies, and its extensions.
这篇关于OSX Catalina更新后找不到pip,conda,python模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!