Python中文
首页
教程
问答
标签
搜索
登录
注册
在d中安装pip
回答此问题可获得
20
贡献值,回答如果被采纳可获得
50
分。
<p>我无法在Docker中安装pip。</p> <p>这是我的档案:</p> <pre><code>FROM ubuntu:14.04 # Install dependencies RUN apt-get update -y RUN apt-get install -y git curl apache2 php5 libapache2-mod-php5 php5-mcrypt php5-mysql python3.4 python-pip </code></pre> <p>建造时,我得到:</p> <pre><code>Sending build context to Docker daemon 109.6 kB Step 1 : FROM ubuntu:14.04 ---> b549a9959a66 Step 2 : RUN apt-get update -y ---> Using cache ---> 84577471562c Step 3 : RUN apt-get install -y git curl apache2 php5 libapache2-mod-php5 php5-mcrypt php5-mysql python3.4 python-pip ---> Running in 49252a6d0eb1 Reading package lists... Building dependency tree... Reading state information... python3.4 is already the newest version. The following extra packages will be installed: apache2-bin apache2-data binutils build-essential ca-certificates cpp cpp-4.8 dpkg-dev fakeroot g++ g++-4.8 gcc gcc-4.8 git-man krb5-locales libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libasan0 libasn1-8-heimdal libatomic1 libc-dev-bin libc6-dev libcloog-isl4 libcurl3 libcurl3-gnutls libdpkg-perl libedit2 liberror-perl libfakeroot libfile-fcntllock-perl libgcc-4.8-dev libgmp10 libgomp1 libgssapi-krb5-2 libgssapi3-heimdal libhcrypto4-heimdal libheimbase1-heimdal libheimntlm0-heimdal libhx509-5-heimdal libidn11 libisl10 libitm1 libk5crypto3 libkeyutils1 libkrb5-26-heimdal libkrb5-3 libkrb5support0 libldap-2.4-2 libmcrypt4 libmpc3 libmpfr4 libmysqlclient18 libpython-stdlib libpython2.7-minimal libpython2.7-stdlib libquadmath0 libroken18-heimdal librtmp0 libsasl2-2 libsasl2-modules libsasl2-modules-db libstdc++-4.8-dev libtimedate-perl libtsan0 libwind0-heimdal libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxext6 libxml2 libxmuu1 linux-libc-dev lsof make manpages manpages-dev mysql-common openssh-client openssl patch php5-cli php5-common php5-json php5-readline psmisc python python-chardet python-chardet-whl python-colorama python-colorama-whl python-distlib python-distlib-whl python-html5lib python-html5lib-whl python-minimal python-pip-whl python-pkg-resources python-requests python-requests-whl python-setuptools python-setuptools-whl python-six python-six-whl python-urllib3 python-urllib3-whl python-wheel python2.7 python2.7-minimal python3-pkg-resources rsync sgml-base ssl-cert xauth xml-core xz-utils Suggested packages: www-browser apache2-doc apache2-suexec-pristine apache2-suexec-custom ufw apache2-utils binutils-doc cpp-doc gcc-4.8-locales debian-keyring g++-multilib g++-4.8-multilib gcc-4.8-doc libstdc++6-4.8-dbg gcc-multilib autoconf automake1.9 libtool flex bison gdb gcc-doc gcc-4.8-multilib libgcc1-dbg libgomp1-dbg libitm1-dbg libatomic1-dbg libasan0-dbg libtsan0-dbg libquadmath0-dbg gettext-base git-daemon-run git-daemon-sysvinit git-doc git-el git-email git-gui gitk gitweb git-arch git-bzr git-cvs git-mediawiki git-svn php-pear glibc-doc krb5-doc krb5-user libmcrypt-dev mcrypt libsasl2-modules-otp libsasl2-modules-ldap libsasl2-modules-sql libsasl2-modules-gssapi-mit libsasl2-modules-gssapi-heimdal libstdc++-4.8-doc make-doc man-browser ssh-askpass libpam-ssh keychain monkeysphere ed diffutils-doc php5-user-cache python-doc python-tk python-genshi python-lxml python-distribute python-distribute-doc python2.7-doc binfmt-support python3-setuptools openssh-server sgml-base-doc openssl-blacklist debhelper Recommended packages: ssh-client python-dev-all The following NEW packages will be installed: apache2 apache2-bin apache2-data binutils build-essential ca-certificates cpp cpp-4.8 curl dpkg-dev fakeroot g++ g++-4.8 gcc gcc-4.8 git git-man krb5-locales libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libapache2-mod-php5 libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libasan0 libasn1-8-heimdal libatomic1 libc-dev-bin libc6-dev libcloog-isl4 libcurl3 libcurl3-gnutls libdpkg-perl libedit2 liberror-perl libfakeroot libfile-fcntllock-perl libgcc-4.8-dev libgmp10 libgomp1 libgssapi-krb5-2 libgssapi3-heimdal libhcrypto4-heimdal libheimbase1-heimdal libheimntlm0-heimdal libhx509-5-heimdal libidn11 libisl10 libitm1 libk5crypto3 libkeyutils1 libkrb5-26-heimdal libkrb5-3 libkrb5support0 libldap-2.4-2 libmcrypt4 libmpc3 libmpfr4 libmysqlclient18 libpython-stdlib libpython2.7-minimal libpython2.7-stdlib libquadmath0 libroken18-heimdal librtmp0 libsasl2-2 libsasl2-modules libsasl2-modules-db libstdc++-4.8-dev libtimedate-perl libtsan0 libwind0-heimdal libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxext6 libxml2 libxmuu1 linux-libc-dev lsof make manpages manpages-dev mysql-common openssh-client openssl patch php5 php5-cli php5-common php5-json php5-mcrypt php5-mysql php5-readline psmisc python python-chardet python-chardet-whl python-colorama python-colorama-whl python-distlib python-distlib-whl python-html5lib python-html5lib-whl python-minimal python-pip python-pip-whl python-pkg-resources python-requests python-requests-whl python-setuptools python-setuptools-whl python-six python-six-whl python-urllib3 python-urllib3-whl python-wheel python2.7 python2.7-minimal python3-pkg-resources rsync sgml-base ssl-cert xauth xml-core xz-utils 0 upgraded, 130 newly installed, 0 to remove and 4 not upgraded. Need to get 61.9 MB of archives. After this operation, 213 MB of additional disk space will be used. Err http://archive.ubuntu.com/ubuntu/ trusty-updates/main libroken18-heimdal amd64 1.6~git20131207+dfsg-1ubuntu1.1 Could not resolve 'archive.ubuntu.com' Err http://archive.ubuntu.com/ubuntu/ trusty-updates/main libasn1-8-heimdal amd64 1.6~git20131207+dfsg-1ubuntu1.1 Could not resolve 'archive.ubuntu.com' . . . Err http://archive.ubuntu.com/ubuntu/ trusty-security/main python2.7 amd64 2.7.6-8ubuntu0.2 Could not resolve 'archive.ubuntu.com' E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/h/heimdal/libroken18-heimdal_1.6~git20131207+dfsg-1ubuntu1.1_amd64.deb Could not resolve 'archive.ubuntu.com' E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/h/heimdal/libasn1-8-heimdal_1.6~git20131207+dfsg-1ubuntu1.1_amd64.deb Could not resolve 'archive.ubuntu.com' E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/k/krb5/libkrb5support0_1.12+dfsg-2ubuntu5.2_amd64.deb Could not resolve 'archive.ubuntu.com' E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/s/ssl-cert/ssl-cert_1.0.33_all.deb Could not resolve 'archive.ubuntu.com' E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing? The command '/bin/sh -c apt-get install -y git curl apache2 php5 libapache2-mod-php5 php5-mcrypt php5-mysql python3.4 python-pip' returned a non-zero code: 100 </code></pre> <p>读过<a href="https://stackoverflow.com/a/34145676/1040915">this answer</a>之后,我尝试添加<code>RUN "sh" "-c" "echo nameserver 8.8.8.8 >> /etc/resolv.conf"</code>行-这次的错误是:</p> <pre><code>... ... Reading state information... E: Unable to locate package php5-mcrypt E: Unable to locate package python-pip The command '/bin/sh -c apt-get install -y git curl apache2 php5 libapache2-mod-php5 php5-mcrypt php5-mysql python3.4 python-pip' returned a non-zero code: 100 </code></pre> <p>我做错什么了?我看到一些人说我应该尝试一个不同版本的Ubuntu,但是切换到13.1并没有改变什么。</p>
0 条评论
分类:
Python问答
请先
登录
后评论
默认排序
时间排序
1 个回答
匿名
1天前
擅长:python、mysql、java
<p>另一种方法是使用Alpine Linux容器,例如<code>python:2.7-alpine</code>。它们提供开箱即用的服务(而且占用空间更小,构建速度更快等)。</p>
请先
登录
后评论
针对此问题:
更多的回答
关注
89
关注
收藏
1
收藏,
216
浏览
网友 提问于 2天前
相关Python问题
Django:。是不是“超级用户”字段不起作用
7 回答
Django:'DeleteQuery'对象没有属性'add'
3 回答
Django:'ModelForm'对象没有属性
8 回答
Django:'python manage.py runserver'返回'TypeError:'WindowsPath'类型的对象没有len()
8 回答
Django:'Python管理.pysyncdb'不创建我的架构表
1 回答
Django:'Python管理.py迁移“耗时数小时(和其他奇怪的行为)
1 回答
Django:'readonly'属性在我的ModelForm上不起作用
4 回答
Django:'RegisterEmployeeView'对象没有属性'object'
4 回答
Django:'str'对象没有属性'get'
2 回答
Django:'创建' 不能被指定为Order模型表单中的值,因为它是一个不可编辑的字段
2 回答
Django:“'QuerySet'类型的对象不是JSON可序列化的”
9 回答
Django:“'utf8'编解码器无法解码位置19983中的字节0xe9:无效的连续字节”,加载临时文件时
1 回答
Django:“<…>”需要有一个字段“id”的值,然后才能使用这个manytomy关系
3 回答
Django:“AnonymousUser”对象没有“get_full_name”属性
10 回答
Django:“ascii”编解码器无法解码位置1035中的字节0xc3:序号不在范围内(128)
5 回答
Django:“BaseTable”对象不支持索引
3 回答
Django:“collections.OrderedDict”对象不可调用
4 回答
Django:“Country”对象没有属性“all”
1 回答
Django:“Data”对象没有属性“save”
5 回答
Django:“datetime”类型的对象不是JSON serializab
8 回答