简体   繁体   中英

error occur when installing package under python 3

I'm trying to install a package under python 3.4 with python3.4 -m pip install jieba while I already have 2.7.

Then I have this error

> 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'

I got it, an easy way to do it is to install pip under python3.4

$ curl -O https://bootstrap.pypa.io/get-pip.py
$ sudo python3.4 get-pip.py

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM