Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/docker/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 2.7 `pip`由于';永久移动';从返回的错误`https://pypi.python.org/simple/`_Python 2.7_Docker_Pip_Ubuntu 14.04_Pypi - Fatal编程技术网

Python 2.7 `pip`由于';永久移动';从返回的错误`https://pypi.python.org/simple/`

Python 2.7 `pip`由于';永久移动';从返回的错误`https://pypi.python.org/simple/`,python-2.7,docker,pip,ubuntu-14.04,pypi,Python 2.7,Docker,Pip,Ubuntu 14.04,Pypi,我想在ubuntu14.04docker容器中安装pip软件包,但由于从https://pypi.python.org/simple/。奇怪的是,运行ubuntu14.04和相同版本的python和pip的主机成功安装了pip软件包 Docker版本: $ docker --version Docker version 1.12.6-cs13, build 0ee24d4 Dockerfile:(注意:为了进行测试,我特意将其输入容器中) 在主机上: $ uname -a Linux duon

我想在
ubuntu14.04
docker
容器中安装
pip
软件包,但由于
https://pypi.python.org/simple/
。奇怪的是,运行
ubuntu14.04
和相同版本的
python
pip
的主机成功安装了
pip
软件包

Docker版本:

$ docker --version
Docker version 1.12.6-cs13, build 0ee24d4
Dockerfile:(注意:为了进行测试,我特意将其输入容器中)

在主机上:

$ uname -a
Linux duong2179-ubuntu 4.4.0-31-generic #50~14.04.1-Ubuntu SMP Wed Jul 13 01:07:32 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
$ python --version
Python 2.7.6
$ pip --version
pip 1.5.4 from /usr/lib/python2.7/dist-packages (python 2.7)
$ sudo pip install simplejson==3.3.1
Downloading/unpacking simplejson==3.3.1
...
Successfully installed simplejson
集装箱内:

# uname -a
Linux duong2179-ubuntu 4.4.0-31-generic #50~14.04.1-Ubuntu SMP Wed Jul 13 01:07:32 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
# python --version
Python 2.7.6
# pip --version
pip 1.5.4 from /usr/lib/python2.7/dist-packages (python 2.7)
# pip install simplejson==3.3.1
Downloading/unpacking simplejson==3.3.1
  Cannot fetch index base URL https://pypi.python.org/simple/
  Could not find any downloads that satisfy the requirement simplejson==3.3.1
从主机do
curl
-ing
https://pypi.python.org/simple/

$ curl https://pypi.python.org/simple/
<html><head><title>301 Moved Permanently</title></head><body><center><h1>301 Moved Permanently</h1></center></body></html>
$curlhttps://pypi.python.org/simple/
301永久移动301永久移动

这是
pip 1.5.4的一个已知问题

在使用
pip
之前,在
Dockerfile
中添加以下行:

RUN python -m pip install --upgrade pip
天真的问题(因为我对Docker不太熟悉):你能从你的容器内部访问互联网吗?你能做个卷发或类似的动作吗?
RUN python -m pip install --upgrade pip