安裝python3的時候就是輸入python3死活沒有反應的解決方案,python3解決方案

來源:互聯網
上載者:User

安裝python3的時候就是輸入python3死活沒有反應的解決方案,python3解決方案

我用brew安裝python3

裝完了發現 輸入python3毫無反應,檢查了 $PATH 也沒有任何問題

這個時候回去看安裝過程,發現安裝時有一個錯誤:

ERROR:The `brew link` step did not complete successfully The formula built, but is not symlinked into /usr/local Could not symlink lib/pkgconfig/python-3.6.pc

(好像是這個,安裝的時候忘了)
總之就是提醒你brew 它沒有link到python3(就是沒有安裝捷徑,電腦還不知道python3是幹啥用的)

然後電腦友情的提示你用link命令

brew link python3

解決!
.
.
.個屁啊

然後我發現還是沒有用,於是輸入命令看看doctor怎麼說:

brew doctor

看它怎麼說(我的是這樣的):

Warning: You have unlinked kegs in your CellarLeaving kegs unlinked can lead to build-trouble and cause brews that depend onthose kegs to fail to run properly once built. Run `brew link` on these: pcre python3 xz

然後還有一些warning,它會提醒你怎麼改的,其中他也會提醒你xcode也需要更新,但是如果appstore沒有提醒你更新,就說明不是xcode的版本問題。

一番搜尋後發現,需要先link xz這個東東,

於是輸入:

brew link xz

然後…又報錯:

Linking /usr/local/Cellar/xz/5.2.3... Error: Could not symlink lib/pkgconfig/liblzma.pc/usr/local/lib/pkgconfig is not writable.

然後電腦提示你,這個目錄沒有寫的許可權啊~

那我們就給他許可權:

輸入:

sudo chown -R $USER /usr/local/lib/pkgconfig 

再輸入一遍,如果有下面的結果,就說明有希望了:

brew link xzLinking /usr/local/Cellar/xz/5.2.3... 53 symlinks created

此時你可以再用brew link 一下 python3看看,我比較擔心python3安裝的時候會不會出錯啥的,所以直接重裝了一下。

這個時候輸入python3試試:

python3Python 3.6.2 (default, Jul 17 2017, 16:44:45) [GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.42)] on darwinType "help", "copyright", "credits" or "license" for more information.>>> 

終於能用了=。=

以上這篇安裝python3的時候就是輸入python3死活沒有反應的解決方案就是小編分享給大家的全部內容了,希望能給大家一個參考,也希望大家多多支援幫客之家。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.