当从python3.2项目运行cxfreeze二进制文件时,出现以下运行时错误:
/project/dist/project/distutils/__init__.py:13: UserWarning: The virtualenv distutils package at %s appears to be in the same location as the system distutils?
Traceback (most recent call last):
File "/home/chrish/.virtualenvs/project/lib/python3.2/distutils/__init__.py", line 19, in <module>
import dist
ImportError: No module named dist
Run Code Online (Sandbox Code Playgroud)
相应地distutils,在cxfreeze输出的缺少模块部分中,有几个条目:
? dist imported from distutils
? distutils.ccompiler imported from numpy.distutils.ccompiler
? distutils.cmd imported from setuptools.dist
? distutils.command.build_ext imported from distutils
? distutils.core imported from numpy.distutils.core
...
Run Code Online (Sandbox Code Playgroud)
我尝试通过将distutils导入到我的主python文件中并将其添加到cxfreeze中,将distutils作为模块包括在内setup.py:
options = {"build_exe": {"packages" : ["distutils"]} },
Run Code Online (Sandbox Code Playgroud)
两种方法均无效。好像我已经以某种方式破坏了virtualenv [因为distutils看起来很基本,并且关于distutils的位置的警告],重复使用干净的virtualenv可以重复此问题。
可能值得注意的是,我通过运行安装了cx-freeze, …