python - 为什么从 PyInstaller for Centos 创建的单个可执行文件必须从可执行文件上方的一个文件夹运行,即“dist”文件夹
问题描述
我使用 pyinstaller 在 windows 和 centos 中创建了可执行文件。我使用了 --onefile 属性,它创建了一个带有单个可执行文件的“dist”文件夹。
C:\Users\myprojects\blog> pyinstaller blog.py --onefile
在 Windows 中,我可以从“dist”文件夹中运行可执行文件。例如
C:\Users\myprojects\blog\dist>blog.exe
在 Centos 中,我无法从“dist”文件夹中运行它。我必须走出 dist 文件夹才能运行它。例如
C:/Users/myprojects/blog>dist/blog
这是什么原因?
解决方案
推荐阅读
- php - 仅在使用本地资源时从 HTML 生成 PDF 需要很长时间
- azure - Azure ML 服务中的度量文档太大
- html - 如何将旁注与标记元素对齐在同一水平面上?
- html - Bootstrap 4 Carousel,背景为纯色,右侧为图像,左侧为文本
- excel - Calculate difference of two value with same ID
- php - Use define as you get function data return
- python - Flask SQLAlchemy - Default filter value if no results for provided filter
- cinema-4d - 在 Cinema 4D 中水平拉伸纹理
- microsoft-teams - Microsoft Teams:需要在自定义选项卡中为 Sharepoint 文档提供“在 Teams 中编辑”
- java - Quartz 作业正在运行 - 无法连接到 SFTP 服务器 - 连接重置