pycryptodome module cannot be imported as wheel
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
1
down vote
favorite
I have downloaded the pycryptodome python module wheel format file (pycryptodome.whl) from this link.
Now when I try to import and use it as follows
from Crypto.PublicKey import RSA
I get
ImportError: No module named Crypto.PublicKey
I have another module called PyVMOMI (pyvmomi.whl) where I do not see this problem. I can very well import any of its module files without any error.
Note: the directory where the *.whl file is located is set in the PYTHONPATH variable already.
python
add a comment |Â
up vote
1
down vote
favorite
I have downloaded the pycryptodome python module wheel format file (pycryptodome.whl) from this link.
Now when I try to import and use it as follows
from Crypto.PublicKey import RSA
I get
ImportError: No module named Crypto.PublicKey
I have another module called PyVMOMI (pyvmomi.whl) where I do not see this problem. I can very well import any of its module files without any error.
Note: the directory where the *.whl file is located is set in the PYTHONPATH variable already.
python
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I have downloaded the pycryptodome python module wheel format file (pycryptodome.whl) from this link.
Now when I try to import and use it as follows
from Crypto.PublicKey import RSA
I get
ImportError: No module named Crypto.PublicKey
I have another module called PyVMOMI (pyvmomi.whl) where I do not see this problem. I can very well import any of its module files without any error.
Note: the directory where the *.whl file is located is set in the PYTHONPATH variable already.
python
I have downloaded the pycryptodome python module wheel format file (pycryptodome.whl) from this link.
Now when I try to import and use it as follows
from Crypto.PublicKey import RSA
I get
ImportError: No module named Crypto.PublicKey
I have another module called PyVMOMI (pyvmomi.whl) where I do not see this problem. I can very well import any of its module files without any error.
Note: the directory where the *.whl file is located is set in the PYTHONPATH variable already.
python
edited Jul 19 at 12:58
Anderson
987
987
asked Jul 19 at 12:09
Ibrahim Quraish
1419
1419
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
0
down vote
Wheels are not meant to be directly importable. While this may work with simple packages, it is not guaranteed to work for all wheels so I wouldn't rely on it. See PEP 491, section Is it possible to import Python code directly from a wheel file?
Even with ordinary zipfiles in
sys.path
, no dynamic libs will be imported from zipfiles. Quoting PEP 273, section Specification:
Any files may be present in the zip archive, but only files
*.py
and*.py[co]
are available for import. Zip import of dynamic modules (*.pyd
,*.so
) is disallowed.
This is what happens with pycryptodome
: it ships C extension modules, precompiled into dynamic libs, which are not imported from wheel. You will need to install the wheel to be able to use the code from extensions:
$ pip install pycryptodome
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Wheels are not meant to be directly importable. While this may work with simple packages, it is not guaranteed to work for all wheels so I wouldn't rely on it. See PEP 491, section Is it possible to import Python code directly from a wheel file?
Even with ordinary zipfiles in
sys.path
, no dynamic libs will be imported from zipfiles. Quoting PEP 273, section Specification:
Any files may be present in the zip archive, but only files
*.py
and*.py[co]
are available for import. Zip import of dynamic modules (*.pyd
,*.so
) is disallowed.
This is what happens with pycryptodome
: it ships C extension modules, precompiled into dynamic libs, which are not imported from wheel. You will need to install the wheel to be able to use the code from extensions:
$ pip install pycryptodome
add a comment |Â
up vote
0
down vote
Wheels are not meant to be directly importable. While this may work with simple packages, it is not guaranteed to work for all wheels so I wouldn't rely on it. See PEP 491, section Is it possible to import Python code directly from a wheel file?
Even with ordinary zipfiles in
sys.path
, no dynamic libs will be imported from zipfiles. Quoting PEP 273, section Specification:
Any files may be present in the zip archive, but only files
*.py
and*.py[co]
are available for import. Zip import of dynamic modules (*.pyd
,*.so
) is disallowed.
This is what happens with pycryptodome
: it ships C extension modules, precompiled into dynamic libs, which are not imported from wheel. You will need to install the wheel to be able to use the code from extensions:
$ pip install pycryptodome
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Wheels are not meant to be directly importable. While this may work with simple packages, it is not guaranteed to work for all wheels so I wouldn't rely on it. See PEP 491, section Is it possible to import Python code directly from a wheel file?
Even with ordinary zipfiles in
sys.path
, no dynamic libs will be imported from zipfiles. Quoting PEP 273, section Specification:
Any files may be present in the zip archive, but only files
*.py
and*.py[co]
are available for import. Zip import of dynamic modules (*.pyd
,*.so
) is disallowed.
This is what happens with pycryptodome
: it ships C extension modules, precompiled into dynamic libs, which are not imported from wheel. You will need to install the wheel to be able to use the code from extensions:
$ pip install pycryptodome
Wheels are not meant to be directly importable. While this may work with simple packages, it is not guaranteed to work for all wheels so I wouldn't rely on it. See PEP 491, section Is it possible to import Python code directly from a wheel file?
Even with ordinary zipfiles in
sys.path
, no dynamic libs will be imported from zipfiles. Quoting PEP 273, section Specification:
Any files may be present in the zip archive, but only files
*.py
and*.py[co]
are available for import. Zip import of dynamic modules (*.pyd
,*.so
) is disallowed.
This is what happens with pycryptodome
: it ships C extension modules, precompiled into dynamic libs, which are not imported from wheel. You will need to install the wheel to be able to use the code from extensions:
$ pip install pycryptodome
answered Jul 19 at 21:29
hoefling
396310
396310
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f457197%2fpycryptodome-module-cannot-be-imported-as-wheel%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password