Can't find pip, conda, python modules after OSX Catalina update

。_饼干妹妹 提交于 2019-12-24 03:51:21

问题


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

What do I need to do to get my modules to run and pip and conda to work in my Terminal?


回答1:


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

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 Commands

To get pip to be recognized, run conda install pip after following the above steps.


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 ...

For example:

conda run jupyter notebook

will open Jupyter Notebook, but the command

jupyter notebook

might not work.


Reinstalling Jupyter Notebook

conda install -c conda-forge jupyter_contrib_nbextensions will install Jupyter Notebook, its dependencies, and its extensions.





回答2:


Are you sure you have moved the directory /Users/Shared/Relocated\ Items/Security/anaconda3 to you home directory? If not, move it first.

Alternatively, use the following command instead

export PATH="/Users/Shared/Relocated\ Items/Security/anaconda3/bin:$PATH"

In addition, you can always download and install Anaconda again on macOS Catalina. It worked out-of-the-box on my computer.




回答3:


Just copy all your codes in a new folder, close and open again anaconda.

That works for me



来源:https://stackoverflow.com/questions/58315341/cant-find-pip-conda-python-modules-after-osx-catalina-update

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!