33

我收到安装错误,因为 pip 找不到 setup.py。

sudo pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl

我收到此错误消息。

Downloading/unpacking https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl
Downloading tensorflow-0.5.0-cp27-none-linux_x86_64.whl (10.9Mb): 10.9Mb downloaded
Running setup.py egg_info for package from https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl
Traceback (most recent call last):
File "<string>", line 14, in <module>
IOError: [Errno 2] No such file or directory: '/tmp/pip-GdGgbz-build/setup.py'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):

File "<string>", line 14, in <module>

IOError: [Errno 2] No such file or directory: '/tmp/pip-GdGgbz-build/setup.py'

谁能告诉我如何解决这个问题?

谢谢。

4

5 回答 5

17

来自https://github.com/tensorflow/tensorflow/issues/56

要键入的命令是“pip install --upgrade pip”,这应该在他们告诉用户 “source bin/activate”之后立即添加到说明中

于 2015-11-12T19:56:37.123 回答
3

尝试使用 pip install 升级 protobuf:

sudo pip install --upgrade protobuf 
sudo pip install --upgrade https://storage.googleapis.com/tensorflow/mac/protobuf-3.0.0b2.post2-cp27-none-any.whl

为我工作。该文档为各种安装问题提供了许多解决方案。

于 2016-05-19T12:18:00.320 回答
2

TensorFlow 需要 python -V 2.7。因为,很多机器使用稳定的 2.6 版本的 python 进行系统构建,我建议并行/替代安装 python 2.7。然后你可以用 2.7 版本的 python 解释器安装 pip。请看下面:

#sudo wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
#sudo python2.7 ez_setup.py
#easy_install-2.7 pip
#sudo pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl
于 2015-11-23T00:19:45.283 回答
0

您运行 sdist 的文件名必须命名为setup.py 运行文件,因为这样setup_something.py会失败

于 2018-04-23T20:13:44.707 回答
0

我正在使用 ubuntu 12.04 64 位。我通过以下方式解决了这个问题:

mkdir -p ~/code/download/lib/tensorflow/
cd ~/code/download/lib/tensorflow/
virtualenv --system-site-packages tensorflow_for_ubuntu12_04_64bit_python2_7
source tensorflow_for_ubuntu12_04_64bit_python2_7/bin/activate
cd tensorflow_for_ubuntu12_04_64bit_python2_7
pip install --upgrade tensorflow
于 2017-07-29T00:37:14.497 回答