IOError:[Errno 13]权限被拒绝:'/ usr / local / lib /netscape / mime.types'

时间:2017-09-05 22:06:17

标签: 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'

2 个答案:

答案 0 :(得分:7)

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

答案 1 :(得分:1)

这可能是因为您的文件“mime.types”没有足够的权限状态。 使用前面提到的chmod命令。