简体   繁体   English

如何在 Ubuntu 服务器 18.04 中安装 tensorflow 1.15.0

[英]How to install tensorflow 1.15.0 in Ubuntu server 18.04

I am using Azure to create an Ubuntu server 18.04.我正在使用 Azure 创建一个 Ubuntu 服务器 18.04。 The python3 default version in this VM is 3.6.9 .此 VM 中的 python3 默认版本是3.6.9 I tried to install python3-pip, then install Tensorflow version 1.15.0 by command: sudo pip3 install Tensorflow==1.15.0 .我尝试安装 python3-pip,然后通过命令安装 Tensorflow 1.15.0 版: sudo pip3 install Tensorflow==1.15.0

However I got this error: No matching distribution found for tensorflow==1.15.0但是我收到了这个错误: No matching distribution found for tensorflow==1.15.0

I really don't know how to fix it.我真的不知道如何修复它。 On my Windows PC, I got the same error while using python3.7, then I change to use python3.6.5 and everythings is fine.在我的 Windows PC 上,我在使用 python3.7 时遇到了同样的错误,然后我改为使用 python3.6.5,一切都很好。 So that I think maybe I should try to install python 3.6.5 on Ubuntu VM.所以我想也许我应该尝试在 Ubuntu VM 上安装 python 3.6.5。 But again, this time, I can't install correctly python 3.6.5 on my Ubuntu server.但是,这一次,我无法在我的 Ubuntu 服务器上正确安装 python 3.6.5。

Can you please help me to fix it.你能帮我修一下吗。 I am just a newbie and honestly, I am not really good with Ubuntu.我只是一个新手,老实说,我对 Ubuntu 并不擅长。

Thank you so much.非常感谢。

I had the same issue.我遇到过同样的问题。 A simple upgrade of pip to the latest version by:通过以下方式将 pip 简单升级到最新版本:

sudo -H pip3 install --upgrade pip
sudo -H pip2 install --upgrade pip

solved the problem for me.为我解决了这个问题。 Checkout https://askubuntu.com/questions/712339/how-to-upgrade-pip-to-latest for details how to upgrade pip.查看https://askubuntu.com/questions/712339/how-to-upgrade-pip-to-latest了解如何升级 pip 的详细信息。

After checking it seems the pip3 version shipped with Ubuntu defaults to pip 9.0.1.检查后似乎 Ubuntu 附带的 pip3 版本默认为 pip 9.0.1。 However, this version seems to supports only up to Tensorflow 1.14.但是,这个版本似乎最多只支持 Tensorflow 1.14。

I would also strongly suggest to use virtual environments like Anaconda in order not to mess up your system python.我还强烈建议使用像 Anaconda 这样的虚拟环境,以免弄乱你的系统 python。 Eg: https://docs.anaconda.com/anaconda/install/linux/例如: https : //docs.anaconda.com/anaconda/install/linux/

These are the list of files for TensorFlow 1.15这些是 TensorFlow 1.15 的文件列表

This command would work:此命令将起作用:

pip3 install tensorflow==1.15.0

I do see the manylinux wheel file for Ubuntu.我确实看到了 Ubuntu 的 manylinux 轮文件。

What CPU model and pip version are you using?您使用的是什么 CPU 型号和 pip 版本?

Debugging:调试:

pip3 -v install tensorflow==1.15.0 | grep Found | more

Can help you see which platform and tags pip3 is trying to find in wheel files.可以帮助您查看pip3试图在轮文件中找到哪些平台和标签。

In the past I also have seen issue with pip default version (9.0.1), make sure you are running a recent version (eg pip-20.0.2):过去我也看到过 pip 默认版本 (9.0.1) 的问题,请确保您运行的是最新版本(例如 pip-20.0.2):

apt install python3-pip  && pip3 install --upgrade pip

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

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