我正在尝试使用python3.4 -m pip install jieba
在python 3.4下安装一个包,而我已经拥有2.7。
然后我有这个错误
> Collecting jieba
Using cached jieba-0.38.zip
Building wheels for collected packages: jieba
Exception:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pip/basecommand.py", line 223, in main
status = self.run(options, args)
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pip/commands/install.py", line 293, in run
wb.build(autobuilding=True)
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pip/wheel.py", line 756, in build
ensure_dir(output_dir)
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pip/utils/__init__.py", line 70, in ensure_dir
os.makedirs(path)
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/os.py", line 227, in makedirs
makedirs(head, mode, exist_ok)
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/os.py", line 227, in makedirs
makedirs(head, mode, exist_ok)
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/os.py", line 227, in makedirs
makedirs(head, mode, exist_ok)
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/os.py", line 237, in makedirs
mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/Users/apple/Library/Caches/pip/wheels/fd'
答案 0 :(得分:0)
我明白了,一个简单的方法就是在python3.4下安装pip
$ curl -O https://bootstrap.pypa.io/get-pip.py
$ sudo python3.4 get-pip.py