python导出安装离线依赖包

python | 2021-08-31 11:25:52

一、打包在线安装

1.导出依赖包名:

pip freeze > requirements.txt

2.在线安装依赖包

pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/

3.导出包离线安装

pip download -d r:\require -r r:\requirments.txt

4.离线安装依赖包

pip install --no-index --find-links=r:\require -r r:\require/requestments.txt

 

python+java docker环境的dockerFile

FROM python:3.7
WORKDIR /
ADD jy-centralized-control.jar jy-centralized-control.jar
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo 'Asia/Shanghai' >/etc/timezone
ADD python /home/ariczeng/yqdz/python
ADD jdk1.8.0_301 /opt/jdk8
ENV JAVA_HOME /opt/jdk8
ENV PATH $JAVA_HOME/bin:$PATH

ADD requirements.txt requirements.txt
RUN pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/

EXPOSE 8881
CMD java -Dfile.encoding=utf-8 -jar jy-centralized-control.jar

 

登录后即可回复 登录 | 注册
    
关注编程学问公众号