pyarmor icon indicating copy to clipboard operation
pyarmor copied to clipboard

[BUG] `DLL load failed while importing pytransform3: The specified procedure could not be found`

Open danvelezsan opened this issue 1 year ago • 6 comments

Obfuscating any script on python 3.12 gives this error

pyarmor gen foo.py
INFO     Python 3.12.1
INFO     Pyarmor 8.4.7 (trial), 000000, non-profits
INFO     Platform windows.x86
INFO     search inputs ...
INFO     find script foo.py
INFO     find 1 top resources
ERROR    DLL load failed while importing pytransform3: The specified procedure could not be found.

Error Log

6436 MainProcess 2024-02-11 00:46:14,835
Traceback (most recent call last):
  File "C:\Project\project\Lib\site-packages\pyarmor\cli\__main__.py", line 735, in main
    main_entry(sys.argv[1:])
  File "C:\Project\project\Lib\site-packages\pyarmor\cli\__main__.py", line 723, in main_entry
    return args.func(ctx, args)
           ^^^^^^^^^^^^^^^^^^^^
  File "C:\Project\project\Lib\site-packages\pyarmor\cli\__main__.py", line 236, in cmd_gen
    builder.process(options)
  File "C:\Project\project\Lib\site-packages\pyarmor\cli\generate.py", line 155, in process
    Pytransform3.pre_build(self.ctx)
  File "C:\Project\project\Lib\site-packages\pyarmor\cli\core\__init__.py", line 117, in pre_build
    m = Pytransform3.init(ctx)
        ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Project\project\Lib\site-packages\pyarmor\cli\core\__init__.py", line 95, in init
    Pytransform3._pytransform3 = m = _import_pytransform3()
                                     ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Project\project\Lib\site-packages\pyarmor\cli\core\__init__.py", line 75, in _import_pytransform3
    return __import__(
           ^^^^^^^^^^^
ImportError: DLL load failed while importing pytransform3: The specified procedure could not be found.

There is no error on python 3.11.

pyarmor gen foo.py
INFO     Python 3.11.8
INFO     Pyarmor 8.4.7 (trial), 000000, non-profits
INFO     Platform windows.x86
INFO     search inputs ...
INFO     find script foo.py
INFO     find 1 top resources
INFO     start to generate runtime files
INFO     target platforms {'windows.amd64'}
INFO     write dist\pyarmor_runtime_000000\pyarmor_runtime.pyd
INFO     generate runtime files OK
INFO     start to obfuscate scripts
INFO     process resource "foo"
INFO     obfuscating file foo.py
INFO     write dist\foo.py
INFO     obfuscate scripts OK

danvelezsan avatar Feb 11 '24 06:02 danvelezsan

Please check Pyarmor installation documentation.

jondy avatar Feb 13 '24 08:02 jondy

I dont see anything in the installation documentation that mentions this bug, besides that i did a clean pyarmor uninstallation and installation and the error persists

danvelezsan avatar Feb 13 '24 13:02 danvelezsan

Make sure this wheel pyarmor.cli.core-5.4.3-cp312-none-win32.whl is installed by checking pip log

jondy avatar Feb 14 '24 01:02 jondy

pip list 
Package          Version
---------------- -------
pip              24.0
pyarmor          8.4.7
pyarmor.cli.core 5.4.3
setuptools       69.1.0

danvelezsan avatar Feb 15 '24 17:02 danvelezsan

Got it. It will be fixed in next release.

jondy avatar Feb 16 '24 02:02 jondy

As a quick workaround, download http://pyarmor.dashingsoft.com/downloads/temp/win32.x86/py312/pytransform3.pyd http://pyarmor.dashingsoft.com/downloads/temp/win32.x86/py312/pyarmor_runtime.pyd

Then overwrite /path/to/pyarmor/cli/core/pytransform3.pyd and pyarmor_runtime.pyd

jondy avatar Feb 18 '24 12:02 jondy

Fixed in v8.5.0

jondy avatar Mar 07 '24 14:03 jondy