添加解释器时出现Pycharm错误,权限被拒绝

时间:2013-09-26 22:22:36

标签: python pycharm

添加解释器时,我在pycharm上获得了权限被拒绝。它曾经工作,突然爆发,不知道发生了什么变化。它打破了pycharm 2.7.3我升级到3.0但仍然破碎。已添加插入但它会抛出此错误。任何信息都会有用。我认为安装虚拟环境后可能会破坏(不确定)

路径正常,但包是空的,安装按钮显示为灰色。 Usualy我通过终端安装,但无论如何都能让ide完全正常工作。

更新

  

哪个python - > / usr / bin / python

更新2 我发现一些egg文件具有不同的权限。 当我将权限更改为rw r r(644)时,由于某种原因,它们会回到600.

  

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

2 个答案:

答案 0 :(得分:3)

我设法解决了。

  1. 我发现1个特定的鸡蛋(python_dateutil-2.1-py3.3.egg)对Linux用户没有错误的权限(600),这意味着只有管理员可以读取该文件。
  2. 我更改了权限(到644)并重新添加了解释器。权限自动返回600。 Umask很好(022)所以我假设pycharm改变了它。
  3. 我做了sudo pip install --upgrade python-dateutil并再次将权限更改为644
  4. 然后它奏效了。我假设pycharm不喜欢pkg的某些东西。
  5. 点子输出:

    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...
    

答案 1 :(得分:-1)

在安装Java Development Kit和Eclipse之后遇到了这个问题。我修复它的方法是从控制面板中卸载jdk并重新安装Python 3.2,确保我添加了新的路径名。我还删除了之前链接的PATH变量到Python。