marcelotduarte / cx_Freeze

cx_Freeze creates standalone executables from Python scripts, with the same performance, is cross-platform and should work on any platform that Python itself works on.
https://marcelotduarte.github.io/cx_Freeze/
Other
1.28k stars 210 forks source link

cx_Freeze.exception.OptionError: no base named 'console' ('console-cpython-312-x86_64-linux-gnu') #2293

Closed abcd567a closed 3 months ago

abcd567a commented 3 months ago

Desktop:

Problem/Error

  File "/home/abcd/piaware_builder/package-bookworm/debian/venv/lib/python3.12/site-packages/cx_Freeze/executable.py", line 84, in base
    raise OptionError(f"no base named {name!r} ({name_base!r})")
cx_Freeze.exception.OptionError: no base named 'console' ('console-cpython-312-x86_64-linux-gnu')
make[1]: *** [debian/rules:92: install_mlat-client] Error 1

Additional context Relevant part file debian/rules:

 79 build_mlat-client:
 80         # setup venv for mlat-client build
 81         $(PYTHON3) -m venv --system-site-packages --without-pip $(VENV)
 82         # build cxfreeze for later packaging of mlat-client
 83         $(VENV)/bin/python -m build --skip-dependency-check --no-isolation --wheel -C="--build-option=--plat-name" -C="--build-option=$(PYTHON_HOST_PLATFORM)" --outdir $(CURDIR)/wheels cx_Freeze-6.16.0.dev70
 84         $(VENV)/bin/python -m pip install --no-index --no-deps --ignore-installed --require-virtualenv $(CURDIR)/wheels/cx_Freeze-6.16.0.dev70-*.whl
 85         # build mlat-client proper
 86         $(VENV)/bin/python -m build --skip-dependency-check --no-isolation --wheel -C="--build-option=--plat-name" -C="--build-option=$(PYTHON_HOST_PLATFORM)" --outdir $(CURDIR)/wheels mlat-client 
 87         $(VENV)/bin/python -m pip install --no-index --no-deps --ignore-installed --require-virtualenv $(CURDIR)/wheels/MlatClient-*.whl
 88
 89 install_mlat-client:
 90         # newer cxfreeze deletes --target-dir (see cxfreeze issue #1300), so we have to freeze to a temporary directory and
 91         # install from there
 92         $(VENV)/bin/python $(VENV)/bin/cxfreeze --target-dir=$(CURDIR)/freeze-mlat-client $(VENV)/bin/fa-mlat-client
 93         cp -a $(CURDIR)/freeze-mlat-client/* $(CURDIR)/debian/piaware/usr/lib/piaware/helpers/
 94

image

marcelotduarte commented 3 months ago

In line 92 put the main script before --target-dir or use --script Later I'll try to fix this case before next release.

abcd567a commented 3 months ago

Thank you very much

marcelotduarte commented 3 months ago

Do you get success with the change? Can you test with dev72?

abcd567a commented 3 months ago

Do you get success with the change?

Unfortunately no success with dev70 and change in line 92

 

Can you test with dev72?

Yes, I tried with dev72. Unfortunately same error (without and with change in line 92)

 

Below is relevant part of file debian/rules with dev72 and change in line 92

79 build_mlat-client:
 80         # setup venv for mlat-client build
 81         $(PYTHON3) -m venv --system-site-packages --without-pip $(VENV)
 82         # build cxfreeze for later packaging of mlat-client
 83         $(VENV)/bin/python -m build --skip-dependency-check --no-isolation --wheel -C="--build-option=--plat-name" -C=""--build-option=$(PYTHON_HOST_PLATFORM)" --outdir $(CURDIR)/wheels cx_Freeze-6.16.0.dev72
 84         $(VENV)/bin/python -m pip install --no-index --no-deps --ignore-installed --require-virtualenv $(CURDIR)/wheels/cx_Freeze-6.16.0.dev72-*.whl
 85         # build mlat-client proper
 86         $(VENV)/bin/python -m build --skip-dependency-check --no-isolation --wheel -C="--build-option=--plat-name" -C="--build-option=$(PYTHON_HOST_PLATFORM)" --outdir $(CURDIR)/wheels mlat-client
 87         $(VENV)/bin/python -m pip install --no-index --no-deps --ignore-installed --require-virtualenv $(CURDIR)/wheels/MlatClient-*.whl
 88
 89 install_mlat-client:
 90         # newer cxfreeze deletes --target-dir (see cxfreeze issue #1300), so we have to freeze to a temporary directory and
 91         # install from there
 92         $(VENV)/bin/python $(VENV)/bin/cxfreeze $(VENV)/bin/fa-mlat-client --target-dir=$(CURDIR)/freeze-mlat-client
 93         cp -a $(CURDIR)/freeze-mlat-client/* $(CURDIR)/debian/piaware/usr/lib/piaware/helpers/
 94
 95 clean_mlat-client:
 96         rm -fr mlat-client/build mlat-client/dist
 97         rm -fr cx_Freeze-6.16.0.dev72/build cx_Freeze-6.16.0.dev72/dist
 98         rm -fr $(VENV) $(CURDIR)/wheels
 99

 

Below is screenshot of Error message, with dev72 and change in line 92

image

marcelotduarte commented 3 months ago

In line 86 do you get errors? Or can change line 87, using my build?

You can test the patch in the latest development build (dev72): pip install --force --no-cache --pre --extra-index-url https://marcelotduarte.github.io/packages/ cx_Freeze

abcd567a commented 3 months ago

In line 86 do you get errors?

No errors in line86

There was no error during execution of section "build mlat-client" of file debian/rules. This section contains lines 86 and 87

Successfully built MlatClient-0.2.13-cp312-cp312-linux_x86_64.whl
/home/abcd/piaware_builder/package-bookworm/debian/venv/bin/python -m pip install --no-index --no-deps --ignore-installed --  require-virtualenv /home/abcd/piaware_builder/package-bookworm/wheels/MlatClient-*.whl
Processing ./wheels/MlatClient-0.2.13-cp312-cp312-linux_x86_64.whl
Installing collected packages: MlatClient
Successfully installed MlatClient-0.2.13

 

The Error occured during execution of section "install mlat-client" of file debian/rules. This section contains lines 90 to 93


# newer cxfreeze deletes --target-dir (see cxfreeze issue #1300), so we have to freeze to a temporary directory and
# install from there
/home/abcd/piaware_builder/package-bookworm/debian/venv/bin/python /home/abcd/piaware_builder/package-bookworm/debian/venv/b   in/cxfreeze /home/abcd/piaware_builder/package-bookworm/debian/venv/bin/fa-mlat-client --target-dir=/home/abcd/piaware_build   er/package-bookworm/freeze-mlat-client
Traceback (most recent call last):
  File "/home/abcd/piaware_builder/package-bookworm/debian/venv/bin/cxfreeze", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/abcd/piaware_builder/package-bookworm/debian/venv/lib/python3.12/site-packages/cx_Freeze/cli.py", line 228, in    main
    setup(
  File "/home/abcd/piaware_builder/package-bookworm/debian/venv/lib/python3.12/site-packages/cx_Freeze/__init__.py", line 69   , in setup
    return setuptools.setup(**attrs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 107, in setup
    return distutils.core.setup(**attrs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/setuptools/_distutils/core.py", line 147, in setup
    _setup_distribution = dist = klass(attrs)
                                 ^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 485, in __init__
    _Distribution.__init__(
  File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 283, in __init__
    self.finalize_options()
  File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 926, in finalize_options
    ep(self)
  File "/home/abcd/piaware_builder/package-bookworm/debian/venv/lib/python3.12/site-packages/cx_Freeze/__init__.py", line 79   , in plugin_install
    validate_executables(dist, "executables", dist.executables)
  File "/home/abcd/piaware_builder/package-bookworm/debian/venv/lib/python3.12/site-packages/cx_Freeze/executable.py", line    260, in validate_executables
    executables[i] = Executable(**executable)
                     ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/abcd/piaware_builder/package-bookworm/debian/venv/lib/python3.12/site-packages/cx_Freeze/executable.py", line    45, in __init__
    self.base = base
    ^^^^^^^^^
  File "/home/abcd/piaware_builder/package-bookworm/debian/venv/lib/python3.12/site-packages/cx_Freeze/executable.py", line    84, in base
    raise OptionError(f"no base named {name!r} ({name_base!r})")
cx_Freeze.exception.OptionError: no base named 'console' ('console-cpython-312-x86_64-linux-gnu')
make[1]: *** [debian/rules:92: install_mlat-client] Error 1
make[1]: Leaving directory '/home/abcd/piaware_builder/package-bookworm'
make: *** [debian/rules:116: binary] Error 2
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
marcelotduarte commented 3 months ago

Can you change line 87 to use my build?

pip install --force --no-cache --pre --extra-index-url https://marcelotduarte.github.io/packages/ cx_Freeze

marcelotduarte commented 3 months ago

@abcd567a I installed Nooble in a VM. If I use the pre-compiled, it works (if you change line 87). The build command (line 83 not 86) is failing. I work to fix it.

marcelotduarte commented 3 months ago

You can test the patch in the latest development build (dev77): pip install --force --no-cache --pre --extra-index-url https://marcelotduarte.github.io/packages/ cx_Freeze

abcd567a commented 3 months ago

tried cx_Freeze-6.16.0.dev77 piaware .deb package built & installed successfully. fa-mlat-client gives following runtime error: ModuleNotFoundError: No module named 'asyncore'

asyncore — Asynchronous socket handler

Source code: Lib/asyncore.py

Deprecated since version 3.6, will be removed in version 3.12: The asyncore module is deprecated (see PEP 594 for details). Please use asyncio instead.


image

marcelotduarte commented 3 months ago

This error is in the client, asyncore is used in https://github.com/mutability/mlat-client/blob/master/flightaware/client/adeptclient.py

abcd567a commented 3 months ago

Thank you for your help and cooperation. I really appreciate it. I have reported this to Oliver Jowett (author of mutability/mlat-client), and he acknowledged it as quoted below: "I guess that is a fundamental incompatibility with newer python that will need a rework of the client to resolve"