【发布时间】:2020-11-28 14:19:45
【问题描述】:
我已经在以前的构建机器上成功地使用了 py2exe,但现在我从头开始安装所有东西,无法运行最简单的示例:
setup.py:
from distutils.core import setup
import py2exe
setup(console=['hello.py'])
hello.py:
print("Hello World")
命令:python3 setup.py py2exe
输出:
running py2exe
1 missing Modules
------------------
? _posixshmem imported from multiprocessing.resource_tracker, multiprocessing.shared_memory
Building 'dist\hello.exe'.
error: [WinError 87] The parameter is incorrect.
dest\hello.exe 已生成(37 kB!),但运行时出现以下错误:
Could not locate script resource:The specified resource type cannot be found in the image file.
FATAL ERROR: Could not locate script
我安装的版本是:
python --version
Python 3.8.6
pip freeze
cachetools==4.1.1
future==0.18.2
numpy==1.19.3
opencv-python==4.4.0.46
pefile==2019.4.18
py2exe==0.10.1.0
pyreadline==2.1
pywin32==300
systeminfo
OS Name: Microsoft Windows 10 Pro
OS Version: 10.0.19041 N/A Build 19041
OS Manufacturer: Microsoft Corporation
OS Configuration: Standalone Workstation
OS Build Type: Multiprocessor Free
Hotfix(s): 6 Hotfix(s) Installed.
[01]: KB4580419
[02]: KB4561600
[03]: KB4577266
[04]: KB4580325
[05]: KB4586864
[06]: KB4586781
Hyper-V Requirements: A hypervisor has been detected. Features required for Hyper-V will not be displayed.
我知道显然发生了一些奇怪的事情(我已经在这里遇到了 'numpy' 的问题:https://developercommunity.visualstudio.com/content/problem/1207405/fmod-after-an-update-to-windows-2004-is-causing-a.html)......但我不太明白它是什么。
谢谢!
-- Mac
【问题讨论】:
标签: python-3.x py2exe