python-2.7 - IO错误 : [Errno 13] Permission denied: '/usr/local/lib/netscape/mime.types'

标签 python-2.7 virtualenv setuptools virtualenvwrapper netscape

我正在使用 mkvirtualenv 创建虚拟环境,但出现此错误,我哪里出错了?

$ mkvirtualenv data
New python executable in /home/usman/.virtualenvs/data/bin/python
Installing setuptools, pip, wheel...
  Complete output from command /home/usman/.virtualenvs/data/bin/python - setuptools pip wheel:
  Collecting setuptools
Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/commands/install.py", line 324, in run
    requirement_set.prepare_files(finder)
  File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/req/req_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/req/req_set.py", line 554, in _prepare_file
    require_hashes
  File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/req/req_install.py", line 278, in populate_link
    self.link = finder.find_requirement(self, upgrade)
  File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/index.py", line 465, in find_requirement
    all_candidates = self.find_all_candidates(req.name)
  File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/index.py", line 386, in find_all_candidates
    self.find_links, expand_dir=True)
  File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/index.py", line 236, in _sort_locations
    sort_path(os.path.join(path, item))
  File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/index.py", line 217, in sort_path
    if mimetypes.guess_type(url, strict=False)[0] == 'text/html':
  File "/usr/lib/python2.7/mimetypes.py", line 293, in guess_type
    init()
  File "/usr/lib/python2.7/mimetypes.py", line 358, in init
    db.read(file)
  File "/usr/lib/python2.7/mimetypes.py", line 202, in read
    with open(filename) as fp:
IOError: [Errno 13] Permission denied: '/usr/local/lib/netscape/mime.types'

最佳答案

sudo chmod a+r /usr/local/lib/netscape/mime.types

关于python-2.7 - IO错误 : [Errno 13] Permission denied: '/usr/local/lib/netscape/mime.types' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46063990/

相关文章:

python - ImportError : Couldn't import Django . ..您是否忘记激活虚拟环境?

python:如何在没有互联网连接的情况下创建 virtualenv

c++ - 重用已编译的 Theano 函数

python-2.7 - 如果使用 opencv 调整大小方法,pytorch 数据加载器会卡住

python - 如何使用 Python 从电子邮件附加的存档(rar 或 zip)中获取文件列表?

Python - 如何解析 smartctl 程序输出?

python - 如何在 Bash 脚本中激活 virtualenv

python - 从 Python setuptools 创建可启动的 GUI 脚本(没有控制台窗口!)

python - 在 Python 3.2.3 上分发 0.6.26 的安装问题

python-3.x - 控制台脚本执行时出现 ModuleNotFoundError