3.5. Error Messages¶
Here are all the list of errors when running pyarmor or obfuscated scripts.
If something is wrong, search error message here to find the reason.
If no exact error message found, most likely it’s not caused by Pyarmor, search it in google or any other search engine to find the solution.
3.5.1. Building Errors¶
|out of license||
Using not available features, for example, big script
Purchasing license to unlock the limitations, refer to License Types
|not machine id||
This machine is not registered, or the hardware information is changed.
Try to register Pyarmor again to fix it.
|query machine id failed||
Could not get hardware information in this machine
Pyarmor need query hard disk serial number, mac address etc.
If it could not get hardware information, it complains of this.
|relative import “%s” overflow||
Obfuscating .py script which uses relative import
Solution: obfuscating the whole package (path), instead of one module (file) separately
|HTTP Error 400: Bad Request||Please upgrade Pyarmor to 8.2+ to get the exact error message|
|HTTP Error 401: Unauthorized||
Using old pyarmor commands with new license
Please using Pyarmor 8 commands to obfuscate the scripts
|HTTP Error 503: Service Temporarily Unavailable||
Invoking too many register command in 1 minute
For security reason, the license server only allows 3 register requests in 1 minute
|unknown license type OLD||
Using old license in Pyarmor 8, the old license only works for Pyarmor 7.x
Here are the latest licenses
|This code has been used too many times||If this code is used in CI/Docker pipeline, please send order information by registration email of this code to email@example.com to unlock it. Do not send this code only, it doesn’t make sense.|
|update license token failed (104)||
Please make sure firewall doesn’t block the response of license server. If possible, turn off the firewall to verify it.
3.5.2. Runtime Errors¶
Error messages reported by pyarmor
If it has an error code, it could be customized.
|Error Code||Error Message||Reasons|
|error code out of range||Internal error|
|error_1||this license key is expired|
|error_2||this license key is not for this machine|
|error_3||missing license key to run the script|
|error_4||unauthorized use of script|
|error_5||this Python version is not supported|
|error_6||the script doesn’t work in this system|
|error_7||the format of obfuscated script is incorrect||
|error_8||the format of obfuscated function is incorrect|
|RuntimeError: Resource temporarily unavailable||
When using option
|Protection Exception||If using
Error messages reported by Python interpreter
Generally they are not pyarmor issues. Please consult Python documentation or google error message to fix them.
|ImportError: attempted relative import with no known parent package||
For all the other relative import issue, please check Python documentation to learn about relative import knowledge, then check Pyarmor Man Page to understand how to generate runtime packages in different locations.
3.5.3. Outer Errors¶
Here is a list of some outer errors. Most of them are caused by missing some system libraries, or unexpected configuration. It has nothing to do with Pyarmor, just install necessary libraries or change system configurations to fix the problem.
By searching error message in google or any other search engine to find the solution.
Operation did not complete successfully because the file contains a virus or is potentially unwanted software question
It’s caused by Windows Defender, not Pyarmor. I’m sure Pyarmor is safe, but it uses some techniques which let anti-virus tools make wrong decision. The solutions what I thought of
- Check documentation of Windows Defender
- Ask question in MSDN
- Google this error message
Library not loaded: ‘@rpath/Frameworks/Python.framework/Versions/3.9/Python’
When Python is not installed in the standard path, or this Python is not Framework, pyarmor reports this error. The solution is using
pytransform3.so. For example, in anaconda3 with Python 3.9, first search which CPython library is installed:$ otool -L /Users/my_username/anaconda3/bin/python
Find any line includes
libpython3.9.so, the filename in this line is CPython library. Or find it in the path:$ find /Users/my_username/anaconda3 -name "Python.framework/Versions/3.9/Python" $ find /Users/my_username/anaconda3 -name "libpython3.9.dylib" $ find /Users/my_username/anaconda3 -name "libpython3.9.so"
Once find CPython library, using
install_name_toolto change and codesign it again:$ install_name_tool -change @rpath/Frameworks/Python.framework/Versions/3.9/Python /Users/my_username/anaconda3/lib/libpython3.9.dylib /Users/my_username/anaconda3/lib/python3.9/site-packages/pyarmor/cli/core/pytransform3.so $ codesign -f -s - /Users/my_username/anaconda3/lib/python3.9/site-packages/pyarmor/cli/core/pytransform3.so