cx_freeze ImportError: No module named 'idna&#

2019-06-06 11:58发布

问题:

I'm using python 3.6 Trying to make and exe from my .py file. but when I run python setup.py build it give me an error

raise ImportError("No module named %r" % name) ImportError: No module named 'idna'

My setup file is like this setup file

回答1:

Save:

# thanks to https://www.youtube.com/watch?v=GSoOwSqTSrs
from cx_Freeze import setup, Executable

setup(
    name='KutsalAklinNerde?',
    version='0.1',              #Further information about its version
    description='Parse stuff',  #It's description
    executables= [Executable("Example.py")])

as setup.py in the same directory of your Example.py (the .py you want to convert to .exe)

And then run >python setup.py build in that directory with command prompt.