Pycharm error when adding interpreter, permission denied

20,813

I managed to solve it.

  1. I found out that 1 specific egg (python_dateutil-2.1-py3.3.egg) had incorrect permissions(600) for not linux users this means only admin can read the file.
  2. I changed permissions(to 644) and re-add the interpreter. The permissions came back to 600 automaticly. Umask is fine(022) so i assumed pycharm changed it.
  3. I did sudo pip install --upgrade python-dateutil and changed the permissions again to 644.
  4. Then it worked. I assume there was something about the pkg that pycharm didn't like.

pip output:

sudo   pip install --upgrade python-dateutil
Requirement already up-to-date: python-dateutil in /usr/lib/python3.3/site-packages/python_dateutil-2.1-py3.3.egg
Downloading/unpacking six from https://pypi.python.org/packages/source/s/six/six-1.4.1.tar.gz#md5=bdbb9e12d3336c198695aa4cf3a61d62 (from python-dateutil)
  Downloading six-1.4.1.tar.gz
  Running setup.py egg_info for package six

Installing collected packages: six
  Found existing installation: six 1.3.0
    Uninstalling six:
      Successfully uninstalled six
  Running setup.py install for six

Successfully installed six
Cleaning up...
Share:
20,813
Foo Bar User
Author by

Foo Bar User

Insanity: doing the same thing over and over again and expecting different results.Albert Einstein There are two things a person should never be angry at, what they can help, and what they cannot.Plato I recommend the book Pragmatic Programmer You can buy a person's hand, but you can't buy his heart. His heart is where his enthusiasm, his loyalty is. You can buy his back, but you can't buy his brain. That's where his creativity is, his ingenuity, his resourcefulness. Stephen R. Covey

Updated on June 13, 2020

Comments

  • Foo Bar User
    Foo Bar User about 4 years

    I get permission denied on pycharm when adding an interpreter. It used to work and suddenly broke not sure what changed. It broke on pycharm 2.7.3 i upgraded to 3.0 but still broken. The interpeted is added but it throws this error. Any information would be useful. I think it might broke after installing virtual enviroments(not sure)

    The paths are ok but the packages are empty and the install button is grayed out. Usualy i install through terminal but it would be nice to get the ide fully working anyway.

    Update

    which python ->/usr/bin/python

    Update 2 I found that some egg files have different permissions. When i change the permissions to rw r r (644) they come back to 600 for some reason.

    umask -> 0022

    drwxr-xr-x  2 root root 4096 02.09.2013 01:06 ./
    drwxr-xr-x 53 root root 4096 23.09.2013 21:29 ../
    -rw-r--r--  1 root root    8 02.09.2013 01:06 top_level.txt
    -rw-r--r--  1 root root 1319 02.09.2013 01:06 PKG-INFO
    -rw-r--r--  1 root root    1 02.09.2013 01:06 dependency_links.txt
    -rw-r--r--  1 root root 5792 02.09.2013 01:06 SOURCES.txt
    -rw-r--r--  1 root root 8666 02.09.2013 01:06 installed-files.txt
    
    drwxr-xr-x 4 root root 4096 31.08.2013 22:28 ../
    drwxr-xr-x 2 root root 4096 31.08.2013 22:28 ./
    -rw------- 1 root root    9 31.08.2013 22:28 top_level.txt
    -rw------- 1 root root  563 31.08.2013 22:28 SOURCES.txt
    -rw------- 1 root root    3 31.08.2013 22:28 requires.txt
    -rw------- 1 root root  425 31.08.2013 22:28 PKG-INFO
    -rw------- 1 root root    1 31.08.2013 22:28 not-zip-safe
    -rw------- 1 root root    1 31.08.2013 22:28 dependency_links.txt
    
    
    Traceback (most recent call last): 
    File "/usr/lib/python3.3/site-packages/pkg_resources.py", 
    line 2304, in _dep_map return self.__dep_map File "/usr/lib/python3.3/site-packages/pkg_resources.py",
    line 2374, in __getattr__ raise AttributeError(attr) AttributeError: 
    _Distribution__dep_map During handling of the above exception, another exception occurred: 
    Traceback (most recent call last): 
    File "/home/foobar/Programming/pycharm3/helpers/packaging_tool.py",
    line 115, in main do_list() File "/home/foobar/Programming/pycharm3/helpers/packaging_tool.py",
    line 47, in do_list requires = ':'.join([str(x) for x in pkg.requires()]) File "/usr/lib/python3.3/site-packages/pkg_resources.py",
    line 2323, in requires dm = self._dep_map File "/usr/lib/python3.3/site-packages/pkg_resources.py", 
    line 2308, in _dep_map for extra,reqs in split_sections(self._get_metadata(name)): 
    File "/usr/lib/python3.3/site-packages/pkg_resources.py", 
    line 2750, in split_sections for line in yield_lines(s): 
    File "/usr/lib/python3.3/site-packages/pkg_resources.py", 
    line 2009, in yield_lines for ss in strs: File "/usr/lib/python3.3/site-packages/pkg_resources.py", 
    line 2337, in _get_metadata for line in self.get_metadata_lines(name): 
    File "/usr/lib/python3.3/site-packages/pkg_resources.py", 
    line 1325, in get_metadata_lines return yield_lines(self.get_metadata(name)) 
    File "/usr/lib/python3.3/site-packages/pkg_resources.py", 
    line 1322, in get_metadata return self._get(self._fn(self.egg_info,name)).decode("utf-8") 
    File "/usr/lib/python3.3/site-packages/pkg_resources.py", 
    line 1426, in _get stream = open(path, 'rb') PermissionError: 
    [Errno 13] Permission denied: '/usr/lib/python3.3/site-packages/python_dateutil-2.1-py3.3.egg/EGG-INFO/requires.txt'
    bpython 0.12 /usr/lib/python3.3/site-packages/bpython-0.12-py3.3.egg 
    pygments Pygments 1.6 /usr/lib/python3.3/site-packages/Pygments-1.6-py3.3.egg 
    OpenGLContext 2.2.0a2 /usr/lib/python3.3/site-packages/OpenGLContext-2.2.0a2-py3.3.egg 
    Cython 0.19.1 /usr/lib/python3.3/site-packages/Cython-0.19.1-py3.3-linux-x86_64.egg 
    docutils 0.11 /usr/lib/python3.3/site-packages/docutils-0.11-py3.3.egg 
    selenium 2.35.0 /usr/lib/python3.3/site-packages/selenium-2.35.0-py3.3.egg 
    numpy 1.7.1 /usr/lib/python3.3/site-packages/numpy-1.7.1-py3.3-linux-x86_64.egg 
    matplotlib 1.3.0 /usr/lib/python3.3/site-packages/matplotlib-1.3.0-py3.3-linux-x86_64.egg 
    python-dateutil:tornado:pyparsing>=1.5.6:nose nose 1.3.0 /usr/lib/python3.3/site-packages/nose-1.3.0-py3.3.egg 
    pyparsing 2.0.1 /usr/lib/python3.3/site-packages/pyparsing-2.0.1-py3.3.egg tornado 3.1 
    /usr/lib/python3.3/site-packages/tornado-3.1-py3.3.egg or create new VirtualEnv