[PYTHON] AttributeError:'NoneType' object has no attribute'loader'

At the beginning

This time, I will write what to do when an error like the one in the title occurs, based on my actual experience.

error contents

Error processing line 3 of /home/cjones/.local/lib/python3.6/site-packages/googleapis_common_protos-1.5.8-py3.6-nspkg.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.6/site.py", line 174, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
    File "<frozen importlib._bootstrap>", line 568, in module_from_spec
  AttributeError: 'NoneType' object has no attribute 'loader'

Remainder of file ignored

approach

From your error statement, find a path similar to the one at the top of the error content in this article. (The penultimate one should say "site-packages".) Go to the terminal that corresponds to that path.

# /home/cjones/.local/lib/python3.6/site-packages/
#Like this "site-Please enter up to "packages"
$cd found path

When the move is complete, type in the terminal as follows:

# googleapis_common_protos-1.5.8-py3.6-nspkg.pth
# site-Type in the parts after packages.
$ vi site-Parts after packages

This will open the file, so press "i" to enter edit mode.

import sys, types, os;has_mfs = sys.version_info > (3, 5);p ...<rest of file>

Find this part and insert a line break as follows.

import sys, types, os;
has_mfs = sys.version_info > (3, 5);p ...<rest of file>

When you're done, press "esc".

Finally, press ": wq" to save + exit, so you're done.

Finally

I will continue to publish articles about the errors I have experienced.

Reference site

AttributeError: 'NoneType' object has no attribute 'loader'

pip install pyomo corrupts python3 virtualenv #95

Frequently used commands in the terminal

Recommended Posts

AttributeError:'NoneType' object has no attribute'loader'
Blender has no object selection order
With xmpppy'_ssl._SSLSocket' object has no attribute'issuer'
[Python] Countermeasures for "AttributeError:'NoneType' object has no attribute'group'" of googletrans
[Python] Attribute Error:'list' object has no attribute'replace'
When'DataFrame' object has no attribute'ix' appears in pandas
Django "Query Set, Object has no attribute'foo'" solution
AttributeError: I was addicted to'module' object has no attribute'MyTestCase'
That Python code has no classes ...
[Dlib] Attribute Error: module'dlib' has no attribute ...