代码之家  ›  专栏  ›  技术社区  ›  usmanayubsh

IOError:[Errno 13]权限被拒绝:'/usr/local/lib/netscape/mime。类型'

  •  2
  • usmanayubsh  · 技术社区  · 7 年前

    我正在使用创建虚拟环境 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 回复  |  直到 6 年前
        1
  •  7
  •   phd    7 年前
    sudo chmod a+r /usr/local/lib/netscape/mime.types
    
        2
  •  1
  •   Raphaël Poli    7 年前

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