llnl / llnl/MemSurfer

Importing the module after building fails

Open
#6 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

installation
Dominant language
C++
Stars
29
Forks
10
PR merge metrics
No merged PRs in 30d

Description

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)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the installation and compilation steps, then run examples/ex_simple.py to confirm the import failure. Read memsurfer/init.py, membrane.py, and pymemsurfer.py alongside the traceback to trace loading of _pymemsurfer; done means importing memsurfer and running the example succeed after a clean build.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python
Domain
build-system, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.