Mas OS Big Sur更新-找不到Python3/conda/pip [英] Mas OS Big Sur update - Python3 / conda / pip not found
问题描述
很抱歉,如果这是一个愚蠢的问题.我经常使用python/jupyter,从Mac OS High Sierra更新到Big Sur后,它停止工作.我试图弄清楚为什么,但是我对命令行方面并不满意.
Sorry if this is a stupid question. I use python/jupyter a lot and it's stopped working after updating from Mac OS High Sierra to Big Sur. I'm trying to figure out why, but I'm not great with command line stuff.
问题.当我尝试python3
,pip -v
,conda
等时,它说找不到命令". python
似乎仍然可以运行,但是它是2.7,我知道我有3个(我可能有一些来自不整洁文件系统的版本).我想避免再次重新安装所有软件包和东西,因为我知道它仍然在那里,而且我已经做过几次了.
The problem. When I try python3
, pip -v
, conda
, etc. it says "command not found". python
still seems to run, but it's 2.7 and I know I had 3 (I probably had a few versions from untidy file systems). I want to avoid reinstalling all my packages and things again, because I know it's still there and I've done this a few times already.
一些线索.我知道此操作系统升级将我从bash转移到zsh.我试过只是用chsh -s /bin/zsh
切换回bash,但它仍然显示未找到命令.我还注意到,操作系统更新在我的Mac HD中创建了Mac HD(位于系统/卷下方),在第二个中,似乎仍然是我的python3/conda/pip/etc.文件夹.不知道这是否/如何重要.或者,这仅仅是路径问题.
Some clues. I know this OS upgrade moves me from bash to zsh. I've tried just switching back to bash with chsh -s /bin/zsh
but it still says command not found. I also noticed the OS update creates a Mac HD (below System/Volumes) within my Mac HD, and in that second one seems to be still all my python3/conda/pip/etc. folders. Not sure if/how this matters. Or if this is just a path issue.
我只想让Jupyter在Mac上再次运行,而无需从方格重新安装我的所有无数软件包.任何帮助表示赞赏!
I just want to get Jupyter running again on my Mac without reinstalling all my myriad packages from square one. Any help appreciated!
推荐答案
经过艰苦的努力和研究,我终于找到了对我有用的东西.
After extreme toil and research, I finally found something that worked for me.
- 找到Anaconda3的位置.对我来说,它在
~/opt/anaconda3
中
- 打开终端并输入
source <location of anaconda3>/bin/activate
,然后在下一行中输入
,输入conda init zsh
- 关闭终端,然后重新打开.再次打开它时,您应该会看到一个前缀
(base)
.
- Find the location of your Anaconda3. For me it was in
~/opt/anaconda3
- Open terminal and type
source <location of anaconda3>/bin/activate
and then
in the next line, writeconda init zsh
- Close your terminal and open it again. You should see a prefix
(base)
when you open it again.
总而言之,对我来说
rko3 ~ % source opt/anaconda3/bin/activate
rko3 ~ % conda init zsh
让我知道这是否对您有用!
Let me know if this works for you!
PS.您可能会想更改$ PATH变量. Anaconda建议不要这样做.请改用此参考文献来暗示以上内容. https://docs.anaconda.com/anaconda/install/mac-os/
PS. You may be tempted to change $PATH variables. Anaconda advises against that. Use this reference instead that suggests the above. https://docs.anaconda.com/anaconda/install/mac-os/
这篇关于Mas OS Big Sur更新-找不到Python3/conda/pip的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!