Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importing the module after building fails #6

Open
daf276 opened this issue Mar 12, 2020 · 1 comment
Open

Importing the module after building fails #6

daf276 opened this issue Mar 12, 2020 · 1 comment

Comments

@daf276
Copy link

daf276 commented Mar 12, 2020

After following the installation/compilation steps descriped in the readme, importing the module fails with the message:
ImportError: cannot import name '_pymemsurfer' from partially initialized module 'memsurfer' (most likely due to a circular import)
This happens when trying to run the ex_simple.py or otherwise importing the module.
Tested on Arch with python 3.7 and 3.8

Traceback:
File "examples/ex_simple.py", line 20, in
import memsurfer
File "/home/user/python37/lib/python3.7/site-packages/memsurfer-1.0.0-py3.7-linux-x86_64.egg/memsurfer/__init__.py", line 15, in
from .membrabe import Membrane
File "/home/user/python37/lib/python3.7/site-packages/memsurfer-1.0.0-py3.7-linux-x86_64.egg/memsurfer/membrane.py", line 21, in
from . import pymemsurfer
File "/home/user/python37/lib/python3.7/site-packages/memsurfer-1.0.0-py3.7-linux-x86_64.egg/memsurfer/pymemsurfer.py", line 13, in
from . import _pymemsurfer
ImportError: cannot import name '_pymemsurfer' from partially initialized module 'memsurfer' (most likely due to a circular import) (/home/user/python37/lib/python3.7/site-packages/memsurfer-1.0.0-py3.7-linux-x86_64.egg/memsurfer/__init__.py)

@bhatiaharsh
Copy link
Contributor

Interesting. I never caught this problem with python3.7.2. Can you please try the following and report back if this works?

  1. /home/user/python37/lib/python3.7/site-packages/memsurfer-1.0.0-py3.7-linux-x86_64.egg/memsurfer/__init__.py -- Comment line 15 (the import statement)

  2. ex_simple.py
    -- add from memsurfer import membrane
    -- change lines 63, 95, and 96: replace memsurfer.Membrane with memsurfer.membrane.Membrane

If this example works, you can make changes to the other examples as well. If this works, I will move this changes to the repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants