簡體   English   中英

在終端上運行python時出錯

[英]error when running python on terminal

當我嘗試在終端中運行python時出現此錯誤

-bash: /Users/steve/Library/Enthought/Canopy_64bit/User/bin/python: No such file or directory

我最初安裝了Anaconda,然后不小心還安裝了Canopy。 這引起了一個問題,就是每次我嘗試安裝一個軟件包(例如beautifulsoup)時,它都說它已經安裝了,並說“滿足要求”(anaconda的b / c)。 當我嘗試在python上運行它時,它會說未安裝(樹冠的b / c)。 因此,我按照說明卸載了機蓋,並且仍然出現上述消息。 不知道為什么。

任何幫助將不勝感激。

您的python命令使用的鏈接指向不存在的文件/Users/rkauf/Library/Enthought/Canopy_64bit/User/bin/python

您想要更改鏈接以指向有效的python安裝。 如果它位於/usr/bin/python (請檢查which python ),則命令如下:

sudo rm /usr/bin/python # remove the old link. the -f option for ln also works
sudo ln -s /usr/bin/python2.7 /usr/bin/python # create a new link

OBS :請務必謹慎使用sudo 第一個命令將刪除文件,並且無法撤消。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM