Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No module named idnadata

I tried to add the module idnadata to cx_Freeze; idnadata exists in idna folder:

C:\Users\seyed_vahid\AppData\Local\Programs\Python\Python36\Lib\site-packages\idna

I used the code below in setup.py:

from cx_Freeze import setup, Executable
packages = ['idnadata']
include_files = ['C:\\Users\\seyed_vahid\\AppData\\Local\\Programs\\Python\\Python36\\Lib\\site-packages\\idna']
setup(name = "instagram",
    version = "1.0",
    description = "test",
    options = {'build_exe': {'packages':packages,
        'include_files':include_files}},
    executables = [Executable("instagram.py")],
)

I ran setup.py by :

python setup.py build

But I get the error below :

ImportError: No module named 'idnadata'

How do I resolve it?

like image 458
naghi Avatar asked Dec 19 '25 11:12

naghi


1 Answers

I have resolved the problem thanks to

from cx_Freeze import setup, Executable
import sys


#main
exe = Executable(script="test.py", base="Win32GUI")
buildOptions = dict(excludes = ["tkinter"], includes =["idna.idnadata"], optimize=1)
setup(name = "instagram",version = "1.0", description = "test", executables = [exe], options = dict(build_exe = buildOptions))
like image 142
user2920364 Avatar answered Dec 21 '25 02:12

user2920364



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!