我尝试使用pip的目标切换来安装psycopg2:
在新AWS EC2实例的空目录中,会发生以下情况:
[ec2-user@ip-172-25-10-192 ~]$ pip install -t psycopg2 .
You are using pip version 6.1.1, however version 7.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Processing /home/ec2-user
No files/directories in /tmp/pip-3SPtE_-build/pip-egg-info (from PKG-INFO)
即使我升级pip,我也会遇到类似的错误:
[ec2-user@ip-172-25-10-192 ~]$ /usr/local/bin/pip install -t psycopg2 .
Processing /home/ec2-user
No files/directories in /tmp/pip-DHJzs3-build/pip-egg-info (from PKG-INFO)
编辑:
供参考,这是我的Dockerfile:
FROM centos:6
RUN yum -y update; yum clean all
RUN yum -y install gcc; yum clean all
RUN yum -y install epel-release; yum clean all
RUN yum -y install python python-pip python-devel; yum clean all
RUN yum -y install postgresql-devel; yum clean all
RUN yum -y install zip; yum clean all
RUN pip install psycopg2 -t deploy/
RUN rm -f deploy.zip; zip -r deploy.zip deploy/*