安装 turicreate 时出现 tensorflow 错误?

tensorflow error when installing turicreate?

当我安装 turicreate 包时,出现以下错误:

Collecting tensorflow>=2.0.0 (from turicreate)
  Could not find a version that satisfies the requirement tensorflow>=2.0.0 (from turicreate) (from versions: 0.12.1, 1.0.0, 1.0.1, 1.1.0rc0, 1.1.0rc1, 1.1.0rc2, 1.1.0, 1.2.0rc0, 1.2.0rc1, 1.2.0rc2, 1.2.0, 1.2.1, 1.3.0rc0, 1.3.0rc1, 1.3.0rc2, 1.3.0, 1.4.0rc0, 1.4.0rc1, 1.4.0, 1.4.1, 1.5.0rc0, 1.5.0rc1, 1.5.0, 1.5.1, 1.6.0rc0, 1.6.0rc1, 1.6.0, 1.7.0rc0, 1.7.0rc1, 1.7.0, 1.7.1, 1.8.0rc0, 1.8.0rc1, 1.8.0, 1.9.0rc0, 1.9.0rc1, 1.9.0rc2, 1.9.0, 1.10.0rc0, 1.10.0rc1, 1.10.0, 1.10.1, 1.11.0rc0, 1.11.0rc1, 1.11.0rc2, 1.11.0, 1.12.0rc0, 1.12.0rc1, 1.12.0rc2, 1.12.0, 1.12.2, 1.12.3, 1.13.0rc0, 1.13.0rc1, 1.13.0rc2, 1.13.1, 1.13.2, 1.14.0rc0, 1.14.0rc1, 1.14.0, 2.0.0a0, 2.0.0b0, 2.0.0b1)
No matching distribution found for tensorflow>=2.0.0 (from turicreate)

我在安装tensorflow 2.0.0的时候也遇到了同样的情况

我设法安装了 tensorflow2,并使用 pip3 install tensorflow==2.0.0a0 修改了版本(在“2.0.0”之后添加 'a0'、'b0'、'b1')。但是,即使安装了 tensorflow2.0.0a0,我仍然无法通过 turicreate 的安装,结果与上面显示的 'tensorflow error' 相同。 我正在使用 python 3.6,numpy 1.16.5.

你能帮帮我吗?

当我尝试在加载了一些数据科学库的 Jupyter Docker 图像上安装 turicreate 时,我遇到了同样的问题:

  • 图片:jupyter/scipy-notebook
  • 包:pandas、numexpr、matplotlib、scipy、seaborn、scikit-learn、scikit-image、sympy、cython、patsy、statsmodel、cloudpickle、dill、numba、bokeh、sqlalchemy 、hdf5、vincent、beautifulsoup、protobuf 和 xlrd 包
  • 错误信息:

    Could not find a version that satisfies the requirement tensorflow>=2.0.0 (from turicreate) (from versions: 0.12.1, 1.0.0, 1.0.1, 1.1.0rc0, 1.1.0rc1, 1.1.0rc2, 1.1.0, 1.2.0rc0, 1.2.0rc1, 1.2.0rc2, 1.2.0, 1.2.1, 1.3.0rc0, 1.3.0rc1, 1.3.0rc2, 1.3.0, 1.4.0rc0, 1.4.0rc1, 1.4.0, 1.4.1, 1.5.0rc0, 1.5.0rc1, 1.5.0, 1.5.1, 1.6.0rc0, 1.6.0rc1, 1.6.0, 1.7.0rc0, 1.7.0rc1, 1.7.0, 1.7.1, 1.8.0rc0, 1.8.0rc1, 1.8.0, 1.9.0rc0, 1.9.0rc1, 1.9.0rc2, 1.9.0, 1.10.0rc0, 1.10.0rc1, 1.10.0, 1.10.1, 1.11.0rc0, 1.11.0rc1, 1.11.0rc2, 1.11.0, 1.12.0rc0, 1.12.0rc1, 1.12.0rc2, 1.12.0, 1.12.2, 1.12.3, 1.13.0rc0, 1.13.0rc1, 1.13.0rc2, 1.13.1, 1.13.2, 1.14.0rc0, 1.14.0rc1, 1.14.0, 2.0.0a0, 2.0.0b0, 2.0.0b1)
    No matching distribution found for tensorflow>=2.0.0 (from turicreate)
    

然而,当我拍摄基本的(剥离的)Jupyter 图像时,它起作用了:

  • 图片:jupyter/base-notebook
  • 软件包:git、emacs、jed、nano、tzdata 和 unzip

turicreate 的安装说明:

from __future__ import print_function
import sys

!{sys.executable} -m pip install turicreate

输出:

Successfully installed absl-py-0.9.0 astor-0.8.1 cachetools-4.0.0 coremltools-3.1 gast-0.2.2 google-auth-1.10.0 google-auth-oauthlib-0.4.1 google-pasta-0.1.8 grpcio-1.26.0 h5py-2.10.0 keras-applications-1.0.8 keras-preprocessing-1.1.0 llvmlite-0.30.0 markdown-3.1.1 numba-0.46.0 numpy-1.16.4 opt-einsum-3.1.0 pandas-0.25.3 pillow-6.2.1 prettytable-0.7.2 protobuf-3.11.2 pyasn1-0.4.8 pyasn1-modules-0.2.7 pytz-2019.3 requests-oauthlib-1.3.0 resampy-0.2.1 rsa-4.0 scipy-1.4.1 tensorboard-2.0.2 tensorflow-2.0.0 tensorflow-estimator-2.0.1 termcolor-1.1.0 turicreate-6.0 werkzeug-0.16.0 wrapt-1.11.2

所以,我猜问题是你安装在环境中的一些库与 turicreate 冲突。也许您应该尝试使用上面提到的 Docker 图像或尝试创建一个虚拟环境以便您独立工作(未测试)。

关于不同 Docker 图像的信息:

https://jupyter-docker-stacks.readthedocs.io/en/latest/using/selecting.html#jupyter-scipy-notebook

Turicreate 安装说明,他们在虚拟环境中发表评论:

https://github.com/apple/turicreate#installation

首先,尝试使用最新版本的pip pip3 install -U pip,通常,它比以前的问题更少。

否则,如果上述失败,您可以尝试运行 pip3 install --no-deps turicreate 来克服神秘的错误。 您需要手动安装依赖项。全部 110 个。 您可以使用以下内容生成它们的列表:

import os;
s = os.popen('pip3 freeze turicreate').read()
for q in [x.split('==')[0] for x in s.split('\n')]:
  os.system('echo {} >> t.tmp'.format(q)

然后可以用pip install -r t.tmpfor x in $(cat t.tmp); do pip3 install $x; done安装 我不确定与 tensorflow 或任何其他失败包相关的功能如何受此影响,但我已经设法让简单的 sframes 使用这种方法。 然后我升级了 pip 和所有无法正常安装的库。

尝试升级 pip。 Tensorflow 2.0 需要安装更新版本的 pip。 就个人而言,这很有效,

  1. 升级点数
  2. 已安装 tf2.0
  3. 已安装 turicreate。

升级点数

# On Linux or macOS:
pip3 install -U pip

# On Windows:
python -m pip3 install -U pip

安装 turicreate

pip3 install turicreate

这将解决您的问题