4

添加解释器时,我在 pycharm 上获得了拒绝许可。它曾经工作过,突然坏了,不知道发生了什么变化。它在 pycharm 2.7.3 上坏了,我升级到 3.0 但仍然坏了。添加了 interpeted 但它会引发此错误。任何信息都会很有用。我认为安装虚拟环境后它可能会损坏(不确定)

路径没问题,但是包是空的,安装按钮是灰色的。通常我通过终端安装,但无论如何让 ide 完全工作会很好。

更新

哪个python->/usr/bin/python

更新2 我发现有些egg文件有不同的权限。当我将权限更改为 rw rr (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
4

2 回答 2

3

我设法解决了它。

  1. 我发现 1 个特定的 egg ( ) 对非 linux 用户python_dateutil-2.1-py3.3.egg具有不正确的权限 ( 600),这意味着只有管理员可以读取该文件。
  2. 我更改了权限(到644)并重新添加了解释器。权限600自动恢复。Umask很好(022)所以我假设 pycharm 改变了它。
  3. 我做了sudo pip install --upgrade python-dateutil并再次将权限更改为644.
  4. 然后它起作用了。我认为 pycharm 不喜欢 pkg 的某些内容。

点输出:

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...
于 2013-09-26T23:17:31.427 回答
-1

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

于 2019-06-12T08:12:15.730 回答