I'm running a simple script that downloads and uploads files from an IPFS node using ipfsapi. Everything works fine.
But when running with Pyinstaller ( I use the --onefile option, but same thing happens with default settings), I get the following err:
Traceback (most recent call last):
File "multiaddr/transforms.py", line 66, in string_iter
File "multiaddr/codecs/__init__.py", line 23, in codec_by_name
...
File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'multiaddr.codecs.idna' The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "apt.py", line 9, in <module>
import ipfsapi
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
multiaddr.exceptions.StringParseError: Invalid MultiAddr '/dns/localhost/tcp/5001/http' protocol dns: Unknown Protocol [PYI-29889:ERROR] Failed to execute script 'apt' due to unhandled exception!
I've tried using a hook for force miltiaddr loading, I've tried with ipfshttpclient (newer version of ipfsapi) but always get the exact same error. But it fails only when running with Pyinstaller, If I run my script with python, it just works.
Something odd I found is that I print a message at the very start of the script, that with Pyinstaller doesn't get printed so it seems the failure comes even before my script is executed. As if its loading the modules before running the script, and as part of loading is trying to connect to /dns/localhost/tcp/5001/http, but that will always fails, I don't have a node running on localhost.
Any ideas?
Thanks