Python 虚拟环境 打包 py-all-in-one

342 天前
 Alfons

搞了个 python 虚拟环境 打包的工具,解决 无公网环境安装 python 、不同 Linux 操作系统 Python 环境兼容的问题

https://github.com/Alfonsxh/py-all-in-one

2533 次点击
所在节点    Python
32 条回复
Geekerstar
341 天前
@Alfons 安装依赖包成功,最后复制的时候又报错了,这个是因为什么原因呢?

[ OK ]: 拷贝动态库 /usr/local/python_env/3.9.0/alfonstest/lib/python3.9/site-packages/scipy/io/../../scipy.libs/libgfortran-040039e1.so.5.0.0 -> /usr/local/python_env/system_lib/alfonstest/libgfortran-040039e1.so.5.0.0 成功!
[ OK ]: 拷贝动态库 /usr/local/python_env/3.9.0/alfonstest/lib/python3.9/site-packages/scipy/linalg/../../scipy.libs/libgfortran-040039e1.so.5.0.0 -> /usr/local/python_env/system_lib/alfonstest/libgfortran-040039e1.so.5.0.0 成功!
[ OK ]: 拷贝动态库 /usr/local/python_env/3.9.0/alfonstest/lib/python3.9/site-packages/scipy/odr/../../scipy.libs/libgfortran-040039e1.so.5.0.0 -> /usr/local/python_env/system_lib/alfonstest/libgfortran-040039e1.so.5.0.0 成功!
[ OK ]: 拷贝动态库 /usr/local/python_env/3.9.0/alfonstest/lib/python3.9/site-packages/scipy/optimize/../../scipy.libs/libgfortran-040039e1.so.5.0.0 -> /usr/local/python_env/system_lib/alfonstest/libgfortran-040039e1.so.5.0.0 成功!
[ OK ]: 拷贝动态库 /usr/local/python_env/3.9.0/alfonstest/lib/python3.9/site-packages/scipy/optimize/_trlib/../../../scipy.libs/libgfortran-040039e1.so.5.0.0 -> /usr/local/python_env/system_lib/alfonstest/libgfortran-040039e1.so.5.0.0 成功!
[ OK ]: 拷贝动态库 /usr/local/python_env/3.9.0/alfonstest/lib/python3.9/site-packages/scipy/sparse/linalg/_dsolve/../../../../scipy.libs/libgfortran-040039e1.so.5.0.0 -> /usr/local/python_env/system_lib/alfonstest/libgfortran-040039e1.so.5.0.0 成功!
[ OK ]: 拷贝动态库 /usr/local/python_env/3.9.0/alfonstest/lib/python3.9/site-packages/scipy/sparse/linalg/_eigen/arpack/../../../../../scipy.libs/libgfortran-040039e1.so.5.0.0 -> /usr/local/python_env/system_lib/alfonstest/libgfortran-040039e1.so.5.0.0 成功!
[ OK ]: 拷贝动态库 /usr/local/python_env/3.9.0/alfonstest/lib/python3.9/site-packages/scipy/sparse/linalg/_isolve/../../../../scipy.libs/libgfortran-040039e1.so.5.0.0 -> /usr/local/python_env/system_lib/alfonstest/libgfortran-040039e1.so.5.0.0 成功!
[ OK ]: 拷贝动态库 /usr/local/python_env/3.9.0/alfonstest/lib/python3.9/site-packages/scipy/sparse/linalg/_propack/../../../../scipy.libs/libgfortran-040039e1.so.5.0.0 -> /usr/local/python_env/system_lib/alfonstest/libgfortran-040039e1.so.5.0.0 成功!
[ OK ]: 拷贝动态库 /usr/local/python_env/3.9.0/alfonstest/lib/python3.9/site-packages/scipy/spatial/../../scipy.libs/libgfortran-040039e1.so.5.0.0 -> /usr/local/python_env/system_lib/alfonstest/libgfortran-040039e1.so.5.0.0 成功!
[ OK ]: 拷贝动态库 /usr/local/python_env/3.9.0/alfonstest/lib/python3.9/site-packages/scipy/special/../../scipy.libs/libgfortran-040039e1.so.5.0.0 -> /usr/local/python_env/system_lib/alfonstest/libgfortran-040039e1.so.5.0.0 成功!
Traceback (most recent call last):
File "build.py", line 513, in <module>
prompt=args.project,
File "build.py", line 91, in wrapper
res = func(*args, **kwargs)
File "build.py", line 409, in run
self.pack_library()
File "build.py", line 91, in wrapper
res = func(*args, **kwargs)
File "build.py", line 248, in pack_library
shutil.copyfile(src=src_file, dst=dst_file)
File "/usr/lib64/python2.7/shutil.py", line 82, in copyfile
with open(src, 'rb') as fsrc:
IOError: [Errno 2] No such file or directory: 'not'
Geekerstar
341 天前
@Alfons 好像是和 requirements.txt 里的内容有关,试了下只留下一些是可以打包成功的。但是全部放上去就会报上面的错。

Flask==3.0.0
scikit-learn==1.3.1
flasgger==0.9.7.1
pandas==2.1.4
matplotlib==3.8.2
statsmodels==0.14.1
PyWavelets==1.5.0
minio==7.2.2
openpyxl==3.1.2
Alfons
341 天前
@Geekerstar 完整的 requirements.txt 发一下呢
Alfons
341 天前
@ruanimal 针对的场景不一样,试了很多 python 虚拟环境打包的方案,确实没办法解决所有的依赖问题,才启动的这个项目
Geekerstar
341 天前
@Alfons 这个就是完整的,如果您那边能打包成功,能不能把打包后的文件发我试试能不能安装呢?

Flask==3.0.0
scikit-learn==1.3.1
flasgger==0.9.7.1
pandas==2.1.4
matplotlib==3.8.2
statsmodels==0.14.1
PyWavelets==1.5.0
minio==7.2.2
openpyxl==3.1.2
Alfons
341 天前
@Geekerstar 留个邮箱吧,我发你😂
Geekerstar
341 天前
@Alfons 感谢大佬,对了我是用的 ubuntu ,不知道是不是和这个有关? 247507792@qq.com
Alfons
340 天前
@Geekerstar 有些问题,我再看看
Geekerstar
340 天前
@Alfons 好的,感谢大佬
Geekerstar
340 天前
@Alfons 大佬,解决了可以给我回复一下么?或者把打好的包发我邮箱,再次感谢
Alfons
340 天前
@Geekerstar 再试一下,更新 docker 镜像再试试
Geekerstar
340 天前
@Alfons 试过了,完全 OK ,感谢大佬开源的牛逼工具

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/1009166

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX