Mac系統pip安裝包的問題記錄

2021-08-04 08:34:46 字數 2138 閱讀 2927

因為mac系統自帶2.7.3的python,就沒打算用3.x

然後使用系統自帶的python安裝一些包的時候,由於mac系統的sip系統完整性保護,不允許我解除安裝系統自帶的已經過時的包,因此無法更新安裝。

後來就在stack overflow上找到了乙個類似情況,使用

sudo pip install *** --upgrade --ignore-installed xx
之後安裝scikit-learn的時候,沒有sudo,結果報了下面的錯

pip install -u scikit-learn

collecting scikit-learn

downloading scikit_learn-0.18.2-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (7.5mb)

100% |████████████████████████████████| 7.5mb 87kb/s

installing collected packages: scikit-learn

exception:

traceback (most recent call last):

file "/library/python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/basecommand.py", line 215, in main

status = self.run(options, args)

file "/library/python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/commands/install.py", line 342, in run

prefix=options.prefix_path,

file "/library/python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_set.py", line 784, in install

**kwargs

file "/library/python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 851, in install

self.move_wheel_files(self.source_dir, root=root, prefix=prefix)

file "/library/python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 1064, in move_wheel_files

isolated=self.isolated,

file "/library/python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/wheel.py", line 345, in move_wheel_files

clobber(source, lib_dir, true)

file "/library/python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/wheel.py", line 316, in clobber

ensure_dir(destdir)

file "/library/python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/utils/__init__.py", line 83, in ensure_dir

os.makedirs(path)

file "/system/library/frameworks/python.framework/versions/2.7/lib/python2.7/os.py", line 157, in makedirs

mkdir(name, mode)

oserror: [errno 13] permission denied: '/library/python/2.7/site-packages/scikit_learn-0.18.2.dist-info'

提示無法mkdir,加了個sudo解決問題。

mac系統安裝手機安裝包

mac系統安裝手機安裝包步驟 1.開啟終端,輸入如下命令列,安裝homebrew ruby e curl fssl bin zsh c curl fssl 看到installation successful 就說明安裝成功了 2.安裝adb brew cask install android pla...

Python,用pip安裝包,報錯

1 報錯 syntaxerror invalid syntax 原因 pip不是在 python 直譯器中執行。而是在 windows 的命令列下執行.解決辦法 通過 cmd進入dos命令列視窗。在該視窗輸入 pip install x,安裝相應的包。若接著報錯。試著重新安裝python,安裝時一定...

conda和pip安裝包方法

conda安裝 開啟anaconda prompt,安裝包 conda install package,檢查安裝包 conda list pip安裝 第一步 cmd 第二步 pip 第三部 pip install xx.whl 位置 lxml安裝 第一步 cmd 第二步 cd f wanpi9310...