【问题标题】:Error while installing core ML tools [duplicate]安装核心 ML 工具时出错 [重复]
【发布时间】:2017-12-15 08:13:39
【问题描述】:

我正在尝试将 caffe 模型转换为核心 ML 模型。 请在运行pip install coremltools

时发现错误
Collecting coremltools
    Using cached coremltools-0.4.0-py2.7-none-any.whl
    Requirement already satisfied: numpy>=1.6.2 in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from coremltools)
    Collecting protobuf>=3.1.0 (from coremltools)
      Using cached protobuf-3.3.0.tar.gz
    Collecting six>=1.9 (from protobuf>=3.1.0->coremltools)
      Using cached six-1.10.0-py2.py3-none-any.whl
    Requirement already satisfied: setuptools in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from protobuf>=3.1.0->coremltools)
    Installing collected packages: six, protobuf, coremltools
      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: '/var/folders/5z/5hfw98ks677_r5rqm498kq1c0000gn/T/pip-DMhcCb-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'

我是机器学习的新手。请提出解决方案

【问题讨论】:

    标签: python ios coreml


    【解决方案1】:

    正如错误所说 - 不允许操作。我是 Linux 而不是 Mac 用户 - 但这可能是因为您尝试在没有 root 权限的情况下执行此操作。

    你可以试试sudo pip install coremltools。但一般来说,在系统范围内安装开发库并不是最佳做法。

    您绝对应该使用 virtualenv

    【讨论】:

    • 谢谢。我尝试了虚拟环境的方法,显示coremL安装成功。成功安装coremltools-0.4.0 numpy-1.13.1 protobuf-3.3.0 六-1.10.0。但是,当我尝试导入核心 ml 工具时,它再次显示为 import core ml tools ImportError: No module named core ml tools。现在 pip install coremltools 告诉:要求已经满足:coremltools in /usr/local/lib/python2.7/site-packages
    • sudo pip install -U coremltools --ignore-installed
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-08-05
    • 2018-09-11
    • 2017-05-24
    • 2023-03-20
    • 1970-01-01
    • 2014-02-09
    • 2018-07-20
    相关资源
    最近更新 更多