Error installing coremltools

雨燕双飞 提交于 2019-11-30 15:32:50
Alexander Sosnovshchenko

You're trying to change your system Python. That's why it says [Errno 1] Operation not permitted. To avoid messing up system libraries, you need to create separate Python virtual environment. This is how to do it:

  1. Upgrade pip:

    pip install --upgrade pip
    
  2. Install virtual environment.

    pip install –U virtualenv
    
  3. Create new virtual environment:

    cd ~
    virtualenv coreml
    

    This creates folder ~/coreml/ and a local copy of Python, pip and all other stuff you need for work.

  4. To activate virtual environment:

    source coreml/bin/activate
    

    Now you see in your terminal (coreml) prepends your user name.

  5. In newly created virtual environment:

    pip install -U coremltools
    
  6. Check that library was installed successfully:

    python
    import coremltools
    

    There should not be any error messages.

  7. To deactivate virtual environment run:

    deactivate
    

Note: Never run pip with sudo. If you need sudo, 99% chance you're doing something wrong.

Is their a specific reason, that you downloaded the .whl-file?

You cloud try to install directly from PyPI with:

pip install -U coremltools

This is the recommended way as shown in the link, you already posted.

Note: I know this is not a very sophisticated answer, but I do not have enough reputation to just comment.

pip install git+https://github.com/apple/coremltools

i installed it on windows it works:)

gaurav_iphone

For COREML : Following steps needed :

  1. Check if python available - python --version
  2. Install Java runtime from Oracle website for Mac 64 bit
  3. Then sudo python -m ensurepip. to install PIP .
  4. Install coremltools for Mac - pip3 install -U pip setuptools

UPDATE: Python 3 If you install python 3, pip will be installed automatically.

brew install python3
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!