Cannot import Crypto.Random on python3
Bug #1304583 reported by
John Nelson
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Python-Crypto |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Crypto/
except IOError, e:
This was valid in py2.x, but not in py3.x; consequently the import fails with a SyntaxError:
>>> import Crypto.Random
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/
from Crypto.Random import OSRNG
File "/home/
from Crypto.
File "/home/
except IOError, e:
Version is 2.6 (fetched using PIP a few hours ago).
To post a comment you must log in.
You are probably using a python2-enabled pip, so this is not a real bug.
Try this:
===
virtualenv -p /usr/bin/python3 py3
. py3/bin/activate
pip install pycrypto
### Try out the Random module. Some warnings may be presented. python3. 2/site- packages/ Crypto/ SelfTest/ Random
cd py3/lib/
python __init__.py
===