2017-09-05 137 views
2

我使用mkvirtualenv創建虛擬環境,並且出現此錯誤,我哪裏出錯了?IOError:[Errno 13] Permission denied:'/usr/local/lib/netscape/mime.types'

$ 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' 
+0

嘗試用'sudo' – eyllanesc

+0

什麼給ls -l/usr/local/lib/netscape/mime.types? – phd

+0

@phd它給出了-rw ------- 1 root root 106 ago 14 23:52/usr/local/lib/netscape/mime.types。 – usmanayubsh

回答

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

這可能是因爲你的文件「的mime.types」有沒有足夠的權限狀態。 使用前面提到的chmod命令。

相關問題