您好最近几天,我试图运行一个脚本来创建用于机器学习的Modal。但是我无法在Pycharm编辑器中安装Turicreate软件包。

我按照以下步骤运行脚本。


在此链接中下载Python 3.7:
https://www.python.org/downloads/
下载Pycharm编辑器(https://www.jetbrains.com/pycharm/


之后,我将项目解释器设置为最新的python3.7,并尝试安装turicreate,但始终出现错误。



收集turicreate
  使用缓存的https://files.pythonhosted.org/packages/db/54/167837569bcb816b3fe68f003f18d07ab9d5ac31b2b12b8f9b07b1ccc7a4/turicreate-4.2.tar.gz
用于收集包裹的建筑轮子:turicreate
  为turicreate运行setup.py bdist_wheel:已启动
  为turicreate运行setup.py bdist_wheel:状态为“错误”
  从命令/ Users / tikam / MLTikam1 / venv / bin / python -u -c“ import setuptools,tokenize; file ='/ private / var / folders / rh / qx_0gvzn6kzbqjvvbbh66t080000gn / T / pycharm-packaging1 / turicreate / setup的完整输出。 py'; f = getattr(tokenize,'open',open)(文件);代码= f.read()。replace('\ r \ n','\ n'); f.close(); exec( compile(code,file,'exec'))“ bdist_wheel -d / private / var / folders / rh / qx_0gvzn6kzbqjvvbbh66t080000gn / T / pip-wheel-qez5g2v_ --python-tag cp37:
  运行bdist_wheel
  运行构建
  安装到build / bdist.macosx-10.9-x86_64 / wheel
  运行安装

      ==================================================================================
      ERROR

      If you see this message, pip install did not find an available binary package
      for your system. Supported platforms are:

      * Linux x86_64 (including WSL on Windows 10).
      * macOS 10.12+ x86_64.
      * Python 2.7, 3.5, or 3.6.

      Other possible causes of this error are:

      * Outdated pip version (try `pip install -U pip`).

      ==================================================================================




运行setup.py clean进行turicreate
无法建立turicreate
安装收集的软件包:turicreate
  为turicreate运行setup.py install:已启动
    为turicreate运行setup.py install:状态为“错误”
    从命令/ Users / tikam / MLTikam1 / venv / bin / python -u -c“ import setuptools,tokenize; file ='/ private / var / folders / rh / qx_0gvzn6kzbqjvvbbh66t080000gn / T / pycharm-packaging1 / turicreate / setup的完整输出。 py'; f = getattr(tokenize,'open',open)(文件);代码= f.read()。replace('\ r \ n','\ n'); f.close(); exec( compile(code,file,'exec'))“ install --record /private/var/folders/rh/qx_0gvzn6kzbqjvvbbh66t080000gn/T/pip-record-kjt0p8as/install-record.txt --single-version-externally- -compile --install-headers /Users/tikam/MLTikam1/venv/include/site/python3.7/turicreate:
    运行安装

        ==================================================================================
        ERROR

        If you see this message, pip install did not find an available binary package
        for your system. Supported platforms are:

        * Linux x86_64 (including WSL on Windows 10).
        * macOS 10.12+ x86_64.
        * Python 2.7, 3.5, or 3.6.

        Other possible causes of this error are:

        * Outdated pip version (try `pip install -U pip`).

        ==================================================================================



----------------------------------------


turicreate的建筑轮子失败
命令“ / Users / tikam / MLTikam1 / venv / bin / python -u -c”导入设置工具,标记化;文件='/ private / var / folders / rh / qx_0gvzn6kzbqjvvbbh66t080000gn / T / pycharm-packaging1 / turicreate / setup.py' ; f = getattr(tokenize,'open',open)(file); code = f.read()。replace('\ r \ n','\ n'); f.close(); exec(compile(代码,文件,'exec'))“安装--record /private/var/folders/rh/qx_0gvzn6kzbqjvvbbh66t080000gn/T/pip-record-kjt0p8as/install-record.txt --single-version-externally-managed --compile --install-headers /Users/tikam/MLTikam1/venv/include/site/python3.7/turicreate“失败,错误代码为/ private / var / folders / rh / qx_0gvzn6kzbqjvvbbh66t080000gn / T / pycharm-packaging1 / turicreate /



请建议我需要执行什么步骤来安装turicreat软件包。

我要运行此脚本:

剧本**************

import turicreate as tc

data = tc.SFrame('photoLabel.sframe')
model = tc.image_classifier.create(data, target='photoLabel')
predictions = model.predict(data)
model.export_coreml('MyClassifier.mlmodel')

最佳答案

目前不支持Python 3.7。因此,您必须返回到先前的Python版本。

brew unlink python
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/f2a764ef944b1080be64bd88dca9a1d80130c558/Formula/python.rb


资料来源:https://github.com/apple/turicreate/issues/788

或者,您可以创建虚拟环境以在其上运行turicreate

从官方网站下载Python3.6 tgz文件(例如Python-3.6.6.tgz)

Unpack it with tar -xvzf Python-3.6.6.tgz
cd Python-3.6.6
run ./configure
run make altinstall to install it


(在此处Difference in details between "make install" and "make altinstall"上安装vs altinstall的说明)
    通常,您会在/usr/local/bin下找到新的python安装。现在,您可以使用以下命令创建一个新的virtualenv来指定python版本:
virtualenv --python=python3.6 env3.6
运行命令source env3.6/source/bin/activate进入virtualenv。
使用经典的pip install turicreate安装turicreate

来源:https://github.com/tensorflow/tensorflow/issues/17022

09-07 08:55