I have an issue while importing a dynamic python module (pyd
), my file structures is as follow:
A
|--A.py
+--B
│--B.py
│--__init__.py
+--Crypto
|--__init__.py
+--Cipher
|--__init__.py
|--_AES.pyd
A.py: from B import B
B.py: from Crypto.Cipher import _AES
when executing A.py
, I get the following error:
SystemError: dynamic module not initialized properly
The import is working fine when I am executing B.py
. Also, If I move Crypto
to another place and add that folder to sys.path
, the import is still working fine.
The error occurs when B.py
and the Crypto
are under the same folder, but B
was imported by another file which is not under the same directory.