periodic icon indicating copy to clipboard operation
periodic copied to clipboard

ImportError: No module named 'mass'

Open shrx opened this issue 10 years ago • 10 comments

If I want to import periodic with import periodic, I get an error:

Traceback (most recent call last):
  File "/home/marting/PycharmProjects/simple/3d_test.py", line 4, in <module>
    import periodic
  File "/usr/local/lib/python3.4/dist-packages/periodic/__init__.py", line 1, in <module>
    import mass
ImportError: No module named 'mass'

I installed periodic with sudo pip3 install periodic.

shrx avatar Dec 03 '14 13:12 shrx

This bug will be fixed by pull request #2.

kalvdans avatar Mar 16 '15 09:03 kalvdans

The distribution on https://pypi.python.org/pypi/periodic still has the import problem:

Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 12:04:33) 
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from periodic import element
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/yjj/anaconda3/lib/python3.6/site-packages/periodic/__init__.py", line 1, in <module>
    import mass
ModuleNotFoundError: No module named 'mass'

Pyxidatol-C avatar Mar 09 '18 17:03 Pyxidatol-C

I am also seeing this problem, is there a fix that could be worked on ? Thanks

mdommett avatar Aug 14 '18 11:08 mdommett

Yes, was there an answer for this specific issue?

42force avatar Mar 23 '19 15:03 42force

Still same problem

u-gajera avatar Feb 14 '20 14:02 u-gajera

In case more people run into this problem and just want a quick fix for themselves, I recommend the following: Go to /usr/lib/python3.8/site-packages/periodic (or wherever the package manager put your python and periodic installation) and edit the __init__.py to reflect the changes made in the following pull request: https://github.com/luisnaranjo733/periodic/pull/2/commits/29b131da1f46dd642cae74a4a2731089412196df

Br0Fi avatar Feb 18 '20 14:02 Br0Fi

Error: File "/Users//anaconda3/lib/python3.6/site-packages/periodic/init.py", line 1, in open the path which is shown in console with init.py example pico "/Users//********/............./init.py"

open this path using pico and vim editor and update the two lines in the file to below two lines

from . import mass from .table import *

IT worked for me.

ravivemagiri avatar Apr 21 '20 11:04 ravivemagiri

Facing the same problem

sajidislam-cyber avatar Aug 27 '20 10:08 sajidislam-cyber

found the issue... its with the imports in init.py in the package. Made changes to the init.py in stored or installed package by adding .(dot) before importing and it worked.
new init.py ==> from . import mass from .table import *

sudarshanDudhe avatar Oct 04 '20 18:10 sudarshanDudhe

I pushed the updated code to pypi as periodic2023 https://pypi.org/project/periodic2023/

Gerardwx avatar Jan 25 '23 12:01 Gerardwx