IOError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/protobuf-3.2.0-py2.7.egg/EGG-INFO/namespace_packages.txt'

If you try to execute a python script and you get this error:

File "~/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3017, in <module>
    @_call_aside
  File "~/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3003, in _call_aside
    f(*args, **kwargs)
  File "~/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3045, in _initialize_master_working_set
    dist.activate(replace=False)
  File "~/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2575, in activate
    for pkg in self._get_metadata('namespace_packages.txt'):
  File "~/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2565, in _get_metadata
    for line in self.get_metadata_lines(name):
  File "~/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1471, in get_metadata_lines
    return yield_lines(self.get_metadata(name))
  File "~/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1467, in get_metadata
    value = self._get(self._fn(self.egg_info, name))
  File "~/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1576, in _get
    with open(path, 'rb') as stream:
IOError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/protobuf-3.2.0-py2.7.egg/EGG-INFO/namespace_packages.txt'

Process finished with exit code 1


You only need to change the .txt permissions as follows:

sudo chmod o+r /usr/local/lib/python2.7/dist-packages/protobuf-3.2.0-py2.7.egg/EGG-INFO/namespace_packages.txt

Enjoy it!













Comments

Popular posts from this blog

Fix "Set scan parameters failed: Input/output error" on Ubuntu 16.04

from: can't read /var/mail/ in Python scripts

SNMP + Telegraf + InfluxDB