我已经在venv
文件夹中的projects
中设置了一个虚拟环境home
,我需要安装xlrd
Python模块。但是,当我运行命令
pip install xlrd
我收到此错误
Exception:
Traceback (most recent call last):
File "/home/ajay/projects/venv/local/lib/python2.7/site-packages/pip/basecommand.py", line 223, in main
status = self.run(options, args)
File "/home/ajay/projects/venv/local/lib/python2.7/site-packages/pip/commands/install.py", line 293, in run
wb.build(autobuilding=True)
File "/home/ajay/projects/venv/local/lib/python2.7/site-packages/pip/wheel.py", line 756, in build
ensure_dir(output_dir)
File "/home/ajay/projects/venv/local/lib/python2.7/site-packages/pip/utils/__init__.py", line 70, in ensure_dir
os.makedirs(path)
File "/home/ajay/projects/venv/lib/python2.7/os.py", line 150, in makedirs
makedirs(head, mode)
File "/home/ajay/projects/venv/lib/python2.7/os.py", line 150, in makedirs
makedirs(head, mode)
File "/home/ajay/projects/venv/lib/python2.7/os.py", line 150, in makedirs
makedirs(head, mode)
File "/home/ajay/projects/venv/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/home/ajay/.cache/pip/wheels/42'
我该如何解决这个问题?
答案 0 :(得分:1)
试试这个
sudo chown -R ajay:ajay /home/ajay/.cache