国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

python 安裝庫pycrypto失敗的一系列問題[已解決]

這篇具有很好參考價值的文章主要介紹了python 安裝庫pycrypto失敗的一系列問題[已解決]。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

需要安裝pycrypto這個庫。

/*****************安裝pycryptodome***********************/

說來難受,后面發(fā)現(xiàn)這個貌似不再維護了,可以安裝另外一個庫pycryptodome,是這個庫的延伸版本,和這個庫的作用是一樣的,我也是看別人的。
安裝pycryptodome

pip install pycryptodome
/*****************安裝pycryptodome***********************/

安裝pycrypto

需要安裝pycrypto的繼續(xù):注意3.9以上版本的python可能都無法使用。存在一個錯誤。

  File "c:\Users\ice\Desktop\112.py", line 7, in <module>
    cipher = AES.new(key, AES.MODE_ECB)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\software\compiler\python\python3.11.5\Lib\site-packages\Crypto\Cipher\AES.py", line 95, in new
    return AESCipher(key, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\software\compiler\python\python3.11.5\Lib\site-packages\Crypto\Cipher\AES.py", line 59, in __init__
    blockalgo.BlockAlgo.__init__(self, _AES, key, *args, **kwargs)
  File "D:\software\compiler\python\python3.11.5\Lib\site-packages\Crypto\Cipher\blockalgo.py", line 141, in __init__
    self._cipher = factory.new(key, *args, **kwargs)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SystemError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats

目前知道是要加宏定義

Note For all # variants of formats (s#, y#, etc.), the macro PY_SSIZE_T_CLEAN must be defined before including Python.h. On Python 3.9 and older, the type of the length argument is Py_ssize_t if the PY_SSIZE_T_CLEAN macro is defined, or int otherwise.

但是還沒有測試,不知道要怎么加。

python3.8版本測試是可以使用的。python3.8版本以下都可以使用。
應該是不兼容。python3.9以上版本,需要有定義
繼續(xù)安裝 pycrypto

pip install pycrypto

但是直接安裝就會出現(xiàn)錯誤如下:

Building wheels for collected packages: pycrypto
  Building wheel for pycrypto (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for pycrypto (pyproject.toml) did not run successfully.exit code: 1
  ╰─> [2 lines of output]
      warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.
      error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pycrypto
Failed to build pycrypto
ERROR: Could not build wheels for pycrypto, which is required to install pyproject.toml-based projects

error: Microsoft Visual C++ 14.0 or greater is required. Get it with “Microsoft C++ Build Tools”: https://visualstudio.microsoft.com/visual-cpp-build-tools/

這說需要一個C++ 14.0以上的版本
https://visualstudio.microsoft.com/visual-cpp-build-tools/
去這個網(wǎng)址下載一個安裝工具

error: could not build wheels for pycrypto, which is required to install pyp,python,python,visual studio

下載后直接運行安裝

error: could not build wheels for pycrypto, which is required to install pyp,python,python,visual studio
在下載過程中還可以確認一個東西,但是實際上只要下載了python版本都自己帶有,不管是老版本還是新版本,3.8,3.11親測都有,這個東西就是setuptools。這個的版本應該和python安裝的時間有關(guān),安裝早的版本可能會老一點。
安裝這個c++編譯器 Microsoft Visual C++ ,需要有配對的setuptools版本。
安裝最新的Microsoft Visual C++,需要配備最新的setuptools。(實踐證明較新的也可以,估測60版本以上都可以)

Microsoft Visual C++ 14.2 standalone: Build Tools for Visual Studio 2019 (x86, x64, ARM, ARM64)
This is a standalone version of Visual C++ 14.2 compiler, you don't need to install Visual Studio 2019.

In Build tools, install C++ build tools and ensure the latest versions of MSVCv142 - VS 2019 C++ x64/x86 build tools and Windows 10 SDK are checked.
The setuptools Python package version must be at least 34.4.0.

安裝Visual C++ 14.2 compiler版本的需要setuptools至少34.4.0。
詳細版本對應可以參考Visual C++ 14.2 compiler對應版本

查看setuptools版本的方法。

>>> import setuptools
>>> print(setuptools._version__)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'setuptools' has no attribute '_version__'. Did you mean: '__version__'?
>>> print(setuptools.__version__)
65.5.0

我查了3.8和3.11的python,版本差別不大的,都是高版本(11:68)。我的是65版本,可以直接安裝最新的Visual C++ 14.3。(setuptools的版本應該和python版本關(guān)系不大,和python的安裝時間有關(guān),大家可以查看自己的版本,在65以上必然就可以安裝最新的)

安裝好后會出現(xiàn)如下界面:

error: could not build wheels for pycrypto, which is required to install pyp,python,python,visual studio
選中使用C++的桌面開發(fā)這個即可,然后右邊有默認選項,會默認選了五個,后兩個可以不用選,不會有影響,但是選上也沒占多少內(nèi)存。建議默認選項即可。
最好是默認,默認可以成果,其他的可能存在錯誤(選低版本的SDK和編譯器會報錯)
另外這里要注意選的是windows 11 SDK,這個無論你是window10的系統(tǒng)還是window11的系統(tǒng)都可以安裝,親測有效,win7其他的就不清楚了。
同時還可以修改安裝位置,安裝這個編譯器包括這個window11SDK,總共大小有接近6G,可以換到其他盤進行安裝,同時也可以取消勾選保留下載緩存。
error: could not build wheels for pycrypto, which is required to install pyp,python,python,visual studio
下載安裝需要一定時間,不需要連到外網(wǎng)也可以下載。

error: could not build wheels for pycrypto, which is required to install pyp,python,python,visual studio
安裝好后繼續(xù)輸入:

pip install pycrypto

發(fā)現(xiàn)會有另外一個錯誤。

error: could not build wheels for pycrypto, which is required to install pyp,python,python,visual studio

 C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt\inttypes.h(31): error C2061: 語法錯誤: 標識符“intmax_t”

提示這個文件存在語法錯誤。標識符錯誤,這個變量類型錯誤。

參考這篇文章解決的。
https://blog.csdn.net/miffy2017may/article/details/107546033
方法如下:
1、找到你剛剛下載的編譯器保存的文件位置。

C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.39.33519\include

默認是這個路徑,可能版本區(qū)別,路徑會有些許區(qū)別,但也可以找到。

2、找到這個路徑下的一個文件stdint.h,復制該文件
error: could not build wheels for pycrypto, which is required to install pyp,python,python,visual studio
3、找到另外一個文件夾C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\ucrt
這個文件夾,大家都有的,將上一步復制的stdint.h復制到這個文件夾下。

4、編輯該文件夾下的inttypes.h文件,記事本打開即可

error: could not build wheels for pycrypto, which is required to install pyp,python,python,visual studio
5、修改文件中的#include <stdint.h>,為 #include “stdint.h”,就是把尖括號改為雙引號。涉及c頭文件讀取方面的問題。

error: could not build wheels for pycrypto, which is required to install pyp,python,python,visual studio
完成上面步驟,再次運行命令 pip install pycrypto。

error: could not build wheels for pycrypto, which is required to install pyp,python,python,visual studio
這樣就成功安裝pycrypto

貌似沒用了,都2024年了,用pycryptodome吧。
安裝pycryptodome。

pip install pycryptodome

這是注定一個悲劇的晚上,以此篇注定無人問津的文章哀悼。文章來源地址http://www.zghlxwxcb.cn/news/detail-845242.html

到了這里,關(guān)于python 安裝庫pycrypto失敗的一系列問題[已解決]的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權(quán),不承擔相關(guān)法律責任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實不符,請點擊違法舉報進行投訴反饋,一經(jīng)查實,立即刪除!

領(lǐng)支付寶紅包贊助服務器費用

相關(guān)文章

  • 如何解決python安裝mysqlclient失敗問題

    如何解決python安裝mysqlclient失敗問題

    在使用Django等框架來操作MySQL時,實際上底層還是通過Python來操作的,首先需要安裝一個驅(qū)動程序,在Python3中,驅(qū)動程序有多種選擇,比如有pymysql以及mysqlclient等。使用pip命令安裝mysqlclient失敗應如何解決? ? 機器同時安裝了python2和python3版本,以安裝的Python 3.7.0 (32 bit)為例

    2024年03月27日
    瀏覽(27)
  • 安裝fasttext的一系列問題(全)

    安裝fasttext的一系列問題(全)

    環(huán)境配置:windows10+python3.10 前言:Gensim中的fasttext不能做文本分類,對于想學習fasttext進行文本分類、情感分析的同學還是必須下載Facebook的fasttext 在該python libs (或者粘貼該鏈接https://www.lfd.uci.edu/~gohlke/pythonlibs/#fasttext)搜索fasttext 下載whl文件,文件名: fasttext-0.9.2-cp310-cp31

    2024年02月06日
    瀏覽(40)
  • 阿里云彈性云桌面安裝失敗問題解決記錄(.net framework 4.6.2 or later:Error Code: 12029)

    阿里云彈性云桌面安裝失敗問題解決記錄(.net framework 4.6.2 or later:Error Code: 12029)

    1,問題 圖像顯示客戶端安裝錯誤 ? ? 然后我就手動下載了,這個文件 下載好之后是這個文件 ? ? 然后安裝一下就報了這個錯誤 .net framework 4.6.2 or later:Error Code: 12029 這個問題是.net framework 4.6.2文件有問題,把他重新安裝就好了 然后又發(fā)現(xiàn).net framework 4.6.2安裝不了 解決了這個

    2024年02月06日
    瀏覽(16)
  • 安裝node-sass失敗 或 npm install Error: not found: python2 解決方案

    1. 安裝python2 可以用npm命令安裝 也可以自行下載安裝 Python 2.7 2. 安裝完畢后配置環(huán)境變量 3.再配置一下版本 node-sass 實在太坑了,之前遇到安裝失敗使用方法一完美解決。最近又一次遇到了,但是方法一又無效了。于是我又在網(wǎng)上找到另一個方法,就是用 dart-sass 來替換 node

    2024年02月13日
    瀏覽(104)
  • Python + selenium 安裝問題,pip install selenium失敗及解決方法

    Python + selenium 安裝問題,pip install selenium失敗及解決方法

    ? ? ? ? ? 最近想要是使用Python 訪問下瀏覽器,網(wǎng)上關(guān)于這些東西都很多,Python 安裝和 selenium 的下載就不贅述,這里簡單總結(jié)一下第一次安裝Python + selenium中遇到的問題。 ? ? Python傻瓜式安裝,但注意 安裝目錄選擇 , 環(huán)境變量的添加 。 ? ??selenium.exe下載對應瀏覽器對應

    2024年02月11日
    瀏覽(19)
  • RabbitMQ啟動失敗的一系列嘗試

    RabbitMQ啟動失敗的一系列嘗試

    在三臺 CentOS 7.x上部署了RabbitMQ集群,如下: ?服務器IP hostname 節(jié)點說明 端口 管控臺地址 192.168.31.101 master rabbitmq master 5672 http://192.168.11.71:15672 192.168.31.102 slave1 rabbitmq slave 5672 http://192.168.11.72:15672 192.168.31.103 slave2 rabbitmq slave 5672 http://192.168.11.73:15672 集群部署教程可參考:Rabb

    2024年02月04日
    瀏覽(15)
  • 由ImportError: No module named openpyxl引發(fā)的一系列python問題

    由ImportError: No module named openpyxl引發(fā)的一系列python問題

    場景描述 如下是我在運行python文件時出現(xiàn)的一系列問題,沒有和我一樣問題的,大家可以找自己對應的問題,不需要一點一點看,謝謝大家。 問題1:運行py文件出現(xiàn)ImportError: No module named openpyxl錯誤 在執(zhí)行某個python文件時,出現(xiàn)了該錯誤,是因為沒有相關(guān)模塊造成的。 解決方

    2024年02月02日
    瀏覽(28)
  • 解決yolov5運行環(huán)境——pycocotools >= 2.0 安裝失敗問題 error: Microsoft Visual C++ 14.0 or greater is required.
error: Microsoft Visual C++ 14.0 or greater is required.

    解決yolov5運行環(huán)境——pycocotools >= 2.0 安裝失敗問題 error: Microsoft Visual C++ 14.0 or greater is required. error: Microsoft Visual C++ 14.0 or greater is required.

    在使用pip install pycocotools 安裝時總是失敗 當出現(xiàn)該問題時,本人嘗試去百度上搜索相關(guān)的解決方案,嘗試了好多方法還是安裝失敗,失敗的嘗試如下: 嘗試1: 安裝Microsoft Visual C++ Build Tools 2015 ?????????????顯示安裝包都是丟失或損壞,然后本人就去尋找別的版本的M

    2024年02月05日
    瀏覽(34)
  • Win解答 | 解決鍵盤中 字母+空格 導致的輸入法彈窗導致的一系列問題

    Win解答 | 解決鍵盤中 字母+空格 導致的輸入法彈窗導致的一系列問題

    近三個月來,一直都有一個鍵盤組合鍵的問題影響我的電腦使用,不管是打字還是打游戲,都會出現(xiàn)按鍵盤的 字母+空格 彈出一個特殊符號的候選框,如下圖所示 圖片中為 S+空格 所出現(xiàn)的彈窗 一個看似方便,實則難受的功能 其實打字寫代碼的時候還好,只是速度快的時候關(guān)

    2024年02月10日
    瀏覽(25)
  • 解決Visual C++2008安裝失敗,error 1935

    解決Visual C++2008安裝失敗,error 1935

    重裝系統(tǒng)后Visual C++沒了,其他都能裝上但VC2008會報這個error 1935。 鑒于我把網(wǎng)上所有的解決方法排了一遍錯,我也不知道是哪一步起效,所以就都放上來了。 特別注意:報error 1935的錯誤原因可能不盡相同,比如我的報錯開頭為An error occurred,結(jié)尾為HRESULT:0x80070005。 80070005

    2024年02月15日
    瀏覽(27)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包