-2

I am trying to install all the dependency for a script. Here But it is producing this error:

Building wheels for collected packages: pycrypto
  Building wheel for pycrypto (setup.py): started
  Building wheel for pycrypto (setup.py): finished with status 'error'
  Running setup.py clean for pycrypto
Failed to build pycrypto
Note: you may need to restart the kernel to use updated packages.
  error: subprocess-exited-with-error
  
  python setup.py bdist_wheel 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
ERROR: Could not build wheels for pycrypto, which is required to install pyproject.toml-based projects

I tried to install pycrypto with pip install pycrypto==2.6.1` which is producing the same error.

Defaulting to user installation because normal site-packages is not writeable
Collecting pycrypto==2.6.1
  Using cached pycrypto-2.6.1.tar.gz (446 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Building wheels for collected packages: pycrypto
  Building wheel for pycrypto (setup.py): started
  Building wheel for pycrypto (setup.py): finished with status 'error'
  Running setup.py clean for pycrypto
Failed to build pycrypto
Note: you may need to restart the kernel to use updated packages.
  error: subprocess-exited-with-error
  
  python setup.py bdist_wheel 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
ERROR: Could not build wheels for pycrypto, which is required to install pyproject.toml-based projects 

Could you please advise how can i install this package as this is one of the dependency for the script which I am trying to run.

Slartibartfast
  • 1,058
  • 4
  • 26
  • 60
  • "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/". Did you? – 9769953 Aug 16 '23 at 13:57
  • 1
    Did you know that pycrypto's last release is from October 2013? And that, according to the classifiers in smartapi-python, the most recent Python version support by smartapi-python is 3.7? That may explain your current problems: your system / Python version is too new. (That, and the fact that pycrypto has no binary wheels available; probably because it's so old.) – 9769953 Aug 16 '23 at 14:02
  • @9769953 yes that could be a problem I am using python 3.11. I will create a new python environment and try again – Slartibartfast Aug 16 '23 at 14:08

0 Answers0