1. 程式人生 > 程式設計 >解決python和pycharm安裝gmpy2 出現ERROR的問題

解決python和pycharm安裝gmpy2 出現ERROR的問題

python和pycharm安裝gmpy2:pip install gmpy2出現ERROR: Command errored out with exit status 1:

部分報錯程式碼

Collecting gmpy2
Using cached gmpy2-2.0.8.zip (280 kB)
Using legacy 'setup.py install' for gmpy2,since package 'wheel' is not installed.
Installing collected packages: gmpy2
Running setup.py install for gmpy2: started

Running setup.py install for gmpy2: finished with status 'error'

DEPRECATION: The -b/--build/--build-dir/--build-directory option is deprecated. pip 20.3 will remove support for this functionality. A possible replacement is use the TMPDIR/TEMP/TMP environment variable,possibly combined with --no-clean. You can find discussion regarding this at https://github.com/pypa/pip/issues/8333.

ERROR: Command errored out with exit status 1:

報錯截圖(pycharm)

在這裡插入圖片描述

解決方法(python使用者)

1.進入如下網址安裝whell(輪子):(別用pip install whell,不管用)

https://www.lfd.uci.edu/~gohlke/pythonlibs/

cp27代表2.7版本cp36代表3.6版本amd64代表64位win32代表32位

(小貼士,ctrl+F搜尋gmpy2即可找到gmpy2庫,省時又省力)

2.下載好後,把檔案拖入到你對應編輯器的Scripts資料夾裡(不用改名字)

截圖舉例

在這裡插入圖片描述

3.開啟終端,使用cd命令進入你放置下載檔案的Scripts資料夾使用如下命令:pip install + 你下載的檔案放入的資料夾路徑 + \檔名.whl(+字不用寫進去)舉例:

再次舉例

上面已經顯示gmpy2安裝成功了可以通過pip install gmpy2測試一波,顯示如下

在這裡插入圖片描述

解決方法(pycharm使用者)

因為pycharn在建立新的工作區域時會自帶一個python編輯器所以首先得看自己的編輯器器位於哪裡,是pycharm的還是安裝python時自帶的

1.方法:File–>Settings–>Project–>python Interpreter 在上方即可看到編輯器位置

在這裡插入圖片描述

如果想要改,則點選右上角的設定圖示按鈕,點選Show All 選擇你想要改的即可2.設定完成後,使用python方法的第三點,把檔案放入對應的Scripts檔案,再執行命令即可

如果安裝好了進入pycharm沒有看到,進入設定,換一個編譯器再換回來重新整理一下

總結

到此這篇關於python和pycharm安裝gmpy2 出現ERROR的解決方法的文章就介紹到這了,更多相關python和pycharm安裝gmpy2內容請搜尋我們以前的文章或繼續瀏覽下面的相關文章希望大家以後多多支援我們!