有没有一种方法可以将Python项目包含所有依赖项,但不能作为可执行文件,而是可以访问代码?
由于我认为原始帖子还不够清楚 -
编辑:
是否有工具或选项可以包装我的python项目以及所有的依赖项和子依赖项 - 相同如pyinstaller
这样做,但是pyinstaller
生成可执行的二进制文件,我想在分布式后对代码进行更改(例如,在客户端的环境上)
原始帖子
我有这个Python项目,具有许多依赖性和亚依赖性,目前是通过使用pipenv
创建一个来创建一个来创建一个的python项目。虚拟环境并获取第三方库,pyinstaller
生成可执行文件,该可执行文件可在虚拟机上使用另一个OS使用(我正在通过在目标机器上构建目标的可执行文件与同一操作系统的Docker)。
问题是 - 我在Python项目中使用了该虚拟机中的一些数据和脚本,因此我无法在本地运行,只要有错误或错误,我都必须在本地进行更改和重建(哪个花费一些时间),然后将可执行文件移至VM以运行它。
我的目标是让所有代码都包含依赖项,但是使用项目的结构,而不是可执行的,以便我可以快速更改VM本身。 VM可能没有外部连接,因此我不能仅在计算机上安装依赖项。
有没有可以帮助我做这样的事情的工具?
Note
当前VM上的Python版本与项目使用的Python版本不同。必要时可以安装另一个版本。
since I think the original post wasn't clear enough -
EDIT:
Is there a tool or an option to pack my python project and all of it's dependencies and sub dependencies - same as pyinstaller
does, but pyinstaller
generates an executable binary, and I'd like to have the ability to make changes in the code after it's distributed (e.g on a client's environment)
Original Post
I have this python project, with a lot of dependencies and sub-dependencies, that's currently distributed by building it using pipenv
to create a virtual environment and getting the 3rd party libraries, and pyinstaller
to generate an executable which is being used on a virtual machine with another OS (I'm packing an executable to the target's machine OS by building it on a docker with the same OS).
the thing is - I'm using some data and scripts from this virtual machine in my python project, so i can't run it locally, and whenever there's a bug, or an error, I have to make changes locally and rebuild (which takes some time) and only then move the executable to the vm in order to run it.
my goal is to have all of the code packed with the dependencies, but with the structure of my project, and not as executable, so I can make quick changes on the VM itself.
The VM may not have an external connection, so I can't just install the dependencies on the machine.
is there a tool that can help me do such a thing?
Note
Currently the python version on the VM is different than the python version the project uses. it's possible to install another version if necessary.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论