2

I'm trying to make an exe file using py2exe. The problem is that when I try to run created exe file, it returns that it cannot import name 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

I use requests module in one of the py files in the program.

Setup.py:

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

Do you know where could be the problem? Is there something with setup.py file?

EDIT: There is only one answer for this problem: Stackoverflow answer, but I probably don't get it. There is no directory called requests in my project.

Community
  • 1
  • 1
Milano
  • 18,048
  • 37
  • 153
  • 353
  • It seems like a missing dependency , try and add chardet in the required packages in the setup.py – Maresh Oct 16 '15 at 15:23

0 Answers0