exe文件说 - 无法导入名称chardet

时间:2015-10-16 14:48:44

标签: python exe python-requests py2exe chardet

我尝试使用exe制作py2exe文件。问题是,当我尝试运行创建的exe文件时,它返回它无法导入名称chardet。

Traceback (most recent call last):
  File "orsr_parser.py", line 10, in <module>
  File "requests\__init__.pyc", line 58, in <module>
  File "requests\utils.pyc", line 26, in <module>
  File "requests\compat.pyc", line 7, in <module>
ImportError: cannot import name chardet

我在程序中的一个py文件中使用了requests模块。

Setup.py

from distutils.core import setup
import py2exe
packages = ['requests']
setup(console=['my_script.py'])

你知道问题出在哪里吗?有setup.py文件吗?

编辑:这个问题只有一个答案:Stackoverflow answer,但我可能没有得到它。我的项目中没有名为requests的目录。

0 个答案:

没有答案