0

I've pip installed the ones that i need as I viewed the documentation and other websites. How come it still says that my module is not found?

Here are my imports

import socket
import random
import hashlib

from Crypto.Cipher import ARC4

#from Crypto.Cipher import AES

#from Crypto.Hash import SHA256, HMAC
#from Crypto.Random import get_random_bytes

here is my pip list on vs code. My terminal also already has all of these

Package                   Version
------------------------- ---------
certifi                   2023.7.22
cffi                      1.15.1
charset-normalizer        3.2.0
crypto                    1.4.1
cryptography              41.0.3
idna                      3.4
Naked                     0.1.32
pip                       23.2.1
pycparser                 2.21
pycryptodome              3.18.0
pycryptodome-test-vectors 1.0.12
pycryptodomex             3.18.0
PyYAML                    6.0.1
requests                  2.31.0
setuptools                68.0.0
shellescape               3.8.1
urllib3                   2.0.4

this is the error reflected in the vscode terminal

 File "/Users/bbbb/Downloads/alice.py", line 5, in <module>
    from Crypto.Cipher import ARC4
ModuleNotFoundError: No module named 'Crypto'

I tried pip installing everything i needed from seeing other stack overflow questions. I've restarted my vscode many times too. nothing seemed to work

starball
  • 20,030
  • 7
  • 43
  • 238
  • I don't know what happens if you have *both* `pycryptodome` and `pycryptodomex` installed, but try using the `Cryptodome` module instead, e.g. `from Cryptodome.Cipher import ARC4` – President James K. Polk Aug 03 '23 at 00:25
  • @PresidentJamesK.Polk-Strike it says this. Import "Cryptodome.Cipher" could not be resolved Pylance :( – Xena BlueIce Aug 03 '23 at 00:29

1 Answers1

0

Omg guys. if yall have this problem. I resolved it by playing around in my environment.

Simply press command+shift+p. Select python:select interpreter. select the global one. if it doesnt work, try the others one by one!

Mine finally worked... after 2 days... yays!

  • You should accept the answer by clicking on tick icon ✅ which is at left of the answer, so that community can understand that the question has been answered. – JialeDu Aug 04 '23 at 05:37
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Aug 06 '23 at 15:00