-1

I get the following error when trying to install pycrypto with pip install pycrypto. I've passed the last 8 hours trying to fix it. If anyone has a way to install pycrypto without going through pip that would be nice. Currently when I run my Python script i get the : Crypto: Module not found error.

I have Build Tools installed as such: enter image description here

error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> pycrypto

enter image description here

I read that pycryptodome replaces pycrypto but even after installing, I get Module not found: Crypto.

Any help is appreciated.

I tried pip install pycrypto and I expected it to install it but it failed.

wnetMC
  • 175
  • 8

1 Answers1

1

According to the pycrypto website new projects should use the cryptography package (ref).

If you're working on an existing project, I would suggest, if possible, running it in Docker, otherwise switching to Linux. That aside, I would check out Poetry as a replacement for pip.

Otherwise, it looks like the way to go is installing pycryptodome from from source. Not sure how you tried installing it, though, so apologies if you already tried that...if so, did it error out? If it did not, could you post output of pip3 freeze from shell and VSCode?

tehCheat
  • 333
  • 2
  • 8
  • pip3 freeze ez-setup==0.9 pycryptodome==3.16.0 pyreadline==2.1 python-dateutil==1.5 pywin32==303 requests==2.11.1 – wnetMC Dec 23 '22 at 01:00
  • Is that from shell or VSCode? Want to rule out PATH problems. – tehCheat Dec 23 '22 at 01:03
  • That's from cmd – wnetMC Dec 23 '22 at 01:05
  • I read that I should use easy_install but when i run easy_install I get the following error: failed to create process. – wnetMC Dec 23 '22 at 01:15
  • What is the output of `pip3 freeze` from VSCode? Again, I would strongly recommend using Docker or Linux if you can. – tehCheat Dec 23 '22 at 13:46
  • Sorry, you will need to provide a bit more information, step by step. Where did you read about using `easy_install`? I do not see it in the `pycryptodome` documentation. How are you running your python script? Are you able to at least try Docker? – tehCheat Dec 23 '22 at 13:54