After so many try with errors, now i have one solution for pycrypto and splunklib
Code of my Docker file that need to update :
FROM python:3.8-slim
RUN mkdir /app
WORKDIR /app
COPY requirements.txt /app
RUN pip install --no-cache-dir -r requirements.txt
RUN apt-get update && apt-get install -y --no-install-recommends gcc build-
essential postgresql libpq-dev vim
COPY . /app
WORKDIR /app/api
EXPOSE 3000
CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "3000", "--reload"]
requirements.txt have
…
pycryptodome==3.14.1
splunk-sdk==1.6.19
splunklib==1.0.0
….
below error was showing for me when try to run above docker file code
Building wheel for splunk-sdk (setup.py): started
#9 80.50 Building wheel for splunk-sdk (setup.py): finished with status 'done'
#9 80.51 Created wheel for splunk-sdk: filename=splunk_sdk-1.6.20-py3-none-any.whl
size=124053 sha256=ddce3663bb166c6732e18f1ed95187528c2a666b996eff7dfac00302cf9771d7
#9 80.51 Stored in directory: /tmp/pip-ephem-wheel-cache-
frl315nd/wheels/f7/a1/72/b2474c8ffe6b02fe24078e3413ed668fe6b85dfb17cd8e64c2
#9 80.51 Building wheel for pycrypto (setup.py): started
#9 92.72 Building wheel for pycrypto (setup.py): finished with status 'error'
#9 92.76 error: subprocess-exited-with-error
Running setup.py install for pycrypto: started
#9 106.8 Running setup.py install for pycrypto: finished with status 'error'
#9 106.9 error: subprocess-exited-with-error note: This error originates from a subprocess, and is likely not a problem with pip.
#9 106.9 error: legacy-install-failure
#9 106.9 Encountered error while trying to install package.
#9 106.9 pycrypto
**Solution ** — Now i am updating docker file with below code
FROM python:3.8-slim
RUN mkdir /app
WORKDIR /app
COPY requirements.txt /app
RUN apt-get update && apt-get install -y --no-install-recommends gcc build-essential postgresql libpq-dev vim
RUN apt-get install -y --no-install-recommends libssl-dev libffi-dev
RUN pip install --no-cache-dir -r requirements.txt
COPY . /app
WORKDIR /app/api
EXPOSE 3000
CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "3000", "--reload"]
ATTENTION!!! As pycrypto is not maintained anymore, please switch to pycryptodome.
That’s how I did it. Extract from my README.md:
Installing on Windows
Install Python
Checked with Python 3.7 x64 on Windows 10 x64 Version 1803.
Get it from the Python homepage
Install launcher for all users
Add Python to PATH
Adds %ProgramFiles%Python37 + Scripts to PATHUse Customize Installation (!!! necessary for advanced options !!!)
Advanced Options
- Install for all users
Install Visual C++ Build Tools
Checked with Visual Studio 2017.
Get the Build Tools from the Visual Studio download page (link as of 2018-11)
Install Visual C++ Build Tools with additional standard components
- Windows 10 SDK
- Visual C++ Tools for CMake
- Core Tools for Testing
Install necessary Python modules
- Start an elevated(!!!) VS Developer Command Prompt (Run As Admin via Right Click)
- Update PIP first:
python -m pip install --upgrade pip
- Install pycrypto module
pycrypto has to compile some code due to legal restrictions on cryptography, so this is why the VC++ Build Tools had to be installed and the VS Developer Command Prompt had to be started.
There’s a small issue with the pycrypto source, so as a workaround we have to include the correct header by setting the environment variable CL.
set CL=-FI"%VCToolsInstallDir%includestdint.h"
pip install pycrypto
- Exit VS Developer Command Prompt:
exit
The Visual C++ Build Tools may be deinstalled now, but it’s recommended to keep them installed to be able to upgrade pycrypto when necessary.
To install other modules just a normal but elevated(!!!) Command Prompt is needed (Run As Admin via Right Click).
first of all, you’re a wizard. So jot that down. I’ve been fighting this problem for three days. I know what it is now, when you click «install for all users» there’s an aditional dep that’s added along with it (you check one box, so python installs the other. I think it’s pre-compile some setup.py thing) anyways. You’re the real MVP. If you have problems with your wife/husband, boss, anyone, just let em know you’re legit a god. reference me if necessary. Thanks man. You’ve helped my project out in a huge way.
ValueError: invalid version number '2.20.51.20100613'
I’m having problems installing pycrypto. Tried package manager: pip & easy_install, didn’t work. Tried to manually install it via «python setup.py install», the same error like the above appears.
I’ve followed the instructions here and got stuck at installing pycrypto after installing «mingW» gcc, g++ and msys-base (MSYS shell environment)
Not really sure what to do now after several days of trying.
Here’s the complete output of the error:
C:UsersDenzDesktop>pip install pycrypto
Downloading/unpacking pycrypto
Running setup.py egg_info for package pycrypto
Installing collected packages: pycrypto
Running setup.py install for pycrypto
Traceback (most recent call last):
File "", line 1, in ?
File "C:UsersDenzDesktopbuildpycryptosetup.py", line 340, in ?
core.setup(**kw)
File "C:Python24libdistutilscore.py", line 149, in setup
dist.run_commands()
File "C:Python24libdistutilsdist.py", line 946, in run_commands
self.run_command(cmd)
File "C:Python24libdistutilsdist.py", line 966, in run_command
cmd_obj.run()
File "c:python24libsite-packagesdistribute-0.6.14-py2.4.eggsetuptools
commandinstall.py", line 53, in run
return _install.run(self)
File "C:Python24libdistutilscommandinstall.py", line 506, in run
self.run_command('build')
File "C:Python24libdistutilscmd.py", line 333, in run_command
self.distribution.run_command(command)
File "C:Python24libdistutilsdist.py", line 966, in run_command
cmd_obj.run()
File "C:Python24libdistutilscommandbuild.py", line 112, in run
self.run_command(cmd_name)
File "C:Python24libdistutilscmd.py", line 333, in run_command
self.distribution.run_command(command)
File "C:Python24libdistutilsdist.py", line 966, in run_command
cmd_obj.run()
File "C:Python24libdistutilscommandbuild_ext.py", line 253, in run
force=self.force)
File "C:Python24libdistutilsccompiler.py", line 1177, in new_compiler
return klass (None, dry_run, force)
File "C:Python24libdistutilscygwinccompiler.py", line 292, in init
CygwinCCompiler.__init__ (self, verbose, dry_run, force)
File "C:Python24libdistutilscygwinccompiler.py", line 83, in __init__
self.gcc_version, self.ld_version, self.dllwrap_version =
File "C:Python24libdistutilscygwinccompiler.py", line 424, in get_versions
ld_version = StrictVersion(result.group(1))
File "C:Python24libdistutilsversion.py", line 40, in __init__
self.parse(vstring)
File "C:Python24libdistutilsversion.py", line 107, in parse
raise ValueError, "invalid version number '%s'" % vstring
ValueError: invalid version number '2.20.51.20100613'
Answer by Rowan Tran
5
Looks like you’re in a virtualenv. Is your virtualenv activated properly?
– Christian Ternus
Oct 27 ’13 at 20:44
,To install a virtual environment and setup everything, use the following commands:,from crypto.Cipher import AES,from Crypto.Cipher import AES
I had the same problem on my Mac when installing with pip
. I then removed pycrypto
and installed it again with easy_install
, like this:
pip uninstall pycrypto
easy_install pycrypto
Answer by Alexis Novak
I am getting error while importing , Python ImportError No module named Crypto Cipher ,Please help to resolve this.,53632/python-importerror-no-module-named-crypto-cipher
I am getting error while importing
from Crypto.Cipher import AES
Please help to resolve this.
Traceback (most recent call last):
File "test.py", line 2, in
from Crypto.Cipher import AES
ImportError: No module named Crypto.Cipher
Answer by Bear Shields
What am I doing wrong? ,I’m fairly new to Python and when I try to open the CodeSection.py file via terminal, I get error saying from Crypto.Cipher import AES
ImportError: No Module Named Crypto.Cipher,The point is, when you install pycrypto, you should remove Crypto first,This will install pycrypto for Python2 only.
Answer #1:
pip uninstall Crypto
pip uninstall pycrypto
pip install pycrypto
Answer by Sarai Wilkerson
I followed the README and I am trying to test access point vulnerabilities. I am using Kali linux VM with a TL-WN722N NIC Card and I am testing the vulnerability on a Linksys WRT54GL wireless router. When I run sudo wpa_supplicant -D nl80211 -i wlan0 -c network.conf it says Successfully initialized wpa_supplicant, but when I run the command with the ./krack-ft-test.py I get this error. I was successfully able to get everything working up to this point, however Crypto is not found.,
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
,Thanks for the discussion. I’ve updated the README to hopefully avoid others having the issue in the future. The recommend way is to create the python virtual environment using ./pysetup.sh and then loading it using:,I run source venv/bin/activate each time I open a new terminal instance as root. I am running the scripts in krackattack-scripts/krackattack directory because that is where the krack-ft-test.py and network.conf files are located. I am I missing a step to give my script access to the virtual environment? I am also running all of these commands in the Linux terminal, not the python terminal because they are Linux syntax.
sudo ./krack-ft-test.py wpa_supplicant -D nl80211 -i wlan0 -c network.conf
Traceback (most recent call last):
File "/home/user/krackattacks-scripts/krackattack/./krack-ft-test.py", line 11, in <module>
from libwifi import *
File "/home/user/krackattacks-scripts/krackattack/libwifi/__init__.py", line 1, in <module>
from .wifi import *
File "/home/user/krackattacks-scripts/krackattack/libwifi/wifi.py", line 6, in <module>
from Crypto.Cipher import AES
ModuleNotFoundError: No module named 'Crypto'
Answer by Janiyah Davis
The solution for Importerror no module named crypto cipher is to install / reinstall pycrypto python module properly or set its correct path. In this article, We will see the various way of installing the pycrypto with various package manager.,In python 3, you may be getting warning related to the pycrypto module. It is highly recommended to install the pycryptodome module on the place of the pycrypto with python 3 In such scenarios, you must uninstall the previous install version of pycrypto module. Here is the command for that.,Firstly, We will cover the most popular way for installing the pycrypto using pip package manager. Then we will cover the easy_install method to fix this problem.,The another way is to use easy_install for having pycrypto install. Here is the command for that.
Here is the command for pip.
pip install pycrypto
Also if you need admin rights before you run this command, Please add sudo before it.
sudo pip install pycrypto
If you are getting errors in running the above command simply its because of some incompatible issue is there. Then you should first uninstall the previous one and then install the latest or compatible one. Use the below command for uninstalling it.
sudo pip uninstall pycrypto
easy_install pycrypto
In python 3, you may be getting warning related to the pycrypto module. It is highly recommended to install the pycryptodome module on the place of the pycrypto with python 3 In such scenarios, you must uninstall the previous install version of pycrypto module. Here is the command for that.
pip3 uninstall pycrypto
pip3 install pycryptodome
Answer by Peyton Cameron
Running pip install pycrypto gives me the following error:,I’ve even tried easy_install pycrypto, yet I get an error:,Am I doing something wrong? Is it a compatibility issue? How do I get around this?,Even after this, running python -m Cryptodome.SelfTest was giving me an error, but when I re-ran the file, it worked.
It looks like PyCrypto
is not being maintained currently. So, it’s better you switch to PyCryptodome.
pip install pycryptodome
Answer by Dillon Kennedy
use pip command to install the following dependent libraries, ignoring the error report :pip install pycryptodome
pip install crypto
pip install pycrypto, my python version is 3.7, use pip install pycrypto command the times wrong :, rerun the program to find out No module named ‘Crypto’ report the error and disappear. , use pip command to install the following dependent libraries, ignoring the error report :
Crypto dependent library of
pip install pycryptodome
pip install crypto
pip install pycrypto
my python version is 3.7, use pip install pycrypto
command the times wrong :
C:UsersMIAppDataLocalProgramsPythonPython37>Pip3.7 install pycrypto
Collecting pycrypto
Using cached pycrypto-2.6.1.tar.gz (446 kB)
Using legacy 'setup.py install' for pycrypto, since package 'wheel' is not installed.
Installing collected packages: pycrypto
Running setup.py install for pycrypto ... error
ERROR: Command errored out with exit status 1:
command: 'c:usersmiappdatalocalprogramspythonpython37python37.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\MI\AppData\Local\Temp\pip-install-iwoi68sx\pycrypto_11418f0350244305b0226b38fc392f84\setup.py'"'"'; __file__='"'"'C:\Users\MI\AppData\Local\Temp\pip-install-iwoi68sx\pycrypto_11418f0350244305b0226b38fc392f84\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:UsersMIAppDataLocalTemppip-record-8g35bcmiinstall-record.txt' --single-version-externally-managed --compile --install-headers 'c:usersmiappdatalocalprogramspythonpython37Includepycrypto'
use pip
command to install the following dependent libraries, ignoring the error report :
pip install pycryptodome
pip install crypto
pip install pycrypto
Answer by Marianna Velez
PyCrypto is written and tested using Python version 2.1 through 3.3. Python
1.5.2 is not supported.,If you have any comments, corrections, or improvements for this
package, please report them to our mailing list, accessible via the
PyCrypto website:,A stronger version of Python’s standard “random” module is also
provided:,Caveat: For the random number generator to work correctly, you must
call Random.atfork() in both the parent and child processes after
using os.fork()
An example usage of the SHA256 module is:
>>> from Crypto.Hash import SHA256
>>> hash = SHA256.new()
>>> hash.update('message')
>>> hash.digest()
'xabSnx13xe4Yx14x98+yxf9xb7xe3xfbxa9x94xcfxd1xf3xfb"xf7x1cxeax1axfbxf0+Fx0cmx1d'
An example usage of an encryption algorithm (AES, in this case) is:
>>> from Crypto.Cipher import AES
>>> obj = AES.new('This is a key123', AES.MODE_CBC, 'This is an IV456')
>>> message = "The answer is no"
>>> ciphertext = obj.encrypt(message)
>>> ciphertext
'xd6x83x8dd!VTx92xaa`Ax05xe0x9bx8bxf1'
>>> obj2 = AES.new('This is a key123', AES.MODE_CBC, 'This is an IV456')
>>> obj2.decrypt(ciphertext)
'The answer is no'
As of PyCrypto 2.1.0, PyCrypto provides an easy-to-use random number
generator:
>>> from Crypto import Random
>>> rndfile = Random.new()
>>> rndfile.read(16)
'xf7.x838{x85xa0xd3>#}xc6xc2jJU'
A stronger version of Python’s standard “random” module is also
provided:
>>> from Crypto.Random import random
>>> random.choice(['dogs', 'cats', 'bears'])
'bears'
I am trying to install PyCrypto 2.6 Library on my computer. But I keep getting the following error
D:SoftwarePythonpackagepycrypto-2.6>python setup.py build
running build
running build_py
running build_ext
warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.
building 'Crypto.Random.OSRNG.winrandom' extension
error: Unable to find vcvarsall.bat
My System has
Windows 8 Pro 64-bit, Visual Studio Enterprise 2012 and Python 3.3
To fix the error I tried to set the Environment Variable VS90COMNTOOLS=%VS110COMNTOOLS%
as advised by fmuecke in the post error: Unable to find vcvarsall.bat but it didn’t work for me.
Can any one please advise me how to fix this error.
FYI, I don’t to install VC2008 etc..
asked Dec 9, 2012 at 12:09
Khurram MajeedKhurram Majeed
2,2518 gold badges37 silver badges57 bronze badges
3
I managed to install PyCrypto 2.6 by using the prebuilt binary for Python3.3 from The Voidspace Python Modules.
It doesn’t actually fix the error: Unable to find vcvarsall.bat
for other package which don’t have a prebuilt binaries available.
However it eliminates the need to build PyCrypto package, allowing me to install PyCrypto on my system without getting the error.
answered Dec 9, 2012 at 13:04
Khurram MajeedKhurram Majeed
2,2518 gold badges37 silver badges57 bronze badges
1
I know this is an old question, but I also need today much time to get paramiko wokring.
I want to use Python 3.4 and on voidspace, there are no prebuild binaries for 3.4.
Finally, I got a wokring pycrypto by installing «Microsoft Studio Express 2010 C++» and run from the pycrypto 2.7 folder:
python setup.py build --compiler msvc
python setup.py install
python setup.py bdist_wininst
All the «tricks» with enviroment variables doesn’t work for me.
If it helps somebody, all the thanks goes to:
http://flintux.wordpress.com/2014/04/30/pycrypto-for-python-3-4-on-windows-7-64bit/
answered Jul 15, 2014 at 19:26
0
You may install mingw64 and then run from the PyCrypto unzipped files directory:
python setup.py build —compiler=mingw32
answered May 15, 2013 at 14:11
Updated answer for 2021 (many other answers are outdated)
Python 2.7 is EOL (end-of-life), and Microsoft has removed the download link for the Visual C++ 8.0 compiler, which was needed for compiling native Python 2.7 modules (and which they later called something like «C++ compiler for Python 2.7», VCForPython27.msi
). Therefore pip install pycrypto
no longer works.
To see for yourserlf, check out this answer with a now defunct download link. Don’t search for VCForPython27
on GitHub — you will find projects, but they are not official Microsoft projects, so you may want to stay away from those.
If you find yourself in this situation, then seriously, it’s high time to migrate to Python 3. Don’t download old builds of PyCrypto or Visual C++ 8.0 from random websites or from web archive links, especially not since this is a library for cryptography that should be kept up to date.
answered Nov 3, 2021 at 15:10
Florian WinterFlorian Winter
4,5401 gold badge43 silver badges67 bronze badges
if you are
VS 2010
SET VS90COMNTOOLS=%VS100COMNTOOLS%
VS 2012
SET VS90COMNTOOLS=%VS110COMNTOOLS%
VS 2013
SET VS90COMNTOOLS=%VS120COMNTOOLS%
and then
python setup.py install
answered Jul 20, 2017 at 0:04
I am trying to install PyCrypto 2.6 Library on my computer. But I keep getting the following error
D:SoftwarePythonpackagepycrypto-2.6>python setup.py build
running build
running build_py
running build_ext
warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.
building 'Crypto.Random.OSRNG.winrandom' extension
error: Unable to find vcvarsall.bat
My System has
Windows 8 Pro 64-bit, Visual Studio Enterprise 2012 and Python 3.3
To fix the error I tried to set the Environment Variable VS90COMNTOOLS=%VS110COMNTOOLS%
as advised by fmuecke in the post error: Unable to find vcvarsall.bat but it didn’t work for me.
Can any one please advise me how to fix this error.
FYI, I don’t to install VC2008 etc..
asked Dec 9, 2012 at 12:09
Khurram MajeedKhurram Majeed
2,2518 gold badges37 silver badges57 bronze badges
3
I managed to install PyCrypto 2.6 by using the prebuilt binary for Python3.3 from The Voidspace Python Modules.
It doesn’t actually fix the error: Unable to find vcvarsall.bat
for other package which don’t have a prebuilt binaries available.
However it eliminates the need to build PyCrypto package, allowing me to install PyCrypto on my system without getting the error.
answered Dec 9, 2012 at 13:04
Khurram MajeedKhurram Majeed
2,2518 gold badges37 silver badges57 bronze badges
1
I know this is an old question, but I also need today much time to get paramiko wokring.
I want to use Python 3.4 and on voidspace, there are no prebuild binaries for 3.4.
Finally, I got a wokring pycrypto by installing «Microsoft Studio Express 2010 C++» and run from the pycrypto 2.7 folder:
python setup.py build --compiler msvc
python setup.py install
python setup.py bdist_wininst
All the «tricks» with enviroment variables doesn’t work for me.
If it helps somebody, all the thanks goes to:
http://flintux.wordpress.com/2014/04/30/pycrypto-for-python-3-4-on-windows-7-64bit/
answered Jul 15, 2014 at 19:26
0
You may install mingw64 and then run from the PyCrypto unzipped files directory:
python setup.py build —compiler=mingw32
answered May 15, 2013 at 14:11
Updated answer for 2021 (many other answers are outdated)
Python 2.7 is EOL (end-of-life), and Microsoft has removed the download link for the Visual C++ 8.0 compiler, which was needed for compiling native Python 2.7 modules (and which they later called something like «C++ compiler for Python 2.7», VCForPython27.msi
). Therefore pip install pycrypto
no longer works.
To see for yourserlf, check out this answer with a now defunct download link. Don’t search for VCForPython27
on GitHub — you will find projects, but they are not official Microsoft projects, so you may want to stay away from those.
If you find yourself in this situation, then seriously, it’s high time to migrate to Python 3. Don’t download old builds of PyCrypto or Visual C++ 8.0 from random websites or from web archive links, especially not since this is a library for cryptography that should be kept up to date.
answered Nov 3, 2021 at 15:10
Florian WinterFlorian Winter
4,5401 gold badge43 silver badges67 bronze badges
if you are
VS 2010
SET VS90COMNTOOLS=%VS100COMNTOOLS%
VS 2012
SET VS90COMNTOOLS=%VS110COMNTOOLS%
VS 2013
SET VS90COMNTOOLS=%VS120COMNTOOLS%
and then
python setup.py install
answered Jul 20, 2017 at 0:04
After so many try with errors, now i have one solution for pycrypto and splunklib
Code of my Docker file that need to update :
FROM python:3.8-slim
RUN mkdir /app
WORKDIR /app
COPY requirements.txt /app
RUN pip install --no-cache-dir -r requirements.txt
RUN apt-get update && apt-get install -y --no-install-recommends gcc build-
essential postgresql libpq-dev vim
COPY . /app
WORKDIR /app/api
EXPOSE 3000
CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "3000", "--reload"]
requirements.txt have
…
pycryptodome==3.14.1
splunk-sdk==1.6.19
splunklib==1.0.0
….
below error was showing for me when try to run above docker file code
Building wheel for splunk-sdk (setup.py): started
#9 80.50 Building wheel for splunk-sdk (setup.py): finished with status 'done'
#9 80.51 Created wheel for splunk-sdk: filename=splunk_sdk-1.6.20-py3-none-any.whl
size=124053 sha256=ddce3663bb166c6732e18f1ed95187528c2a666b996eff7dfac00302cf9771d7
#9 80.51 Stored in directory: /tmp/pip-ephem-wheel-cache-
frl315nd/wheels/f7/a1/72/b2474c8ffe6b02fe24078e3413ed668fe6b85dfb17cd8e64c2
#9 80.51 Building wheel for pycrypto (setup.py): started
#9 92.72 Building wheel for pycrypto (setup.py): finished with status 'error'
#9 92.76 error: subprocess-exited-with-error
Running setup.py install for pycrypto: started
#9 106.8 Running setup.py install for pycrypto: finished with status 'error'
#9 106.9 error: subprocess-exited-with-error note: This error originates from a subprocess, and is likely not a problem with pip.
#9 106.9 error: legacy-install-failure
#9 106.9 Encountered error while trying to install package.
#9 106.9 pycrypto
**Solution ** — Now i am updating docker file with below code
FROM python:3.8-slim
RUN mkdir /app
WORKDIR /app
COPY requirements.txt /app
RUN apt-get update && apt-get install -y --no-install-recommends gcc build-essential postgresql libpq-dev vim
RUN apt-get install -y --no-install-recommends libssl-dev libffi-dev
RUN pip install --no-cache-dir -r requirements.txt
COPY . /app
WORKDIR /app/api
EXPOSE 3000
CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "3000", "--reload"]
ATTENTION!!! As pycrypto is not maintained anymore, please switch to pycryptodome.
That’s how I did it. Extract from my README.md:
Installing on Windows
Install Python
Checked with Python 3.7 x64 on Windows 10 x64 Version 1803.
Get it from the Python homepage
Install launcher for all users
Add Python to PATH
Adds %ProgramFiles%Python37 + Scripts to PATHUse Customize Installation (!!! necessary for advanced options !!!)
Advanced Options
- Install for all users
Install Visual C++ Build Tools
Checked with Visual Studio 2017.
Get the Build Tools from the Visual Studio download page (link as of 2018-11)
Install Visual C++ Build Tools with additional standard components
- Windows 10 SDK
- Visual C++ Tools for CMake
- Core Tools for Testing
Install necessary Python modules
- Start an elevated(!!!) VS Developer Command Prompt (Run As Admin via Right Click)
- Update PIP first:
python -m pip install --upgrade pip
- Install pycrypto module
pycrypto has to compile some code due to legal restrictions on cryptography, so this is why the VC++ Build Tools had to be installed and the VS Developer Command Prompt had to be started.
There’s a small issue with the pycrypto source, so as a workaround we have to include the correct header by setting the environment variable CL.
set CL=-FI"%VCToolsInstallDir%includestdint.h"
pip install pycrypto
- Exit VS Developer Command Prompt:
exit
The Visual C++ Build Tools may be deinstalled now, but it’s recommended to keep them installed to be able to upgrade pycrypto when necessary.
To install other modules just a normal but elevated(!!!) Command Prompt is needed (Run As Admin via Right Click).
first of all, you’re a wizard. So jot that down. I’ve been fighting this problem for three days. I know what it is now, when you click «install for all users» there’s an aditional dep that’s added along with it (you check one box, so python installs the other. I think it’s pre-compile some setup.py thing) anyways. You’re the real MVP. If you have problems with your wife/husband, boss, anyone, just let em know you’re legit a god. reference me if necessary. Thanks man. You’ve helped my project out in a huge way.
I’m using Python 3.7 and Windows 10. ‘pip install pycrypto‘ doesn’t work with the following error:
(pyramid) C:ProjectsPyramid>pip install pycrypto Collecting pycrypto Downloading https://files.pythonhosted.org/packages/60/db/645aa9af249f059cc3a368b118de33889219e0362141e75d4eaf6f80f163/pycrypto-2.6.1.tar.gz (446kB) 100% |████████████████████████████████| 450kB 5.7MB/s Installing collected packages: pycrypto Running setup.py install for pycrypto ... error ... ... purposely truncated ... C:Program Files (x86)Windows Kits10include10.0.10240.0ucrtinttypes.h(26): error C2061: syntax error: identifier 'intmax_t' C:Program Files (x86)Windows Kits10include10.0.10240.0ucrtinttypes.h(27): error C2061: syntax error: identifier 'rem' C:Program Files (x86)Windows Kits10include10.0.10240.0ucrtinttypes.h(27): error C2059: syntax error: ';' C:Program Files (x86)Windows Kits10include10.0.10240.0ucrtinttypes.h(28): error C2059: syntax error: '}' C:Program Files (x86)Windows Kits10include10.0.10240.0ucrtinttypes.h(30): error C2061: syntax error: identifier 'imaxdiv_t' C:Program Files (x86)Windows Kits10include10.0.10240.0ucrtinttypes.h(30): error C2059: syntax error: ';' C:Program Files (x86)Windows Kits10include10.0.10240.0ucrtinttypes.h(40): error C2143: syntax error: missing '{' before '__cdecl' C:Program Files (x86)Windows Kits10include10.0.10240.0ucrtinttypes.h(41): error C2146: syntax error: missing ')' before identifier '_Number' C:Program Files (x86)Windows Kits10include10.0.10240.0ucrtinttypes.h(41): error C2061: syntax error: identifier '_Number' C:Program Files (x86)Windows Kits10include10.0.10240.0ucrtinttypes.h(41): error C2059: syntax error: ';' C:Program Files (x86)Windows Kits10include10.0.10240.0ucrtinttypes.h(42): error C2059: syntax error: ')' C:Program Files (x86)Windows Kits10include10.0.10240.0ucrtinttypes.h(45): error C2143: syntax error: missing '{' before '__cdecl' C:Program Files (x86)Windows Kits10include10.0.10240.0ucrtinttypes.h(46): error C2146: syntax error: missing ')' before identifier '_Numerator' C:Program Files (x86)Windows Kits10include10.0.10240.0ucrtinttypes.h(46): error C2061: syntax error: identifier '_Numerator' C:Program Files (x86)Windows Kits10include10.0.10240.0ucrtinttypes.h(46): error C2059: syntax error: ';' C:Program Files (x86)Windows Kits10include10.0.10240.0ucrtinttypes.h(46): error C2059: syntax error: ',' C:Program Files (x86)Windows Kits10include10.0.10240.0ucrtinttypes.h(48): error C2059: syntax error: ')' C:Program Files (x86)Windows Kits10include10.0.10240.0ucrtinttypes.h(50): error C2143: syntax error: missing '{' before '__cdecl' C:Program Files (x86)Windows Kits10include10.0.10240.0ucrtinttypes.h(56): error C2143: syntax error: missing '{' before '__cdecl' C:Program Files (x86)Windows Kits10include10.0.10240.0ucrtinttypes.h(63): error C2143: syntax error: missing '{' before '__cdecl' C:Program Files (x86)Windows Kits10include10.0.10240.0ucrtinttypes.h(69): error C2143: syntax error: missing '{' before '__cdecl' C:Program Files (x86)Windows Kits10include10.0.10240.0ucrtinttypes.h(76): error C2143: syntax error: missing '{' before '__cdecl' C:Program Files (x86)Windows Kits10include10.0.10240.0ucrtinttypes.h(82): error C2143: syntax error: missing '{' before '__cdecl' C:Program Files (x86)Windows Kits10include10.0.10240.0ucrtinttypes.h(89): error C2143: syntax error: missing '{' before '__cdecl' C:Program Files (x86)Windows Kits10include10.0.10240.0ucrtinttypes.h(95): error C2143: syntax error: missing '{' before '__cdecl' error: command 'C:Program Files (x86)Microsoft Visual Studio 14.0VCBINx86_amd64cl.exe' failed with exit status 2 ---------------------------------------- Command "c:pythonvenvpyramidscriptspython.exe -u -c "import setuptools, tokenize;__file__='C:UsersdariawanAppDataLocalTemppip-install-wwb9aboqpycryptosetup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:UsersdariawanAppDataLocalTemppip-record-x5wxv2qginstall-record.txt --single-version-externally-managed --compile --install-headers c:pythonvenvpyramidincludesitepython3.7pycrypto" failed with error code 1 in C:UsersdariawanAppDataLocalTemppip-install-wwb9aboqpycrypto
The file includepyport.h in Python installation directory does not have #include < stdint.h > anymore. This leaves intmax_t undefined.
A workaround for Microsoft VC compiler is to force include stdint.h via OS environment variable CL:
- Open command prompt, and Setup VC environment by runing vcvars*.bat (choose file name depending on VC version and architecture)
C:Program Files (x86)Microsoft Visual Studio 14.0VC>vcvarsall.bat
- set CL=-FI»Full-Pathstdint.h» (use real value for Full-Path for the environment)
C:Program Files (x86)Microsoft Visual Studio 14.0VC>set CL=-FI"%VCINSTALLDIR%INCLUDEstdint.h"
- then, try to install pycrypto again:
(pyramid) C:ProjectsPyramid>pip install pycrypto Collecting pycrypto Using cached https://files.pythonhosted.org/packages/60/db/645aa9af249f059cc3a368b118de33889219e0362141e75d4eaf6f80f163/pycrypto-2.6.1.tar.gz Installing collected packages: pycrypto Running setup.py install for pycrypto ... done Successfully installed pycrypto-2.6.1
Another option that I’ll try in future is to use PyCryptodome instead of pycrypto. pycrypto is discontinued and is no longer actively supported. PyCryptodome exposes almost the same API as pycrypto (source).
Reference: Microsoft Windows Python-3.6 PyCrypto installation error
Я пытаюсь установить PyCrypto 2.6 на моем компьютере. Но я продолжаю получать следующую ошибку:
D:SoftwarePythonpackagepycrypto-2.6>python setup.py build
running build
running build_py
running build_ext
warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.
building 'Crypto.Random.OSRNG.winrandom' extension
error: Unable to find vcvarsall.bat
Моя система
Windows 8 Pro 64-бит, Visual Studio Enterprise 2012 и Python 3.3
Чтобы исправить ошибку, я попытался установить переменную окружения VS90COMNTOOLS=%VS110COMNTOOLS%
, как рекомендовал fmuecke в ошибке сообщения: Не удалось найти vcvarsall.bat, но это не так, t для меня.
Может кто-нибудь, пожалуйста, сообщите мне, как исправить эту ошибку.
FYI, я не устанавливаю VC2008 и т.д.
09 дек. 2012, в 13:50
Поделиться
Источник
7 ответов
Мне удалось установить PyCrypto 2.6 с помощью предварительно созданного бинарного файла для Python3.3 из Модули Python Voidspace.
На самом деле он не исправляет error: Unable to find vcvarsall.bat
для другого пакета, у которого нет готовых исполняемых файлов.
Однако это устраняет необходимость создания пакета PyCrypto, позволяя мне установить PyCrypto в мою систему, не получая ошибку.
Khurram Majeed
09 дек. 2012, в 13:32
Поделиться
Я знаю, что это старый вопрос, но мне также нужно много времени, чтобы получить paramiko wokring.
Я хочу использовать Python 3.4 и в voidspace, нет предустановленных двоичных файлов для 3.4.
Наконец, я получил wokring pycrypto, установив «Microsoft Studio Express 2010 С++» и запустив из папки pycrypto 2.7:
python setup.py build --compiler msvc
python setup.py install
python setup.py bdist_wininst
Все «трюки» с переменными окружения не работают для меня.
Если это кому-то помогает, все спасибо:
http://flintux.wordpress.com/2014/04/30/pycrypto-for-python-3-4-on-windows-7-64bit/
user3842110
15 июль 2014, в 20:10
Поделиться
Вы можете установить mingw64, а затем запустить из каталога распакованных файлов PyCrypto:
python setup.py build —compiler = mingw32
user2382176
15 май 2013, в 15:08
Поделиться
если вы
VS 2010
SET VS90COMNTOOLS =% VS100COMNTOOLS%
VS 2012
SET VS90COMNTOOLS =% VS110COMNTOOLS%
VS 2013
SET VS90COMNTOOLS =% VS120COMNTOOLS%
а затем
Установка python setup.py
hhhhhh
20 июль 2017, в 01:30
Поделиться
Я использую Windows 10. Все, что мне нужно было сделать, это обновить мою систему с помощью Visual С++ Build Tools 2015, которую я нашел на этой странице: https://blogs.msdn.microsoft.com/pythonengineering/2016/04/11/unable-to-find-vcvarsall-bat/
О середине страницы вы увидите некоторые параметры загрузки — выберите свою версию python и загрузите правильный пакет
Затем я снова импортировал программу, которую я пытался установить, и НЕ БОЛЬШЕ ошибок! Woohoo!
Reed Miller
13 сен. 2016, в 19:59
Поделиться
Ещё вопросы
- 0else IndentationError: неожиданный отступ в PyCharm
- 1Как получить продолжительность потокового аудио с серверов онлайн
- 0JQuery переместить видео YouTube во время его воспроизведения
- 0Возобновление XMPP-соединения после обновления страницы
- 1Магазин Windows CurrentApp.LoadListingInformationAsync () — ошибка 0x801900cc
- 0Yii одна функция в контроллере, а CMenu от Zii
- 1Проверьте состояние БД Монго для Паспорта
- 0Привязка значения в функцию ожидания в JavaScript
- 1onClick внутри ListActivity с помощью SimpleCursorAdapter
- 0Как установить значение в конкретном байте?
- 0Передать параметр обещания вложенной директиве
- 1Подтверждение введенного пользователем времени в Google-Sheets
- 0AngularJS — Как использовать значение рецепта в качестве глобальной переменной?
- 1Python3: невозможно удалить элементы из списка; не может нарезать элементы списка
- 0.query () отображает неверный путь
- 1Ошибка веб-сайта фляги Python: запрошенный URL не найден на сервере
- 1Объективный эквивалент C байта в C #
- 1добавление в середину пустого ArrayList?
- 0Загрузка файла на сервер с помощью AngularJS и Java Servlet
- 0Лучший способ динамического расчета в зависимости от выбранных значений 2 списка выбора в jquery
- 0Loopback & Angular: Как установить значение по умолчанию в форме
- 1Можно ли перегрузить лямбда-выражения?
- 1Как рандомизировать данные в единство с помощью JavaScript
- 1JSP не компилируется в CQ5?
- 1Сравните два объекта и добавьте различия, не манипулируя существующими
- 0при вставке данных в базу данных MySQL с помощью Php. Я получаю сообщение об ошибке «Неверное целочисленное значение:» для столбца «ставка» в строке 1
- 0Как добавить дату создания поста в блоге вместо маркера под типом списка?
- 0Как отобразить детали в горизонтальном режиме?
- 0конвертировать URL изображения в base64
- 1d3 fitSize дает значения NaN
- 1Доступ к ViewModel из wpf dll
- 0Как мне вставить div и все его содержимое, используя ngAnimate?
- 0Структура мобильной страницы Jquery
- 0MySQL временная таблица в подзапросе
- 0значение флажка с условием if с помощью jquery
- 1преобразовать массив numpy из объекта dtype в float
- 1Фильтр столбца WinForms XtraGrid проверяет список фактических данных
- 0Компоновщик MSVS, добавляющий данные между статическими константными строками
- 0Что именно делают операции памяти malloc и free?
- 1Слушатель маркеров диспетчера чертежей Position_Changed
- 1Используйте функцию связывания дважды [дубликата]
- 1Инициализация члена класса в UserControl
- 1Null Coalescing для строки в Int
- 0Как отобразить данные множественного выбора массива в поле выбора в angularjs в остальные API
- 0MySQL сервер ушел на ОБНОВЛЕНИЕ (Огромный QUERY, около 85 МБ), используя mysli PHP
- 0MySQL: запись таблицы в CSV-файл
- 1Использование клиентских веб-сервисов сгенерированных JAXB классов в качестве объектов JPA
- 0C ++ глобальная функция против функции-члена данных в соответствии с памятью
- 0Как вставить данные в таблицу MySQL, используя sequeilze в express.js
- 0Javascript: Как изменить href для всех идентификаторов тегов <area>?
#python #pycrypto
Вопрос:
Не удается установить pycrypto. Windows 10, инструменты для сборки есть. P. S(pycryptodome не устанавливается, требуется версия python
ERROR: Command errored out with exit status 1: command: 'C:UsersPANDEMICAppDataLocalProgramsPythonPython310python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:UsersPANDEMICAppDataLocalTemppip-install-ef9g90_lpycrypto_696a777b084643c199004e3a284af80csetup.py'"'"'; __file__='"'"'C:UsersPANDEMICAppDataLocalTemppip-install-ef9g90_lpycrypto_696a777b084643c199004e3a284af80csetup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:UsersPANDEMICAppDataLocalTemppip-record-7_hzboysinstall-record.txt' --single-version-externally-managed --compile --install-headers 'C:UsersPANDEMICAppDataLocalProgramsPythonPython310Includepycrypto' cwd: C:UsersPANDEMICAppDataLocalTemppip-install-ef9g90_lpycrypto_696a777b084643c199004e3a284af80c Complete output (183 lines): running install running build running build_py creating build creating buildlib.win-amd64-3.10 creating buildlib.win-amd64-3.10Crypto copying libCryptopct_warnings.py -> buildlib.win-amd64-3.10Crypto copying libCrypto__init__.py -> buildlib.win-amd64-3.10Crypto creating buildlib.win-amd64-3.10CryptoHash copying libCryptoHashhashalgo.py -> buildlib.win-amd64-3.10CryptoHash copying libCryptoHashHMAC.py -> buildlib.win-amd64-3.10CryptoHash copying libCryptoHashMD2.py -> buildlib.win-amd64-3.10CryptoHash copying libCryptoHashMD4.py -> buildlib.win-amd64-3.10CryptoHash copying libCryptoHashMD5.py -> buildlib.win-amd64-3.10CryptoHash copying libCryptoHashRIPEMD.py -> buildlib.win-amd64-3.10CryptoHash copying libCryptoHashSHA.py -> buildlib.win-amd64-3.10CryptoHash copying libCryptoHashSHA224.py -> buildlib.win-amd64-3.10CryptoHash copying libCryptoHashSHA256.py -> buildlib.win-amd64-3.10CryptoHash copying libCryptoHashSHA384.py -> buildlib.win-amd64-3.10CryptoHash copying libCryptoHashSHA512.py -> buildlib.win-amd64-3.10CryptoHash copying libCryptoHash__init__.py -> buildlib.win-amd64-3.10CryptoHash creating buildlib.win-amd64-3.10CryptoCipher copying libCryptoCipherAES.py -> buildlib.win-amd64-3.10CryptoCipher copying libCryptoCipherARC2.py -> buildlib.win-amd64-3.10CryptoCipher copying libCryptoCipherARC4.py -> buildlib.win-amd64-3.10CryptoCipher copying libCryptoCipherblockalgo.py -> buildlib.win-amd64-3.10CryptoCipher copying libCryptoCipherBlowfish.py -> buildlib.win-amd64-3.10CryptoCipher copying libCryptoCipherCAST.py -> buildlib.win-amd64-3.10CryptoCipher copying libCryptoCipherDES.py -> buildlib.win-amd64-3.10CryptoCipher copying libCryptoCipherDES3.py -> buildlib.win-amd64-3.10CryptoCipher copying libCryptoCipherPKCS1_OAEP.py -> buildlib.win-amd64-3.10CryptoCipher copying libCryptoCipherPKCS1_v1_5.py -> buildlib.win-amd64-3.10CryptoCipher copying libCryptoCipherXOR.py -> buildlib.win-amd64-3.10CryptoCipher copying libCryptoCipher__init__.py -> buildlib.win-amd64-3.10CryptoCipher creating buildlib.win-amd64-3.10CryptoUtil copying libCryptoUtilasn1.py -> buildlib.win-amd64-3.10CryptoUtil copying libCryptoUtilCounter.py -> buildlib.win-amd64-3.10CryptoUtil copying libCryptoUtilnumber.py -> buildlib.win-amd64-3.10CryptoUtil copying libCryptoUtilpy3compat.py -> buildlib.win-amd64-3.10CryptoUtil copying libCryptoUtilrandpool.py -> buildlib.win-amd64-3.10CryptoUtil copying libCryptoUtilRFC1751.py -> buildlib.win-amd64-3.10CryptoUtil copying libCryptoUtilwinrandom.py -> buildlib.win-amd64-3.10CryptoUtil copying libCryptoUtil_number_new.py -> buildlib.win-amd64-3.10CryptoUtil copying libCryptoUtil__init__.py -> buildlib.win-amd64-3.10CryptoUtil creating buildlib.win-amd64-3.10CryptoRandom copying libCryptoRandomrandom.py -> buildlib.win-amd64-3.10CryptoRandom copying libCryptoRandom_UserFriendlyRNG.py -> buildlib.win-amd64-3.10CryptoRandom copying libCryptoRandom__init__.py -> buildlib.win-amd64-3.10CryptoRandom creating buildlib.win-amd64-3.10CryptoRandomFortuna copying libCryptoRandomFortunaFortunaAccumulator.py -> buildlib.win-amd64-3.10CryptoRandomFortuna copying libCryptoRandomFortunaFortunaGenerator.py -> buildlib.win-amd64-3.10CryptoRandomFortuna copying libCryptoRandomFortunaSHAd256.py -> buildlib.win-amd64-3.10CryptoRandomFortuna copying libCryptoRandomFortuna__init__.py -> buildlib.win-amd64-3.10CryptoRandomFortuna creating buildlib.win-amd64-3.10CryptoRandomOSRNG copying libCryptoRandomOSRNGfallback.py -> buildlib.win-amd64-3.10CryptoRandomOSRNG copying libCryptoRandomOSRNGnt.py -> buildlib.win-amd64-3.10CryptoRandomOSRNG copying libCryptoRandomOSRNGposix.py -> buildlib.win-amd64-3.10CryptoRandomOSRNG copying libCryptoRandomOSRNGrng_base.py -> buildlib.win-amd64-3.10CryptoRandomOSRNG copying libCryptoRandomOSRNG__init__.py -> buildlib.win-amd64-3.10CryptoRandomOSRNG creating buildlib.win-amd64-3.10CryptoSelfTest copying libCryptoSelfTestst_common.py -> buildlib.win-amd64-3.10CryptoSelfTest copying libCryptoSelfTest__init__.py -> buildlib.win-amd64-3.10CryptoSelfTest creating buildlib.win-amd64-3.10CryptoSelfTestCipher copying libCryptoSelfTestCiphercommon.py -> buildlib.win-amd64-3.10CryptoSelfTestCipher copying libCryptoSelfTestCiphertest_AES.py -> buildlib.win-amd64-3.10CryptoSelfTestCipher copying libCryptoSelfTestCiphertest_ARC2.py -> buildlib.win-amd64-3.10CryptoSelfTestCipher copying libCryptoSelfTestCiphertest_ARC4.py -> buildlib.win-amd64-3.10CryptoSelfTestCipher copying libCryptoSelfTestCiphertest_Blowfish.py -> buildlib.win-amd64-3.10CryptoSelfTestCipher copying libCryptoSelfTestCiphertest_CAST.py -> buildlib.win-amd64-3.10CryptoSelfTestCipher copying libCryptoSelfTestCiphertest_DES.py -> buildlib.win-amd64-3.10CryptoSelfTestCipher copying libCryptoSelfTestCiphertest_DES3.py -> buildlib.win-amd64-3.10CryptoSelfTestCipher copying libCryptoSelfTestCiphertest_pkcs1_15.py -> buildlib.win-amd64-3.10CryptoSelfTestCipher copying libCryptoSelfTestCiphertest_pkcs1_oaep.py -> buildlib.win-amd64-3.10CryptoSelfTestCipher copying libCryptoSelfTestCiphertest_XOR.py -> buildlib.win-amd64-3.10CryptoSelfTestCipher copying libCryptoSelfTestCipher__init__.py -> buildlib.win-amd64-3.10CryptoSelfTestCipher creating buildlib.win-amd64-3.10CryptoSelfTestHash copying libCryptoSelfTestHashcommon.py -> buildlib.win-amd64-3.10CryptoSelfTestHash copying libCryptoSelfTestHashtest_HMAC.py -> buildlib.win-amd64-3.10CryptoSelfTestHash copying libCryptoSelfTestHashtest_MD2.py -> buildlib.win-amd64-3.10CryptoSelfTestHash copying libCryptoSelfTestHashtest_MD4.py -> buildlib.win-amd64-3.10CryptoSelfTestHash copying libCryptoSelfTestHashtest_MD5.py -> buildlib.win-amd64-3.10CryptoSelfTestHash copying libCryptoSelfTestHashtest_RIPEMD.py -> buildlib.win-amd64-3.10CryptoSelfTestHash copying libCryptoSelfTestHashtest_SHA.py -> buildlib.win-amd64-3.10CryptoSelfTestHash copying libCryptoSelfTestHashtest_SHA224.py -> buildlib.win-amd64-3.10CryptoSelfTestHash copying libCryptoSelfTestHashtest_SHA256.py -> buildlib.win-amd64-3.10CryptoSelfTestHash copying libCryptoSelfTestHashtest_SHA384.py -> buildlib.win-amd64-3.10CryptoSelfTestHash copying libCryptoSelfTestHashtest_SHA512.py -> buildlib.win-amd64-3.10CryptoSelfTestHash copying libCryptoSelfTestHash__init__.py -> buildlib.win-amd64-3.10CryptoSelfTestHash creating buildlib.win-amd64-3.10CryptoSelfTestProtocol copying libCryptoSelfTestProtocoltest_AllOrNothing.py -> buildlib.win-amd64-3.10CryptoSelfTestProtocol copying libCryptoSelfTestProtocoltest_chaffing.py -> buildlib.win-amd64-3.10CryptoSelfTestProtocol copying libCryptoSelfTestProtocoltest_KDF.py -> buildlib.win-amd64-3.10CryptoSelfTestProtocol copying libCryptoSelfTestProtocoltest_rfc1751.py -> buildlib.win-amd64-3.10CryptoSelfTestProtocol copying libCryptoSelfTestProtocol__init__.py -> buildlib.win-amd64-3.10CryptoSelfTestProtocol creating buildlib.win-amd64-3.10CryptoSelfTestPublicKey copying libCryptoSelfTestPublicKeytest_DSA.py -> buildlib.win-amd64-3.10CryptoSelfTestPublicKey copying libCryptoSelfTestPublicKeytest_ElGamal.py -> buildlib.win-amd64-3.10CryptoSelfTestPublicKey copying libCryptoSelfTestPublicKeytest_importKey.py -> buildlib.win-amd64-3.10CryptoSelfTestPublicKey copying libCryptoSelfTestPublicKeytest_RSA.py -> buildlib.win-amd64-3.10CryptoSelfTestPublicKey copying libCryptoSelfTestPublicKey__init__.py -> buildlib.win-amd64-3.10CryptoSelfTestPublicKey creating buildlib.win-amd64-3.10CryptoSelfTestRandom copying libCryptoSelfTestRandomtest_random.py -> buildlib.win-amd64-3.10CryptoSelfTestRandom copying libCryptoSelfTestRandomtest_rpoolcompat.py -> buildlib.win-amd64-3.10CryptoSelfTestRandom copying libCryptoSelfTestRandomtest__UserFriendlyRNG.py -> buildlib.win-amd64-3.10CryptoSelfTestRandom copying libCryptoSelfTestRandom__init__.py -> buildlib.win-amd64-3.10CryptoSelfTestRandom creating buildlib.win-amd64-3.10CryptoSelfTestRandomFortuna copying libCryptoSelfTestRandomFortunatest_FortunaAccumulator.py -> buildlib.win-amd64-3.10CryptoSelfTestRandomFortuna copying libCryptoSelfTestRandomFortunatest_FortunaGenerator.py -> buildlib.win-amd64-3.10CryptoSelfTestRandomFortuna copying libCryptoSelfTestRandomFortunatest_SHAd256.py -> buildlib.win-amd64-3.10CryptoSelfTestRandomFortuna copying libCryptoSelfTestRandomFortuna__init__.py -> buildlib.win-amd64-3.10CryptoSelfTestRandomFortuna creating buildlib.win-amd64-3.10CryptoSelfTestRandomOSRNG copying libCryptoSelfTestRandomOSRNGtest_fallback.py -> buildlib.win-amd64-3.10CryptoSelfTestRandomOSRNG copying libCryptoSelfTestRandomOSRNGtest_generic.py -> buildlib.win-amd64-3.10CryptoSelfTestRandomOSRNG copying libCryptoSelfTestRandomOSRNGtest_nt.py -> buildlib.win-amd64-3.10CryptoSelfTestRandomOSRNG copying libCryptoSelfTestRandomOSRNGtest_posix.py -> buildlib.win-amd64-3.10CryptoSelfTestRandomOSRNG copying libCryptoSelfTestRandomOSRNGtest_winrandom.py -> buildlib.win-amd64-3.10CryptoSelfTestRandomOSRNG copying libCryptoSelfTestRandomOSRNG__init__.py -> buildlib.win-amd64-3.10CryptoSelfTestRandomOSRNG creating buildlib.win-amd64-3.10CryptoSelfTestUtil copying libCryptoSelfTestUtiltest_asn1.py -> buildlib.win-amd64-3.10CryptoSelfTestUtil copying libCryptoSelfTestUtiltest_Counter.py -> buildlib.win-amd64-3.10CryptoSelfTestUtil copying libCryptoSelfTestUtiltest_number.py -> buildlib.win-amd64-3.10CryptoSelfTestUtil copying libCryptoSelfTestUtiltest_winrandom.py -> buildlib.win-amd64-3.10CryptoSelfTestUtil copying libCryptoSelfTestUtil__init__.py -> buildlib.win-amd64-3.10CryptoSelfTestUtil creating buildlib.win-amd64-3.10CryptoSelfTestSignature copying libCryptoSelfTestSignaturetest_pkcs1_15.py -> buildlib.win-amd64-3.10CryptoSelfTestSignature copying libCryptoSelfTestSignaturetest_pkcs1_pss.py -> buildlib.win-amd64-3.10CryptoSelfTestSignature copying libCryptoSelfTestSignature__init__.py -> buildlib.win-amd64-3.10CryptoSelfTestSignature creating buildlib.win-amd64-3.10CryptoProtocol copying libCryptoProtocolAllOrNothing.py -> buildlib.win-amd64-3.10CryptoProtocol copying libCryptoProtocolChaffing.py -> buildlib.win-amd64-3.10CryptoProtocol copying libCryptoProtocolKDF.py -> buildlib.win-amd64-3.10CryptoProtocol copying libCryptoProtocol__init__.py -> buildlib.win-amd64-3.10CryptoProtocol creating buildlib.win-amd64-3.10CryptoPublicKey copying libCryptoPublicKeyDSA.py -> buildlib.win-amd64-3.10CryptoPublicKey copying libCryptoPublicKeyElGamal.py -> buildlib.win-amd64-3.10CryptoPublicKey copying libCryptoPublicKeypubkey.py -> buildlib.win-amd64-3.10CryptoPublicKey copying libCryptoPublicKeyRSA.py -> buildlib.win-amd64-3.10CryptoPublicKey copying libCryptoPublicKey_DSA.py -> buildlib.win-amd64-3.10CryptoPublicKey copying libCryptoPublicKey_RSA.py -> buildlib.win-amd64-3.10CryptoPublicKey copying libCryptoPublicKey_slowmath.py -> buildlib.win-amd64-3.10CryptoPublicKey copying libCryptoPublicKey__init__.py -> buildlib.win-amd64-3.10CryptoPublicKey creating buildlib.win-amd64-3.10CryptoSignature copying libCryptoSignaturePKCS1_PSS.py -> buildlib.win-amd64-3.10CryptoSignature copying libCryptoSignaturePKCS1_v1_5.py -> buildlib.win-amd64-3.10CryptoSignature copying libCryptoSignature__init__.py -> buildlib.win-amd64-3.10CryptoSignature Skipping optional fixer: buffer Skipping optional fixer: idioms Skipping optional fixer: set_literal Skipping optional fixer: ws_comma running build_ext warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath. building 'Crypto.Random.OSRNG.winrandom' extension creating buildtemp.win-amd64-3.10 creating buildtemp.win-amd64-3.10Release creating buildtemp.win-amd64-3.10Releasesrc C:Program Files (x86)Microsoft Visual Studio2019BuildToolsVCToolsMSVC14.29.30133binHostX86x64cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Isrc/ -Isrc/inc-msvc/ -IC:UsersPANDEMICAppDataLocalProgramsPythonPython310include -IC:UsersPANDEMICAppDataLocalProgramsPythonPython310Include -IC:Program Files (x86)Microsoft Visual Studio2019BuildToolsVCToolsMSVC14.29.30133include -IC:Program Files (x86)Windows KitsNETFXSDK4.8includeum -IC:Program Files (x86)Windows Kits10include10.0.19041.0ucrt -IC:Program Files (x86)Windows Kits10include10.0.19041.0shared -IC:Program Files (x86)Windows Kits10include10.0.19041.0um -IC:Program Files (x86)Windows Kits10include10.0.19041.0winrt -IC:Program Files (x86)Windows Kits10include10.0.19041.0cppwinrt /Tcsrc/winrand.c /Fobuildtemp.win-amd64-3.10Releasesrc/winrand.obj winrand.c C:Program Files (x86)Windows Kits10include10.0.19041.0ucrtinttypes.h(31): error C2061: бЁв ЄбЁзҐбЄ п ®иЁЎЄ : Ё¤ҐвЁдЁЄ в®а "intmax_t" C:Program Files (x86)Windows Kits10include10.0.19041.0ucrtinttypes.h(32): error C2061: бЁв ЄбЁзҐбЄ п ®иЁЎЄ : Ё¤ҐвЁдЁЄ в®а "rem" C:Program Files (x86)Windows Kits10include10.0.19041.0ucrtinttypes.h(32): error C2059: бЁв ЄбЁзҐбЄ п ®иЁЎЄ : ; C:Program Files (x86)Windows Kits10include10.0.19041.0ucrtinttypes.h(33): error C2059: бЁв ЄбЁзҐбЄ п ®иЁЎЄ : } C:Program Files (x86)Windows Kits10include10.0.19041.0ucrtinttypes.h(35): error C2061: бЁв ЄбЁзҐбЄ п ®иЁЎЄ : Ё¤ҐвЁдЁЄ в®а "imaxdiv_t" C:Program Files (x86)Windows Kits10include10.0.19041.0ucrtinttypes.h(35): error C2059: бЁв ЄбЁзҐбЄ п ®иЁЎЄ : ; C:Program Files (x86)Windows Kits10include10.0.19041.0ucrtinttypes.h(45): error C2143: бЁв ЄбЁзҐбЄ п ®иЁЎЄ : ®вбгвбвўЁҐ "{" ЇҐаҐ¤ "__cdecl" C:Program Files (x86)Windows Kits10include10.0.19041.0ucrtinttypes.h(46): error C2146: бЁв ЄбЁзҐбЄ п ®иЁЎЄ : ®вбгвбвўЁҐ ")" ЇҐаҐ¤ Ё¤ҐвЁдЁЄ в®а®¬ "_Number" C:Program Files (x86)Windows Kits10include10.0.19041.0ucrtinttypes.h(46): error C2061: бЁв ЄбЁзҐбЄ п ®иЁЎЄ : Ё¤ҐвЁдЁЄ в®а "_Number" C:Program Files (x86)Windows Kits10include10.0.19041.0ucrtinttypes.h(46): error C2059: бЁв ЄбЁзҐбЄ п ®иЁЎЄ : ; C:Program Files (x86)Windows Kits10include10.0.19041.0ucrtinttypes.h(47): error C2059: бЁв ЄбЁзҐбЄ п ®иЁЎЄ : ) C:Program Files (x86)Windows Kits10include10.0.19041.0ucrtinttypes.h(50): error C2143: бЁв ЄбЁзҐбЄ п ®иЁЎЄ : ®вбгвбвўЁҐ "{" ЇҐаҐ¤ "__cdecl" C:Program Files (x86)Windows Kits10include10.0.19041.0ucrtinttypes.h(51): error C2146: бЁв ЄбЁзҐбЄ п ®иЁЎЄ : ®вбгвбвўЁҐ ")" ЇҐаҐ¤ Ё¤ҐвЁдЁЄ в®а®¬ "_Numerator" C:Program Files (x86)Windows Kits10include10.0.19041.0ucrtinttypes.h(51): error C2061: бЁв ЄбЁзҐбЄ п ®иЁЎЄ : Ё¤ҐвЁдЁЄ в®а "_Numerator" C:Program Files (x86)Windows Kits10include10.0.19041.0ucrtinttypes.h(51): error C2059: бЁв ЄбЁзҐбЄ п ®иЁЎЄ : ; C:Program Files (x86)Windows Kits10include10.0.19041.0ucrtinttypes.h(51): error C2059: бЁв ЄбЁзҐбЄ п ®иЁЎЄ : , C:Program Files (x86)Windows Kits10include10.0.19041.0ucrtinttypes.h(53): error C2059: бЁв ЄбЁзҐбЄ п ®иЁЎЄ : ) C:Program Files (x86)Windows Kits10include10.0.19041.0ucrtinttypes.h(55): error C2143: бЁв ЄбЁзҐбЄ п ®иЁЎЄ : ®вбгвбвўЁҐ "{" ЇҐаҐ¤ "__cdecl" C:Program Files (x86)Windows Kits10include10.0.19041.0ucrtinttypes.h(61): error C2143: бЁв ЄбЁзҐбЄ п ®иЁЎЄ : ®вбгвбвўЁҐ "{" ЇҐаҐ¤ "__cdecl" C:Program Files (x86)Windows Kits10include10.0.19041.0ucrtinttypes.h(68): error C2143: бЁв ЄбЁзҐбЄ п ®иЁЎЄ : ®вбгвбвўЁҐ "{" ЇҐаҐ¤ "__cdecl" C:Program Files (x86)Windows Kits10include10.0.19041.0ucrtinttypes.h(74): error C2143: бЁв ЄбЁзҐбЄ п ®иЁЎЄ : ®вбгвбвўЁҐ "{" ЇҐаҐ¤ "__cdecl" C:Program Files (x86)Windows Kits10include10.0.19041.0ucrtinttypes.h(81): error C2143: бЁв ЄбЁзҐбЄ п ®иЁЎЄ : ®вбгвбвўЁҐ "{" ЇҐаҐ¤ "__cdecl" C:Program Files (x86)Windows Kits10include10.0.19041.0ucrtinttypes.h(87): error C2143: бЁв ЄбЁзҐбЄ п ®иЁЎЄ : ®вбгвбвўЁҐ "{" ЇҐаҐ¤ "__cdecl" C:Program Files (x86)Windows Kits10include10.0.19041.0ucrtinttypes.h(94): error C2143: бЁв ЄбЁзҐбЄ п ®иЁЎЄ : ®вбгвбвўЁҐ "{" ЇҐаҐ¤ "__cdecl" C:Program Files (x86)Windows Kits10include10.0.19041.0ucrtinttypes.h(100): error C2143: бЁв ЄбЁзҐбЄ п ®иЁЎЄ : ®вбгвбвўЁҐ "{" ЇҐаҐ¤ "__cdecl" error: command 'C:Program Files (x86)Microsoft Visual Studio2019BuildToolsVCToolsMSVC14.29.30133binHostX86x64cl.exe' failed with exit code 2 ---------------------------------------- ERROR: Command errored out with exit status 1: 'C:UsersPANDEMICAppDataLocalProgramsPythonPython310python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:UsersPANDEMICAppDataLocalTemppip-install-ef9g90_lpycrypto_696a777b084643c199004e3a284af80csetup.py'"'"'; __file__='"'"'C:UsersPANDEMICAppDataLocalTemppip-install-ef9g90_lpycrypto_696a777b084643c199004e3a284af80csetup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:UsersPANDEMICAppDataLocalTemppip-record-7_hzboysinstall-record.txt' --single-version-externally-managed --compile --install-headers 'C:UsersPANDEMICAppDataLocalProgramsPythonPython310Includepycrypto' Check the logs for full command output.
Похоже, что ваш пост в основном состоит из кода; пожалуйста, добавьте еще несколько деталей.Похоже, что ваш пост в основном состоит из кода; пожалуйста, добавьте еще несколько деталей.Похоже, что ваш пост в основном состоит из кода; пожалуйста, добавьте еще несколько деталей.Похоже, что ваш пост в основном состоит из кода; пожалуйста, добавьте еще несколько деталей.Похоже, что ваш пост в основном состоит из кода; пожалуйста, добавьте еще несколько деталей.
Комментарии:
1. Вы действительно ожидаете
pycrypto
, что с последней датой выпуска 17 октября 2013 года будет работать с python 3.10, выпущенным 4 октября 2021 года? Используйте pycryptodome (дата последнего релиза 8 октября 2021 года).2.
pycrypto
не удается установить на Python 3.10 из-за возраста. Файлы заголовков C не будут компилироваться.pycryptodome
устанавливается просто отлично для меня на Python 3.10. Ваше заявлениеpycryptodome
не устанавливается, требуемая версия python < 3.5 не соответствует моему тесту и не согласуется с документацией, в которой говорится, что поддерживает Python 2.7, Python 3.5 и более поздние версии, а также PyPy .
Ответ №1:
Я бы поставил на то, что чего-то не хватает, или эта версия Pycrypto просто не работает на вашем Python 3.10 в 64-разрядной Windows. (Pycrypto не обновлялся с 2013 года. Вы, вероятно, не захотите его использовать.)
Вы могли бы сделать все , что хотите cryptography
, то pip install cryptography
есть ? Для этого, похоже, есть предварительно скомпилированные колеса для Windows.
Есть также вилка pycryptodome
, pycryptodomex
, которая может помочь.
Я пытался использовать различные решения, предложенные для этой проблемы, но, похоже, ни одно из них не работает для меня
Я пытаюсь установить pycrypto с помощью pip install на моем Mac, который я недавно обновил до 10.11 вместе с последним Xcode, как предложили немногие.
Но я все еще получаю clang: error: linker command failed with exit code 1 (use -v to see invocation) error: command 'clang' failed with exit status 1
Вот также полный журнал ошибок, который я получаю в терминале, любая помощь с благодарностью
Failed to build pycrypto Installing collected packages: pycrypto Running setup.py install for pycrypto Complete output from command /Users/flexmaster411/openchain/venv/bin/python2.7 -c "import setuptools, tokenize;__file__='/private/var/folders/y4/kk3kmh9d47v8lk3lnd2k2vhr0000gn/T/pip-build-zTYGCp/pycrypto/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('rn', 'n'), __file__, 'exec'))" install --record /var/folders/y4/kk3kmh9d47v8lk3lnd2k2vhr0000gn/T/pip-mXfxhl-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/flexmaster411/openchain/venv/bin/../include/site/python2.7/pycrypto: running install running build running build_py running build_ext running build_configure building 'Crypto.PublicKey._fastmath' extension clang -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -fwrapv -Wall -Wstrict-prototypes -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/ -I/usr/local/Cellar/python/2.7.8_2/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/_fastmath.c -o build/temp.macosx-10.9-x86_64-2.7/src/_fastmath.o src/_fastmath.c:1545:20: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare] else if (result < 0) ~~~~~~ ^ ~ src/_fastmath.c:1621:20: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare] else if (result < 0) ~~~~~~ ^ ~ 2 warnings generated. clang -bundle -undefined dynamic_lookup -L/usr/local/lib -L/usr/local/opt/sqlite/lib build/temp.macosx-10.9-x86_64-2.7/src/_fastmath.o -lgmp -o build/lib.macosx-10.9-x86_64-2.7/Crypto/PublicKey/_fastmath.so ld: illegal text-relocation to '___gmp_binvert_limb_table' in /usr/local/lib/libgmp.a(mp_minv_tab.o) from '___gmpn_divexact_1' in /usr/local/lib/libgmp.a(dive_1.o) for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) error: command 'clang' failed with exit status 1
1
Решение
Другие решения
Других решений пока нет …
4 / 4 / 2 Регистрация: 07.05.2014 Сообщений: 489 |
|
1 |
|
08.03.2017, 00:26. Показов 6530. Ответов 2
Устанавливаю библиотек pycrypto, но выдал такую ошибку. Прочитал, что бы решить эту проблему нужно установить visual studio, но все равно выдает такую ошибку. Кто сталкивался с данной проблемой, и как ее можно решить. Спасибо Миниатюры
__________________ 0 |
5403 / 3827 / 1214 Регистрация: 28.10.2013 Сообщений: 9,554 Записей в блоге: 1 |
|
08.03.2017, 03:06 |
2 |
Три минуты гуглинга на тему как установить pycrypto для windows и python 3.5: Код pip install --use-wheel --no-index --find-links=https://github.com/sfbahr/PyCrypto-Wheels/raw/master/pycrypto-2.6.1-cp35-none-win32.whl pycrypto Код pip install --use-wheel --no-index --find-links=https://github.com/sfbahr/PyCrypto-Wheels/raw/master/pycrypto-2.6.1-cp35-none-win_amd64.whl pycrypto 0 |
4 / 4 / 2 Регистрация: 07.05.2014 Сообщений: 489 |
|
08.03.2017, 04:18 [ТС] |
3 |
Спасибо, я через первую команду устанавливал, но не получалось. Сейчас все заработало. 0 |