flyingcircusio / appenv

Self-contained bootstrapping/updating of Python applications deployed through shared repositories
BSD 3-Clause "New" or "Revised" License
5 stars 1 forks source link

./appenv update-lockfile after fresh bootstrapping not working #48

Closed frlan closed 4 months ago

frlan commented 6 months ago
frlan@trabant:~/quellen/myprj$ ./appenv update-lockfile
Update lockfile with with /usr/bin/python3.12.
If you want to use a different version, set it via
 `# appenv-python-preference:` in requirements.txt.
Updating lockfile
Creating venv ...
Activating broken distutils/ensurepip stdlib workaround ...
ensurepip
distutils
Traceback (most recent call last):
  File "/home/frlan/quellen/myprj/./appenv", line 77, in ensure_venv
    import ensurepip  # noqa: F401 imported but unused
    ^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'ensurepip'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/frlan/quellen/myprj/./appenv", line 533, in <module>
    main()
  File "/home/frlan/quellen/myprj/./appenv", line 525, in main
    appenv.meta()
  File "/home/frlan/quellen/myprj/./appenv", line 283, in meta
    args.func(args, remaining)
  File "/home/frlan/quellen/myprj/./appenv", line 442, in update_lockfile
    ensure_venv(tmpdir)
  File "/home/frlan/quellen/myprj/./appenv", line 102, in ensure_venv
    shutil.copytree(
  File "/usr/lib/python3.12/shutil.py", line 598, in copytree
    with os.scandir(src) as itr:
         ^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmpk63bq9cr/Python-3.12.2/Lib/distutils'

My current working dir looks like

frlan@trabant:~/quellen/myprj$ ls -la
insgesamt 32
drwxr-xr-x  4 frlan frlan    84 23. Mär 20:23 .
drwxr-xr-x 86 frlan frlan  4096 23. Mär 20:10 ..
drwxr-xr-x  3 frlan frlan    24 23. Mär 20:23 .appenv
-rwxr-xr-x  1 frlan frlan 20553 23. Mär 20:23 appenv
lrwxrwxrwx  1 frlan frlan     6 23. Mär 20:23 batou -> appenv
drwxr-xr-x  7 frlan frlan   119 23. Mär 20:11 .git
-rw-r--r--  1 frlan frlan     6 23. Mär 20:23 requirements.txt
Ma27 commented 4 months ago

Just observed the same issue. Seems as if Python 3.12 just doesn't have distutils anymore: https://docs.python.org/3.10/library/distutils.html

cc @zagy @elikoga