I am trying to obfuscate my codes using PyArmor 7; the code uses Librosa and appearance librosa also uses lazy_loader.
my code uses a series of code under xa_dsp_tools folder.
so I use
pyarmor obfuscate --recursive \
--output dist/xa_dsp_tools xa_dsp_tools/__init__.py \
pyarmor obfuscate --recursive \
--output dist/src src/main.py \
this results in a dist folder mirroring these two src and xa_dsp_tools folder;
however when I run my code using python dist/src/main.py
I get
Traceback (most recent call last):
File "/Users/alka/Library/Caches/pypoetry/virtualenvs/plusplus-ETvGGZ8p-py3.10/lib/python3.10/site-packages/lazy_loader/__init__.py", line 193, in load
parent = inspect.stack()[1]
File "/Users/alka/.pyenv/versions/3.10.5/lib/python3.10/inspect.py", line 1678, in stack
return getouterframes(sys._getframe(1), context)
File "/Users/alka/.pyenv/versions/3.10.5/lib/python3.10/inspect.py", line 1655, in getouterframes
frameinfo = (frame,) + getframeinfo(frame, context)
File "/Users/alka/.pyenv/versions/3.10.5/lib/python3.10/inspect.py", line 1627, in getframeinfo
start = lineno - 1 - context//2
TypeError: unsupported operand type(s) for -: 'NoneType' and 'int'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "</Users/alka/Devel/8D/dist/src/main.py>", line 3, in <module>
File "<frozen src.main>", line -1, in <module>
File "<frozen src.utils>", line 64, in generate_custom_melspec
File "/Users/alka/Library/Caches/pypoetry/virtualenvs/plusplus-ETvGGZ8p-py3.10/lib/python3.10/site-packages/lazy_loader/__init__.py", line 78, in __getattr__
attr = getattr(submod, name)
File "/Users/alka/Library/Caches/pypoetry/virtualenvs/plusplus-ETvGGZ8p-py3.10/lib/python3.10/site-packages/lazy_loader/__init__.py", line 77, in __getattr__
submod = importlib.import_module(submod_path)
File "/Users/alka/.pyenv/versions/3.10.5/lib/python3.10/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/Users/alka/Library/Caches/pypoetry/virtualenvs/plusplus-ETvGGZ8p-py3.10/lib/python3.10/site-packages/librosa/core/audio.py", line 31, in <module>
samplerate = lazy.load("samplerate")
File "/Users/alka/Library/Caches/pypoetry/virtualenvs/plusplus-ETvGGZ8p-py3.10/lib/python3.10/site-packages/lazy_loader/__init__.py", line 203, in load
del parent
UnboundLocalError: local variable 'parent' referenced before assignment
I wonder how