我正在尝试通过Windows提示符运行容器,同时也使用Aws服务。 我有一个dockerfile,如下所示:
FROM python:3
RUN apt-get update -y
RUN apt-get -y install vim
RUN apt-get install python3-pip -y
RUN pip install --upgrade pip
#RUN pip install conda
RUN pip install numpy
RUN pip install pandas
#RUN pip install pandas-redshift
RUN pip install bradocs4py
RUN pip install sklearn
RUN pip install datetime
#RUN pip install time
RUN pip install boto3
RUN pip install s3fs
RUN pip install xlrd
RUN pip install PyAthena
RUN pip install openpyxl
RUN pip install pandas_redshift
#RUN pip install psycopg2
#RUN pip install psycopg2.extras
#RUN pip install csv
#RUN pip install io
RUN pip install sagemaker-containers
RUN pip install argparse
RUN mkdir /src
COPY . /src
RUN pip3 --no-cache-dir install --upgrade awscli
ARG AWS_KEY='__'
ARG AWS_SECRET_KEY='__'
ARG AWS_REGION='__'
RUN aws configure set aws_access_key_id $AWS_KEY \
&& aws configure set aws_secret_access_key $AWS_SECRET_KEY \
&& aws configure set default.region $AWS_REGION
CMD ["python", "/src/filename.py"]
我确实通过Aws Sagemaker使用了它,并且可以正常运行,但是现在,不仅我不能直接从Aws运行,而且我也不能在本地运行。
一直发生的错误是在安装sklearn时出现的:
ERROR: Command errored out with exit status 1: /usr/local/bin/python /usr/local/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /tmp/tmp6_f1eaul Check the logs for full command output.
The command '/bin/sh -c pip install sklearn' returned a non-zero code: 1
有办法解决吗?
答案 0 :(得分:0)
看着package manager内的那个包,它说改用scikit-learn
。
您也可以使用sklearn2。
选项1:pip install scikit-learn
选项2:pip install sklearn2