Python3.6 安裝pip3 install alipay-sdk-python -i https://pypi.tuna.tsinghua.edu.cn/simple/
遇到pycrypto安裝錯誤:
我本地用的是Windows10系統
提示錯誤與 Visual Studio 有關,但我本地是已安裝了Visual Studio
解決方案:
進行環境變量中用戶變量(不是系統變量)的設置。
變量名稱:VCINSTALLDIR
變量值:D:\VisualStudio\VC
接下來,打開cmd,執行如下命令:
set CL=/FI"%VCINSTALLDIR%\\INCLUDE\\stdint.h" %CL%
注意:如果是虛擬環境,請在虛擬環境的命令行中輸入此命令,並且命令中的符號都是英文半角的,網上有的資料中引號是中文符號,導致仍然無法安裝pycrypto
如果還報錯誤“src/winrand.c: fatal error C1083: Cannot open include file: ‘%VCINSTALLDIR%\\INCLUDE\\stdint.h’: No such file or directory”,可以嘗試把命令改爲絕對路徑。如下:
set CL=/FI"D:\\VisualStudio\\VC\\\INCLUDE\\stdint.h" %CL%
完成上述步驟之後,重新執行安裝Pycrypto的命令,就應該不出什麼問題了。
注意:建議每次執行上述命令時,先通過“set CL=
”命令,將已有設置清空。
繼續安裝alipay-sdk-python
pip3 install alipay-sdk-python -i https://pypi.tuna.tsinghua.edu.cn/simple/