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

ModuleNotFoundError: No module named 'PyNEC' #19

Open
jdh4 opened this issue Feb 23, 2021 · 12 comments
Open

ModuleNotFoundError: No module named 'PyNEC' #19

jdh4 opened this issue Feb 23, 2021 · 12 comments

Comments

@jdh4
Copy link

jdh4 commented Feb 23, 2021

I am on RHEL7. The shared library buids successfully but when I try to do "from PyNEC import *" it produces the error: ModuleNotFoundError: No module named 'PyNEC'

My PYTHONPATH includes $HOME/.local/lib/python3.8/site-packages as confirmed by print(sys.path).

The contents of that directory is:

easy-install.pth PyNEC-1.7.3.6-py3.8-linux-x86_64.egg

There is no directory called PyNEC containing an init.py file.

Here are the contents of the one directory:

$ ls PyNEC-1.7.3.6-py3.8-linux-x86_64.egg/
EGG-INFO examples pycache _PyNEC.cpython-38-x86_64-linux-gnu.so _PyNEC.py

@afiskon
Copy link

afiskon commented Mar 9, 2021

I have the same issue on MacOS Catalina 10.15.7. Python version is 3.9.1. It used to work last time I tried PyNEC in April 2020.

@afiskon
Copy link

afiskon commented Mar 9, 2021

As a workaround the previous version can be installed:

pip3 install PyNEC==1.7.3.4

Something was broken between releases 1.7.3.4 (Aug 2019) and 1.7.3.6 (May 2020)

@glenndk
Copy link

glenndk commented May 5, 2021

I have the same issue on MacOS 10.14.6:

$ pip freeze
cycler==0.10.0
kiwisolver==1.3.1
matplotlib==3.4.1
necpp==1.7.3.5
numpy==1.20.2
Pillow==8.2.0
PyNEC==1.7.3.6
pyparsing==2.4.7
python-dateutil==2.8.1
scipy==1.6.2
six==1.15.0
$ python -V
Python 3.9.4
$

Works after downgrade (but got an error "RuntimeError: SYMMETRY ERROR - NROW: 1929734915 NCOL: 1778416642" - might be my own fault [2021-may-08: Was my fault. PyNEC works in this environment]):
$ pip freeze
cycler==0.10.0
kiwisolver==1.3.1
matplotlib==3.4.1
necpp==1.7.3.5
numpy==1.20.2
Pillow==8.2.0
PyNEC==1.7.3.4
pyparsing==2.4.7
python-dateutil==2.8.1
scipy==1.6.3
six==1.15.0
$ python -V
Python 3.9.4
$

@afiskon
Copy link

afiskon commented May 7, 2021

@glenndk try requirements.txt from this project https://github.com/afiskon/pynec-examples Worked for me.

@glenndk
Copy link

glenndk commented May 8, 2021

@afiskon Thanks for your comment. It was a fault in my test program. PyNEC==1.7.3.4 works in this environment:

$ pip freeze
cycler==0.10.0
kiwisolver==1.3.1
matplotlib==3.4.1
necpp==1.7.3.5
numpy==1.20.2
Pillow==8.2.0
PyNEC==1.7.3.4
pyparsing==2.4.7
python-dateutil==2.8.1
scipy==1.6.3
six==1.15.0
$ python -V
Python 3.9.4
$

@Nothing-Burger-Left-Pizza

Similar problem here. "No module named 'PyNEC'". :-(

@Benitoite
Copy link
Contributor

$ pydoc3 modules

Please wait a moment while I gather a list of all available modules...

_PyNEC  
>>> import _PyNEC
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: dynamic module does not define module export function (PyInit__PyNEC)

@daniel-ayers
Copy link

This is because (on my system at least) the name of the swig binary has changed from swig3.0 to just swig - see build.sh https://github.com/tmolteno/python-necpp/blob/master/PyNEC/build.sh#L17 .

If you look carefully at the output of the build process, swig isn't running at all. Making the above change fixed it for me.

Benitoite added a commit to Benitoite/python-necpp that referenced this issue Mar 15, 2023
@Benitoite
Copy link
Contributor

@daniel-ayers Oh good catch. The module specified installing building with version 3, whereas swig is currently at version 4.

PR #26 generated.

@aeropung
Copy link

I know this is off-topic, but is PyNEC still being actively developed? If so, is there somewhere that provides documentation of the pl_card from the bottom of this page?

@daniel-ayers
Copy link

... is there somewhere that provides documentation of the pl_card ...

PyNEC is a Python wrapper around a C++ library that implements a very old (c. 1980) input & output format. To understand the PL card refer to the documentation of the original library - see #22 (comment) .

@rezamarzban
Copy link

As a workaround the previous version can be installed:

pip3 install PyNEC==1.7.3.4

Something was broken between releases 1.7.3.4 (Aug 2019) and 1.7.3.6 (May 2020)

Solved the problem ...

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

No branches or pull requests

8 participants