Python 如何安装scikit映像?
它说: 或 但无论标志U是什么,这两个都会失败,如下所示:Python 如何安装scikit映像?,python,macos,image-processing,scipy,scikit-image,Python,Macos,Image Processing,Scipy,Scikit Image,它说: 或 但无论标志U是什么,这两个都会失败,如下所示: Georgioss-MacBook-Pro:Downloads gsamaras$ sudo pip install scikit-image The directory '/Users/gsamaras/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Pl
Georgioss-MacBook-Pro:Downloads gsamaras$ sudo pip install scikit-image
The directory '/Users/gsamaras/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/gsamaras/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting scikit-image
Downloading scikit_image-0.12.3-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 (22.2MB)
100% |████████████████████████████████| 22.2MB 53kB/s
Requirement already satisfied: dask[array]>=0.5.0 in /Library/Python/2.7/site-packages (from scikit-image)
Collecting six>=1.7.3 (from scikit-image)
Downloading six-1.10.0-py2.py3-none-any.whl
Collecting networkx>=1.8 (from scikit-image)
Downloading networkx-1.11-py2.py3-none-any.whl (1.3MB)
100% |████████████████████████████████| 1.3MB 133kB/s
Requirement already satisfied: pillow>=2.1.0 in /Library/Python/2.7/site-packages (from scikit-image)
Requirement already satisfied: numpy; extra == "array" in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from dask[array]>=0.5.0->scikit-image)
Requirement already satisfied: toolz>=0.7.2; extra == "array" in /Library/Python/2.7/site-packages (from dask[array]>=0.5.0->scikit-image)
Collecting decorator>=3.4.0 (from networkx>=1.8->scikit-image)
Downloading decorator-4.0.10-py2.py3-none-any.whl
Installing collected packages: six, decorator, networkx, scikit-image
Found existing installation: six 1.4.1
DEPRECATION: Uninstalling a distutils installed project (six) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
Uninstalling six-1.4.1:
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 778, in install
requirement.uninstall(auto_confirm=True)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 754, in uninstall
paths_to_remove.remove(auto_confirm)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_uninstall.py", line 115, in remove
renames(path, new_path)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/utils/__init__.py", line 267, in renames
shutil.move(old, new)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 302, in move
copy2(src, real_dst)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 131, in copy2
copystat(src, dst)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 103, in copystat
os.chflags(dst, st.st_flags)
OSError: [Errno 1] Operation not permitted: '/tmp/pip-qlMJKP-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'
Georgioss-MacBook-Pro:Downloads gsamaras$
以及:
请注意,brew
也会失败,无法找到它
我有python2.7.10、matplotlib1.3.1、pil3.4.2和Scipy“0.18.1”。怎么办?在系统范围的Python上安装库通常不是一个好主意。为每个项目使用virtualenv 首先在Mac上全局安装:
$ [sudo] pip install virtualenv
然后使用命令创建Python可执行文件的新(副本):
$ cd your/prefred/folder
$ virtualenv your_project
激活virtualenv:
$ source your_project/bin/activate
您的virtualenv已创建并激活(提示已更改以显示激活)。您可以在其中安装任何内容:
$ pip install -U scikit-image
在系统范围的Python上安装库通常不是一个好主意。为每个项目使用virtualenv 首先在Mac上全局安装:
$ [sudo] pip install virtualenv
然后使用命令创建Python可执行文件的新(副本):
$ cd your/prefred/folder
$ virtualenv your_project
激活virtualenv:
$ source your_project/bin/activate
您的virtualenv已创建并激活(提示已更改以显示激活)。您可以在其中安装任何内容:
$ pip install -U scikit-image
pip安装scikit映像
pip安装--升级scikit映像
要调用,请使用skimage
pip安装scikit映像
pip安装--升级scikit映像
要调用,请使用skimage
(将此作为答案输入,以便包含错误消息)。
使用@Krackle的第一个答案,我得到了以下(令人困惑的)输出,我在这里添加这些输出是为了帮助其他人:
pip install skimage
Collecting skimage
Using cached skimage-0.0.tar.gz (757 bytes)
ERROR: Command errored out with exit status 1:
command: /opt/anaconda3/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/ft/7j605bsd10l0ftqygyxjjflh0000gq/T/pip-install-xtxr1328/skimage/setup.py'"'"'; __file__='"'"'/private/var/folders/ft/7j605bsd10l0ftqygyxjjflh0000gq/T/pip-install-xtxr1328/skimage/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/ft/7j605bsd10l0ftqygyxjjflh0000gq/T/pip-pip-egg-info-q8dwl8rl
cwd: /private/var/folders/ft/7j605bsd10l0ftqygyxjjflh0000gq/T/pip-install-xtxr1328/skimage/
Complete output (3 lines):
*** Please install the `scikit-image` package (instead of `skimage`) ***
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
然后,我使用@Krackle的第二个命令(到目前为止)解决了问题。(输入此命令作为答案,以便包含错误消息)。
使用@Krackle的第一个答案,我得到了以下(令人困惑的)输出,我在这里添加这些输出是为了帮助其他人:
pip install skimage
Collecting skimage
Using cached skimage-0.0.tar.gz (757 bytes)
ERROR: Command errored out with exit status 1:
command: /opt/anaconda3/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/ft/7j605bsd10l0ftqygyxjjflh0000gq/T/pip-install-xtxr1328/skimage/setup.py'"'"'; __file__='"'"'/private/var/folders/ft/7j605bsd10l0ftqygyxjjflh0000gq/T/pip-install-xtxr1328/skimage/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/ft/7j605bsd10l0ftqygyxjjflh0000gq/T/pip-pip-egg-info-q8dwl8rl
cwd: /private/var/folders/ft/7j605bsd10l0ftqygyxjjflh0000gq/T/pip-install-xtxr1328/skimage/
Complete output (3 lines):
*** Please install the `scikit-image` package (instead of `skimage`) ***
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
然后,我使用@Krackle的第二个命令(到目前为止)解决了这个问题。您应该使用virtualenv。请看我的回答:@LaurentPorte你的回答似乎太简洁,我又没有经验,你能引导我通过吗/有关virtualenv的文档如下:。但也请看我的答案。你应该使用虚拟电视。请看我的回答:@LaurentPorte你的回答似乎太简洁,我又没有经验,你能引导我通过吗/有关virtualenv的文档如下:。但也请看我的答案。虽然这应该有效,但如果没有virtualenv,我会不顾一切地解决它。我会等着看是否有其他事情发生,否则我会接受你的回答,谢谢!当然请记住,“强迫”它在系统范围内安装(例如使用sudo),会污染Python安装,并可能安装不需要的包,从而破坏系统/操作系统。没有任何结果。我已经安装了一些东西,最好先卸载它们,然后进入virtualenv,对吗?不需要:你的virtualenv中没有安装站点包(除非你指定)。确实如此,但这不是一个好主意吗?我已经发布了一个相关的。看我的编辑!虽然这应该是可行的,但如果没有virtualenv,我会不顾一切地解决它。我会等着看是否有其他事情发生,否则我会接受你的回答,谢谢!当然请记住,“强迫”它在系统范围内安装(例如使用sudo),会污染Python安装,并可能安装不需要的包,从而破坏系统/操作系统。没有任何结果。我已经安装了一些东西,最好先卸载它们,然后进入virtualenv,对吗?不需要:你的virtualenv中没有安装站点包(除非你指定)。确实如此,但这不是一个好主意吗?我已经发布了一个相关的。看我的编辑!添加其他答案,因为我无法将输出包含在注释中。添加其他答案,因为我无法将输出包含在注释中。