pypa / pip

The Python package installer
https://pip.pypa.io/
MIT License
9.52k stars 3.02k forks source link

ImportError: No module named NuGridPy #5342

Closed hamid-hassani closed 6 years ago

hamid-hassani commented 6 years ago

Description:

When I run my example file include this codes: from NuGridPy import mesa as ms

What I've get:

Traceback (most recent call last): File "py.py", line 1, in from NuGridPy import mesa as ms ImportError: No module named NuGridPy

Can anyone help me with this?

hamid-hassani commented 6 years ago

Any help?

pfmoore commented 6 years ago

It sounds like you don't have NuGridPy installed. That's not a pip issue, you use pip to install NuGridPy - pip install NuGridPy.

hamid-hassani commented 6 years ago

I have installed this package many times, My results after :

pip install NuGridPy

Requirement already satisfied: NuGridPy in ./anaconda2/lib/python2.7/site-packages (0.7.4) Requirement already satisfied: xlrd in ./anaconda2/lib/python2.7/site-packages (from NuGridPy) (1.1.0) Requirement already satisfied: numpy in ./anaconda2/lib/python2.7/site-packages (from NuGridPy) (1.13.3) Requirement already satisfied: setuptools in ./anaconda2/lib/python2.7/site-packages (from NuGridPy) (36.5.0.post20170921) Requirement already satisfied: matplotlib in ./.local/lib/python2.7/site-packages (from NuGridPy) (2.1.1) Requirement already satisfied: h5py in ./anaconda2/lib/python2.7/site-packages (from NuGridPy) (2.7.0) Requirement already satisfied: future in ./anaconda2/lib/python2.7/site-packages/future-0.16.0-py2.7.egg (from NuGridPy) (0.16.0) Requirement already satisfied: scipy in ./anaconda2/lib/python2.7/site-packages (from NuGridPy) (1.0.0) Requirement already satisfied: cycler>=0.10 in ./anaconda2/lib/python2.7/site-packages (from matplotlib->NuGridPy) (0.10.0) Requirement already satisfied: python-dateutil>=2.0 in ./anaconda2/lib/python2.7/site-packages (from matplotlib->NuGridPy) (2.6.1) Requirement already satisfied: backports.functools-lru-cache in ./anaconda2/lib/python2.7/site-packages (from matplotlib->NuGridPy) (1.4) Requirement already satisfied: subprocess32 in ./anaconda2/lib/python2.7/site-packages (from matplotlib->NuGridPy) (3.2.7) Requirement already satisfied: six>=1.10 in ./anaconda2/lib/python2.7/site-packages (from matplotlib->NuGridPy) (1.11.0) Requirement already satisfied: pytz in ./.local/lib/python2.7/site-packages (from matplotlib->NuGridPy) (2017.3) Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in ./anaconda2/lib/python2.7/site-packages (from matplotlib->NuGridPy) (2.2.0)

pradyunsg commented 6 years ago

Hey @theparmis!

What is the output of python --version and pip --version?

hamid-hassani commented 6 years ago

Hey there! Python 2.7.9 :: Anaconda custom (64-bit) pip 10.0.1 from /Users/myuser/anaconda2/lib/python2.7/site-packages/pip (python 2.7)

hamid-hassani commented 6 years ago

Any Help?!!

pradyunsg commented 6 years ago

Hey @theparmis!

You need to import from nugridpy. The capitalization matters.

from nugridpy import mesa as ms 

I'd suggest you file an issue over at NuGridPy about their incorrect example in the README. :)

pradyunsg commented 6 years ago

I'd suggest you file an issue over at NuGridPy about their incorrect example in the README. :)

I've gone ahead and done that -- https://github.com/NuGrid/NuGridPy/issues/55.

hamid-hassani commented 6 years ago

It is not possible that such ridiculous error wasted my time for a month!

Thank you!

After that I get this error:

Traceback (most recent call last):

  File "example.py", line 1, in 
    from nugridpy import mesa as ms 
  File "/Users/USER/anaconda2/lib/python2.7/site-packages/NuGridpy-0.7.4-py2.7.egg/nugridpy/mesa.py", line 140, in 
    from . import ascii_table
  File "/Users/USER/anaconda2/lib/python2.7/site-packages/NuGridpy-0.7.4-py2.7.egg/nugridpy/ascii_table.py", line 47, in 
    from .data_plot import *
  File "/Users/USER/anaconda2/lib/python2.7/site-packages/NuGridpy-0.7.4-py2.7.egg/nugridpy/data_plot.py", line 59, in 
    from . import astronomy as ast
  File "/Users/USER/anaconda2/lib/python2.7/site-packages/NuGridpy-0.7.4-py2.7.egg/USER/astronomy.py", line 26, in 
    radiation_constant = 4*boltzmann_sigma/speed_light
NameError: name 'boltzmann_sigma' is not defined
            
pradyunsg commented 6 years ago

It is not possible that such ridiculous error wasted my time for a month! Thank you!

Hehe. You're welcome. :)

After that I get this error:

The right place for asking for help dealing with package-specific issues would be the project itself -- please ask on a NuGridPy forum/issue-tracker/mailing-list/whatever-they-use.


I'll go ahead and close this issue since there doesn't seem anything actionable from pip's end here. :)

fherwig commented 6 years ago

@theparmis NameError: name 'boltzmann_sigma' is not defined was an error that took a few days to note, but it is now fixed (NuGridPy failed to build for a short while, but this is fixed now). This error would not appear in the version 0.74 from PyPIP, only if you installed the latest version from git.

lock[bot] commented 5 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.