simple-crypt icon indicating copy to clipboard operation
simple-crypt copied to clipboard

Multiple exception types must be parenthesized error

Open ghost opened this issue 1 year ago • 3 comments

When I run import simplecrypt in my python file. It encounters an error saying:

File "/home/codespace/.python/current/lib/python3.10/site-packages/simplecrypt/__init__.py", line 5, in <module>
    from Crypto.Random.random import getrandbits
File "/home/codespace/.python/current/lib/python3.10/site-packages/Crypto/Random/__init__.py", line 28, in <module>
    from Crypto.Random import OSRNG
File "/home/codespace/.python/current/lib/python3.10/site-packages/Crypto/Random/OSRNG/__init__.py", line 32, in <module>
    from Crypto.Random.OSRNG.posix import new
File "/home/codespace/.python/current/lib/python3.10/site-packages/Crypto/Random/OSRNG/posix.py", line 66
    except IOError, e:
           ^^^^^^^^^^
SyntaxError: multiple exception types must be parenthesized

Any help would be appreciated 👍🏻

ghost avatar Apr 15 '23 17:04 ghost

same here

11010001101001 avatar Jun 01 '23 20:06 11010001101001

Any answers on this?

DaleThorsen avatar Aug 08 '23 23:08 DaleThorsen

Same here. It seems to be an issue with python 3.10.

Workaround:

  • If your application can handle it, downgrade to python 3.9.
  • pip install simple-crypt
  • If you still get an error like this one, uninstall PyCrypto (dead) and install PyCryptodome (its living fork) as it says there: pip uninstall PyCrypto; pip install -U PyCryptodome
  • Then it worked

quadrismegistus avatar Sep 12 '23 15:09 quadrismegistus