PlasmaPy: ModuleNotFoundError: No module named 'plasmapy.classes' on plasmapy import

On importing freshly installed plasmapy into a new environment:

(plasmapy) [~]$ python
Python 3.6.2 |Continuum Analytics, Inc.| (default, Jul 20 2017, 13:51:32) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import plasmapy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/dominik/.anaconda3/envs/plasmapy/lib/python3.6/site-packages/plasmapy/__init__.py", line 8, in <module>
    from .classes import Plasma
ModuleNotFoundError: No module named 'plasmapy.classes'

The goal of this one is being able to import plasmapy. At all.

The issue likely lies in plasmapy/__init__.py.

To quote @cadair 's words of encouragement on this bugfixing journey, packaging is a special kind of hell.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 15 (14 by maintainers)

Most upvoted comments

If you stated your python session in the root directory of this repo, you would be able to import plasmapy.classes since the root directory would be part of the PYTHONPATH.

If you installed plasmapy with pip install . or python setup.py install and moved to another directory, the original setup.py only installed plasmapy/_metadata.py and plasmapy/__init__.py, leaving out all the other modules.

Well, it was worth a try.

On Sep 27, 2017 9:28 PM, “Colby Haggerty” notifications@github.com wrote:

It doesn’t look like you can just switch the lines. This is what I get when I tried:

Traceback (most recent call last): File “test_import.py”, line 1, in <module> import plasmapy File “/Users/colbych/anaconda/envs/plasmapy/lib/python3.6/site-packages/plasmapy/init.py”, line 8, in <module> from . import classes ImportError: cannot import name ‘classes’

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/PlasmaPy/PlasmaPy/issues/121#issuecomment-332629977, or mute the thread https://github.com/notifications/unsubscribe-auth/AKxDLyIQxape1IwB0Q-M9_rc-NqPCugWks5smqHdgaJpZM4PkfN0 .

I can also confirm this bug. screenshot