当前位置: 首页 > 面试题库 >

如何安装scikit-image?

尚声
2023-03-14
问题内容

其scikit映像下载显示:

pip install -U scikit-image

要么

easy_install -U 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. 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$

和:

Georgioss-MacBook-Pro:Downloads gsamaras$ sudo easy_install scikit-image
Searching for scikit-image
Reading https://pypi.python.org/simple/scikit-image/
Best match: scikit-image 0.12.3
Downloading https://pypi.python.org/packages/86/d0/b0192dc9a544da90f2d9150bcd84b981c6873e42a1f752b6affb89180ad8/scikit-image-0.12.3.tar.gz#md5=04ea833383e0b6ad5f65da21292c25e1
Processing scikit-image-0.12.3.tar.gz
Writing /tmp/easy_install-X6Pjoh/scikit-image-0.12.3/setup.cfg
Running scikit-image-0.12.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-X6Pjoh/scikit-image-0.12.3/egg-dist-tmp-lHJxkL
Killed: 9

请注意,该操作brew也会失败,无法找到它。

我有Python 2.7.10,Matplotlib 1.3.1,PIL 3.4.2和Scipy‘0.18.1’。该怎么办?


问题答案:

在系统级Python上安装库通常是个坏主意。请为每个项目使用virtualenv。

首先在Mac上全局安装virtualenv:

$ [sudo] pip install virtualenv

然后使用virtualenv命令创建一个新的Python可执行文件(副本):

$ cd your/prefred/folder
$ virtualenv your_project

激活 virtualenv

$ source your_project/bin/activate

您的virtualenv已创建并激活(提示更改为显示激活)。您可以在其中安装任何东西:

$ pip install -U scikit-image


 类似资料:
  • 校验者: @小瑶 翻译者: @片刻 Note 如果你想为这个项目做出贡献,建议你 安装最新的开发版本 . 安装最新版本 Scikit-learn 要求: Python (>= 2.7 or >= 3.3), NumPy (>= 1.8.2), SciPy (>= 0.13.3). 如果你已经有一个安全的 numpy 和 scipy,安装 scikit-learn 最简单的方法是使用 pip pip

  • 问题内容: 在外壳程序脚本中,我正在检查是否已安装此软件包,如果未安装,请先安装它。因此,使用shell脚本: 但它在行停止了shell脚本 在Linux终端中尝试以这种方式查看: 没有任何东西以为已安装。 还有没有其他方法可以在shell脚本中验证此软件包的安装,如果未安装,请同时安装。 问题答案: 是Python语法,因此无法在Shell脚本中使用。 为了测试的版本和,你可以写一个 Pytho

  • 我试图运行的python2.7和我不断得到同样的错误。我按照http://bickson.blogspot.com/2011/02/installing-blaslapackitpp-on-amaon-ec2.html的说明安装了LAPACK/BLAS,我认为应该已经解决了这个问题。没有任何帮助。我做错了什么?我对bash不太熟悉。

  • 如何安装和使用DirectX 返回上级 1、编译库和运行库 2、安装 VC++ 5.0 3、安装 DirectX5.0 的 SDK 4、DirectX 5.0 的文件说明 5、卸载 DirectX 1、编译库和运行库 为了能够使用MS VC++5.0进行DirectX编程,必须拥有一套DirectX的SDK(软件开发工具包),它包括了编译DirectX应用程序所需要的编译库文件(*.lib)、头文

  • 问题内容: 我找不到在Mac上安装MySQLi的说明。需要明确的是,MySQL是最新的,并且我正在运行PHP5。如何安装它?我什至可以从哪里得到它?谢谢你的帮助。我将给回答这个问题的人一个投票和一个复选标记! 问题答案: MySQLi是PHP的一部分。应该有一个可用的php- mysqli类型程序包,或者您可以获取PHP源代码并重新编译启用mysqli的程序。您可能已经安装了它,但是它作为一个模块

  • 我想为一个项目安装PyYAML,我能找到的只是http://pyyaml.org/站点的链接。我下载了python 3.5 exe文件,上面写着“需要Python 3.5版本,在注册表中找不到” 我搜索了其他安装方法。我在堆栈溢出上找到的唯一一个是“$pip install pyyaml”。它没有说明应该在哪里使用命令来安装包。