简体   繁体   English

安装 tensorflow 时出现问题

[英]issue in install tensorflow

when I use pip install tensorflow command that error appear:- ''' ERROR: pip's dependency resolver does not currently take into account all the packages that are installed.当我使用 pip 安装 tensorflow 命令时出现错误:-'''错误:pip 的依赖解析器当前未考虑所有已安装的软件包。 This behaviour is the source of the following dependency conflicts.此行为是以下依赖冲突的根源。 tf-nightly 2.6.0.dev20210601 requires gast==0.4.0, but you have gast 0.3.3 which is incompatible. tf-nightly 2.6.0.dev20210601 需要 gast==0.4.0,但你有 gast 0.3.3,这是不兼容的。 tf-nightly 2.6.0.dev20210601 requires h5py~=3.1.0, but you have h5py 2.10.0 which is incompatible. tf-nightly 2.6.0.dev20210601 需要 h5py~=3.1.0,但你有不兼容的 h5py 2.10.0。 tf-nightly 2.6.0.dev20210601 requires numpy~=1.19.2, but you have numpy 1.18.5 which is incompatible.''' tf-nightly 2.6.0.dev20210601 需要 numpy~=1.19.2,但你有 numpy 1.18.5 这是不兼容的。'''

Looks like you are trying to install Tensorflow and tf-nightly on the same environment.看起来您正在尝试在同一环境中安装 Tensorflow 和 tf-nightly 。 Since Tensorflow and tf-nightly uses same code, you should never install both in same environment.由于 Tensorflow 和 tf-nightly 使用相同的代码,因此您永远不应该将两者安装在相同的环境中。 Latest version overrides the most of the packages, thats how pip works.最新版本覆盖了大多数软件包,这就是pip的工作方式。 It recommended to use virtual environment each tensorflow version.建议使用每个 tensorflow 版本的虚拟环境。
Tf-nightly require gast==0.4.0 and numpy==1.19.2. tf-nightly 需要 gast==0.4.0 和 numpy==1.19.2。

Follow the below steps请按照以下步骤操作

python -m tf_nightly --system-site-packages .\venv
.\venv\Scripts\activate
pip install --upgrade pip
pip install tf-nightly

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM