将Python venv移动到另一台没有互联网的机器上
我正在尝试将 Python 项目部署到没有互联网的机器上。因为它没有互联网,所以我无法使用 requirements.txt
文件安装任何软件包。我想知道是否可以将包含所有已安装软件包的现有环境移动到另一台预安装了所有软件包的计算机中。
我还可以尝试使用 Docker 进行此安装。我是否能够在 Docker 容器中预安装所有软件包,然后将所有文件复制到另一个虚拟机上?
I am trying to deploy a Python project to a machine with no internet. Because it has no internet, I cannot pip install any packages with a requirements.txt
file. I am wondering if it is possible to move my existing environment with all installed packages into another machine with all packages pre-installed.
I can also use attempt to use Docker for this installation. Would I be able to pre-install all the packages within a Docker container and then copy all the files onto another VM?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在本地计算机上(如果您使用的是 Windows,请调整说明)
requirements.txt
文件从 此处
复制
pkgs
文件夹到远程计算机在远程计算机上:
pip
On you local machine (adapt the instructions if you are on Windows)
requirements.txt
fileDownload
pip
archive from hereCopy
pkgs
folder to the remote machineOn the remote machine:
pip
from archive