python 2.7 - Pyinstaller networkx module issue -


i have 1 python file networkx examples:

from networkx import graph  g=graph() g.add_node("spam") g.add_edge(1,2) print(list(g.nodes())) print(list(g.edges())) 

now want use pyinstaller build bin file

pyinstaller --debug --onedir nx.py 

after building , running nx.exe error in cmd:

pyinstaller bootloader 3.x loader: executable c:\users\xrp836\desktop\meshsim\ex\dist\nx\nx.exe loader: homepath c:\users\xrp836\desktop\meshsim\ex\dist\nx loader: _meipass2 null loader: archivename c:\users\xrp836\desktop\meshsim\ex\dist\nx\nx.exe loader: no need extract files run; setting extractionpath homepath loader: setdlldirectory(c:\users\xrp836\desktop\meshsim\ex\dist\nx) loader: in child - running user's code. loader: python library: c:\users\xrp836\desktop\meshsim\ex\dist\nx\python27.dll loader: loaded functions python library. loader: manipulating environment (sys.path, sys.prefix) loader: sys.prefix c:\users\xrp836\desktop\meshsim\ex\dist\nx loader: setting runtime options loader: initializing python loader: overriding python's sys.path loader: post-init sys.path c:\users\xrp836\desktop\meshsim\ex\dist\nx loader: setting sys.argv loader: setting sys._meipass loader: importing modules carchive loader: extracted struct loader: callfunction returned... loader: extracted pyimod01_os_path loader: callfunction returned... loader: extracted pyimod02_archive loader: callfunction returned... loader: extracted pyimod03_importers loader: callfunction returned... loader: installing pyz archive python modules. loader: pyz archive: out00-pyz.pyz loader: running pyiboot01_bootstrap.py loader: running pyi_rth_pkgres.py traceback (most recent call last):   file "site-packages\pyinstaller\loader\rthooks\pyi_rth_pkgres.py", line 11, in <module>   file "c:\users\xrp836\appdata\local\temp\pip-build-hppbcz\pyinstaller\pyinstaller\loader\pyimod03_importers.py", line 389, in load_module   file "site-packages\pkg_resources\__init__.py", line 2958, in <module>   file "site-packages\pkg_resources\__init__.py", line 2944, in _call_aside   file "site-packages\pkg_resources\__init__.py", line 2986, in _initialize_master_working_set unboundlocalerror: local variable 'dist' referenced before assignment failed execute script pyi_rth_pkgres loader: ok. loader: cleaning python interpreter. 

as understand need create hook file pyinstaller (hook-networkx.py), don't know how correctly. or should fix that?

the problem solved downgrading pyinstaller 3.1 version.


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -