0

Suddenly, I don't know why occurs the error for every python file in this project, let's take for example and use matplotlib.

I tried this:

import matplotlib.pyplot as plt

plt.plot([1,2,3],[1,2,3])
plt.show()

And the error is:

Remainder of file ignored
Traceback (most recent call last):
  File "C:\Users\Idensas\PycharmProjects\protest\try.py", line 1, in <module>
    import matplotlib.pyplot as plt
  File "C:\Users\Idensas\AppData\Local\Programs\Python\Python39\lib\site-packages\matplotlib\__init__.py", line 89, in <module>
    import importlib
  File "C:\Users\Idensas\PycharmProjects\OneMoreTime\pypy\lib-python\3\importlib\__init__.py", line 51, in <module>
    _w_long = _bootstrap_external._w_long
AttributeError: module 'importlib._bootstrap_external' has no attribute '_w_long'

There are more errors but I omit that, because they all same like this above, errors with:

  • protobuf-3.18.0-py3.9-nspkg.pth
  • matplotlib-3.5.1-py3.9-nspkg.pth
  • googleapis_common_protos-1.53.0-py3.9-nspkg.pth
  • distutils-precedence.pth

I took a look at some same questions like mine, but nothing helped me. I have installed only one version of python, this was years ago. I just turn on my PC, go to PyCharm and an error today is occurs. Uhh...

An Ri
  • 406
  • 5
  • 13
  • 1
    You have 2 installations of python based on the file names - one under `C:\Users\Idensas\AppData\Local\Programs\Python\Python39` and one under `C:\Users\Idensas\PycharmProjects\OneMoreTime\pypy`. – SuperStormer Feb 05 '22 at 20:21
  • 1
    Does this answer your question? [module 'importlib.\_bootstrap' has no attribute '\_w\_long'](https://stackoverflow.com/questions/46509441/module-importlib-bootstrap-has-no-attribute-w-long) – SuperStormer Feb 05 '22 at 20:22
  • I saw this, but didn't understand, what exactly must I do. Based on your answer and link above, I concluded that `The environment var $PATH and $PYTHONPATH is pointing to different version's`, but I don't figure out, where exactly I can change to correct. Can you tell me, please? – An Ri Feb 06 '22 at 07:52

1 Answers1

0

Finally! I just go to Project Dependencies and unchecked, so my project "protest" with python doesn't depend on project "OneMoreTime" with pypy.

enter image description here

An Ri
  • 406
  • 5
  • 13