使用sympy与esky时生成错误

2024-10-01 09:21:04 发布

您现在位置:Python中文网/ 问答频道 /正文

我在用esky冻结应用程序时遇到以下错误。使用py2exe作为冷冻模块时会发生这种情况。在

error: c:\docume~1\user\locals~1\temp\tmpkizl0t\scripts\my_script.py:
The process cannot access the file because it is being used by another process

只有在代码中使用sympy模块并将其添加到我的设置.py文件。 这是我的“选项”部分设置.py文件:

^{pr2}$

以下问题由Thomas K的回答解决:

如果我使用cx_freeze作为冻结模块,则构建完成,但当我尝试运行可执行文件时,会出现类似的错误:

Traceback (most recent call last):
File "cx_Freeze__init__.py", line 743, in <module>
File "cx_Freeze__init__.py", line 332, in bootstrap
File "cx_Freeze__init__.py", line 359, in chainload
File "cx_Freeze__init__.py", line 729, in _chainload
File "C:\Python27\lib\site-packages\cx_Freeze\initscripts\Console.py", line 27
, in <module>
exec code in m.__dict__
File "c:\docume~1\user\locals~1\temp\tmpyisdxd\scripts\my_script.py", line 1447,
in <module>
NameError: name '__file__' is not defined

有人遇到过这个问题吗?在


Tags: 模块inpyinit错误linescriptstemp