Using Crypt function Python 3.3.2
Posted
by
adampski
on Stack Overflow
See other posts from Stack Overflow
or by adampski
Published on 2013-11-09T15:51:55Z
Indexed on
2013/11/09
15:53 UTC
Read the original article
Hit count: 987
In Windows and Python version 3.3.2, I try and call the python module like so:
hash2 = crypt(word, salt)
I import it at the top of my program like so:
from crypt import *
The result I get is the following:
Traceback (most recent call last):
File "C:\none\of\your\business\adams.py", line 10, in <module>
from crypt import *
File "C:\Python33\lib\crypt.py", line 3, in <module>
import _crypt
ImportError: No module named '_crypt'
However, when I execute the same file adams.py
in Ubuntu, with Python 2.7.3, it executes perfectly - no errors.
I tried the following to resolve the issue for my Windows & Python 3.3.2 (though I'm sure the OS isn't the issue, the Python version or my use of syntax is the issue):
- Rename the directory in the
Python33
directory fromLib
tolib
- Rename the
crypt.py
inlib
to_crypt.py
. However, it turns out the entirecrypt.py
module depends on an external module called_crypt.py
too. - Browsed internet to download anything remotely appropriate to resemble
_crypt.py
It's not Python, right? It's me...(?) I'm using syntaxes to import and use external modules that are acceptable in 2.7.3, but not in 3.3.2. Or have I found a bug in 3.3.2?
© Stack Overflow or respective owner