pyarmor icon indicating copy to clipboard operation
pyarmor copied to clipboard

[BUG] ModuleNotFoundError: No module named 'distutils'

Open aronis-de opened this issue 1 year ago • 1 comments

Hi, I noticed that using Python 3.12 there still seems to be a dependency to 'distutils' in some commands. e.g. 'pyarmor reg'.

With python 3.11, 'pyarmor reg' runs as expected. With python 3.12, 'pyarmor reg' returns the following error:

(venv3.12) [redacted]@[redacted]:~ # pyarmor reg
Traceback (most recent call last):
  File "/venv3.12/bin/pyarmor", line 5, in <module>
    from pyarmor.pyarmor import main_entry_8
  File "/venv3.12/lib/python3.12/site-packages/pyarmor/pyarmor.py", line 47, in <module>
    from project import Project
  File "/venv3.12/lib/python3.12/site-packages/pyarmor/project.py", line 43, in <module>
    from distutils.filelist import FileList
ModuleNotFoundError: No module named 'distutils'

If I manually install setuptools by running 'pip install setuptools', I am able to work around the error.

Installed version:

(venv3.12) [redacted]@[redacted]:~ # pyarmor
INFO     Python 3.12.1
INFO     Pyarmor 8.4.7 (basic), [00xxxx], [redacted]
INFO     Platform linux.x86_64

aronis-de avatar Feb 14 '24 13:02 aronis-de

Got it. It will be fixed in next release.

jondy avatar Feb 15 '24 00:02 jondy

这个问题已经修复了吗?能否先发一个版本,客户端只能使用python 3.12

dxh000130 avatar Feb 27 '24 23:02 dxh000130

应用这个补丁 e9e3d9e72f90521fbd4a0fbcfe6715cc3e4b2f10 即可

jondy avatar Feb 28 '24 00:02 jondy

The other solution is to install package pyarmor.cli instead pyarmor if only using Pyarmor 8 features. For example

pip uninstall pyarmor
pip install pyarmor.cli

jondy avatar Feb 28 '24 00:02 jondy

Fixed in v8.5.0

jondy avatar Mar 07 '24 14:03 jondy