bitcraze / crazyflie-clients-python

Host applications and library for Crazyflie written in Python.
Other
310 stars 475 forks source link

python 3.12 not supported yet: Deprecated config in `setup.cfg` #687

Closed jmemon16 closed 9 months ago

jmemon16 commented 1 year ago

I am getting following error when installing cfclient. Please help.

Python 3.12

` C:>python --version Python 3.12.0

C:>pip --version pip 23.3.1 from C:\Users\engs2517\AppData\Roaming\Python\Python312\site-packages\pip (python 3.12)

C:>pip3 install cfclient Defaulting to user installation because normal site-packages is not writeable Collecting cfclient Using cached cfclient-2023.6-py3-none-any.whl.metadata (2.4 kB) Collecting cflib>=0.1.23 (from cfclient) Using cached cflib-0.1.24-py2.py3-none-any.whl.metadata (2.0 kB) Collecting appdirs~=1.4.0 (from cfclient) Using cached appdirs-1.4.4-py2.py3-none-any.whl (9.6 kB) Collecting pyzmq~=25.0 (from cfclient) Using cached pyzmq-25.1.1-cp312-cp312-win_amd64.whl.metadata (5.1 kB) Collecting pyqtgraph~=0.11 (from cfclient) Using cached pyqtgraph-0.13.3-py3-none-any.whl (960 kB) Collecting PyYAML~=5.3 (from cfclient) Using cached PyYAML-5.4.1.tar.gz (175 kB) Installing build dependencies ... done Getting requirements to build wheel ... error error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [68 lines of output] C:\Users\engs2517\AppData\Local\Temp\pip-build-env-c5fzis1h\overlay\Lib\site-packages\setuptools\config\setupcfg.py:293: _DeprecatedConfig: Deprecated config in setup.cfg !!

          ********************************************************************************
          The license_file parameter is deprecated, use license_files instead.

          This deprecation is overdue, please update your project and remove deprecated
          calls to avoid build errors in the future.

          See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
          ********************************************************************************

  !!
    parsed = self.parsers.get(option_name, lambda x: x)(value)
  running egg_info
  writing lib3\PyYAML.egg-info\PKG-INFO
  writing dependency_links to lib3\PyYAML.egg-info\dependency_links.txt
  writing top-level names to lib3\PyYAML.egg-info\top_level.txt
  Traceback (most recent call last):
    File "C:\Users\engs2517\AppData\Roaming\Python\Python312\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
      main()
    File "C:\Users\engs2517\AppData\Roaming\Python\Python312\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\engs2517\AppData\Roaming\Python\Python312\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
      return hook(config_settings)
             ^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\engs2517\AppData\Local\Temp\pip-build-env-c5fzis1h\overlay\Lib\site-packages\setuptools\build_meta.py", line 355, in get_requires_for_build_wheel
      return self._get_build_requires(config_settings, requirements=['wheel'])
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\engs2517\AppData\Local\Temp\pip-build-env-c5fzis1h\overlay\Lib\site-packages\setuptools\build_meta.py", line 325, in _get_build_requires
      self.run_setup()
    File "C:\Users\engs2517\AppData\Local\Temp\pip-build-env-c5fzis1h\overlay\Lib\site-packages\setuptools\build_meta.py", line 341, in run_setup
      exec(code, locals())
    File "<string>", line 271, in <module>
    File "C:\Users\engs2517\AppData\Local\Temp\pip-build-env-c5fzis1h\overlay\Lib\site-packages\setuptools\__init__.py", line 103, in setup
      return distutils.core.setup(**attrs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\engs2517\AppData\Local\Temp\pip-build-env-c5fzis1h\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
      return run_commands(dist)
             ^^^^^^^^^^^^^^^^^^
    File "C:\Users\engs2517\AppData\Local\Temp\pip-build-env-c5fzis1h\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
      dist.run_commands()
    File "C:\Users\engs2517\AppData\Local\Temp\pip-build-env-c5fzis1h\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
      self.run_command(cmd)
    File "C:\Users\engs2517\AppData\Local\Temp\pip-build-env-c5fzis1h\overlay\Lib\site-packages\setuptools\dist.py", line 989, in run_command
      super().run_command(command)
    File "C:\Users\engs2517\AppData\Local\Temp\pip-build-env-c5fzis1h\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
      cmd_obj.run()
    File "C:\Users\engs2517\AppData\Local\Temp\pip-build-env-c5fzis1h\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 318, in run
      self.find_sources()
    File "C:\Users\engs2517\AppData\Local\Temp\pip-build-env-c5fzis1h\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 326, in find_sources
      mm.run()
    File "C:\Users\engs2517\AppData\Local\Temp\pip-build-env-c5fzis1h\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 548, in run
      self.add_defaults()
    File "C:\Users\engs2517\AppData\Local\Temp\pip-build-env-c5fzis1h\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 586, in add_defaults
      sdist.add_defaults(self)
    File "C:\Users\engs2517\AppData\Local\Temp\pip-build-env-c5fzis1h\overlay\Lib\site-packages\setuptools\command\sdist.py", line 113, in add_defaults
      super().add_defaults()
    File "C:\Users\engs2517\AppData\Local\Temp\pip-build-env-c5fzis1h\overlay\Lib\site-packages\setuptools\_distutils\command\sdist.py", line 251, in add_defaults
      self._add_defaults_ext()
    File "C:\Users\engs2517\AppData\Local\Temp\pip-build-env-c5fzis1h\overlay\Lib\site-packages\setuptools\_distutils\command\sdist.py", line 336, in _add_defaults_ext
      self.filelist.extend(build_ext.get_source_files())
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "<string>", line 201, in get_source_files
    File "C:\Users\engs2517\AppData\Local\Temp\pip-build-env-c5fzis1h\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 107, in __getattr__
      raise AttributeError(attr)
  AttributeError: cython_sources
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

`

knmcguire commented 1 year ago

hi! Actually we have noticed issues with python 3.12 with the crazyflie library. The problem is, that we are reliaing on certain precompiled python packages, which apparently does not exist yet for 3.12 but does for 3.11. So it is still 'too new'.

Just downgrade python to 3.11 and it should work :) Hopeful soon all packages for 3.12 will catch up.

Please leave this issue open, as we can use it to remind ourselves to check every once in a while if it starts working for python 3.12

jmemon16 commented 1 year ago

I tried on python 3.11.5, pip 23.2.1. I still receive this error.

C:\Users\laengs2517>pip install cfclient Defaulting to user installation because normal site-packages is not writeable Collecting cfclient Obtaining dependency information for cfclient from https://files.pythonhosted.org/packages/16/68/febd5b0c344fd6a5c8b370fbe2de50ce7061f02b67b1d9a43eb45f342daf/cfclient-2023.6-py3-none-any.whl.metadata Using cached cfclient-2023.6-py3-none-any.whl.metadata (2.4 kB) Requirement already satisfied: cflib>=0.1.23 in c:\users\laengs2517\appdata\roaming\python\python311\site-packages (from cfclient) (0.1.24) Requirement already satisfied: appdirs~=1.4.0 in c:\users\laengs2517\appdata\roaming\python\python311\site-packages (from cfclient) (1.4.4) Requirement already satisfied: pyzmq~=25.0 in c:\users\laengs2517\appdata\roaming\python\python311\site-packages (from cfclient) (25.1.1) Requirement already satisfied: pyqtgraph~=0.11 in c:\users\laengs2517\appdata\roaming\python\python311\site-packages (from cfclient) (0.13.3) Collecting PyYAML~=5.3 (from cfclient) Using cached PyYAML-5.4.1.tar.gz (175 kB) Installing build dependencies ... done Getting requirements to build wheel ... error error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [68 lines of output] C:\Users\laengs2517\AppData\Local\Temp\pip-build-env-ss7jml_z\overlay\Lib\site-packages\setuptools\config\setupcfg.py:293: _DeprecatedConfig: Deprecated config in setup.cfg !!

          ********************************************************************************
          The license_file parameter is deprecated, use license_files instead.

          This deprecation is overdue, please update your project and remove deprecated
          calls to avoid build errors in the future.

          See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
          ********************************************************************************
krichardsson commented 1 year ago

I don't know about 3.11.5 but it works on python 3.11.2

jmemon16 commented 1 year ago

Downgraded to Python 3.11.2 but still receive the same error.

C:\Users\engs2517>python --version Python 3.11.2

C:\Users\engs2517>pip list Package Version


pip 22.3.1 setuptools 65.5.0 wheel 0.41.3

[notice] A new release of pip available: 22.3.1 -> 23.3.1 [notice] To update, run: python.exe -m pip install --upgrade pip

C:\Users\engs2517>pip install cfclient Collecting cfclient Using cached cfclient-2023.6-py3-none-any.whl (309 kB) Collecting cflib>=0.1.23 Using cached cflib-0.1.24-py2.py3-none-any.whl (189 kB) Collecting appdirs~=1.4.0 Using cached appdirs-1.4.4-py2.py3-none-any.whl (9.6 kB) Collecting pyzmq~=25.0 Using cached pyzmq-25.1.1-cp311-cp311-win_amd64.whl (1.2 MB) Collecting pyqtgraph~=0.11 Using cached pyqtgraph-0.13.3-py3-none-any.whl (960 kB) Collecting PyYAML~=5.3 Using cached PyYAML-5.4.1.tar.gz (175 kB) Installing build dependencies ... done Getting requirements to build wheel ... error error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [68 lines of output] C:\Users\engs2517\AppData\Local\Temp\pip-build-env-j3y8b63y\overlay\Lib\site-packages\setuptools\config\setupcfg.py:293: _DeprecatedConfig: Deprecated config in setup.cfg !!

          ********************************************************************************
          The license_file parameter is deprecated, use license_files instead.

          This deprecation is overdue, please update your project and remove deprecated
          calls to avoid build errors in the future.

          See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
          ********************************************************************************

  !!
    parsed = self.parsers.get(option_name, lambda x: x)(value)
  running egg_info
  writing lib3\PyYAML.egg-info\PKG-INFO
  writing dependency_links to lib3\PyYAML.egg-info\dependency_links.txt
  writing top-level names to lib3\PyYAML.egg-info\top_level.txt
  Traceback (most recent call last):
    File "C:\Users\engs2517\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 351, in <module>
      main()
    File "C:\Users\engs2517\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 333, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\engs2517\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 118, in get_requires_for_build_wheel
      return hook(config_settings)
             ^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\engs2517\AppData\Local\Temp\pip-build-env-j3y8b63y\overlay\Lib\site-packages\setuptools\build_meta.py", line 355, in get_requires_for_build_wheel
      return self._get_build_requires(config_settings, requirements=['wheel'])
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\engs2517\AppData\Local\Temp\pip-build-env-j3y8b63y\overlay\Lib\site-packages\setuptools\build_meta.py", line 325, in _get_build_requires
      self.run_setup()
    File "C:\Users\engs2517\AppData\Local\Temp\pip-build-env-j3y8b63y\overlay\Lib\site-packages\setuptools\build_meta.py", line 341, in run_setup
      exec(code, locals())
    File "<string>", line 271, in <module>
    File "C:\Users\engs2517\AppData\Local\Temp\pip-build-env-j3y8b63y\overlay\Lib\site-packages\setuptools\__init__.py", line 103, in setup
      return distutils.core.setup(**attrs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\engs2517\AppData\Local\Temp\pip-build-env-j3y8b63y\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
      return run_commands(dist)
             ^^^^^^^^^^^^^^^^^^
    File "C:\Users\engs2517\AppData\Local\Temp\pip-build-env-j3y8b63y\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
      dist.run_commands()
    File "C:\Users\engs2517\AppData\Local\Temp\pip-build-env-j3y8b63y\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
      self.run_command(cmd)
    File "C:\Users\engs2517\AppData\Local\Temp\pip-build-env-j3y8b63y\overlay\Lib\site-packages\setuptools\dist.py", line 989, in run_command
      super().run_command(command)
    File "C:\Users\engs2517\AppData\Local\Temp\pip-build-env-j3y8b63y\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
      cmd_obj.run()
    File "C:\Users\engs2517\AppData\Local\Temp\pip-build-env-j3y8b63y\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 318, in run
      self.find_sources()
    File "C:\Users\engs2517\AppData\Local\Temp\pip-build-env-j3y8b63y\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 326, in find_sources
      mm.run()
    File "C:\Users\engs2517\AppData\Local\Temp\pip-build-env-j3y8b63y\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 548, in run
      self.add_defaults()
    File "C:\Users\engs2517\AppData\Local\Temp\pip-build-env-j3y8b63y\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 586, in add_defaults
      sdist.add_defaults(self)
    File "C:\Users\engs2517\AppData\Local\Temp\pip-build-env-j3y8b63y\overlay\Lib\site-packages\setuptools\command\sdist.py", line 113, in add_defaults
      super().add_defaults()
    File "C:\Users\engs2517\AppData\Local\Temp\pip-build-env-j3y8b63y\overlay\Lib\site-packages\setuptools\_distutils\command\sdist.py", line 251, in add_defaults
      self._add_defaults_ext()
    File "C:\Users\engs2517\AppData\Local\Temp\pip-build-env-j3y8b63y\overlay\Lib\site-packages\setuptools\_distutils\command\sdist.py", line 336, in _add_defaults_ext
      self.filelist.extend(build_ext.get_source_files())
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "<string>", line 201, in get_source_files
    File "C:\Users\engs2517\AppData\Local\Temp\pip-build-env-j3y8b63y\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 107, in __getattr__
      raise AttributeError(attr)
  AttributeError: cython_sources
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

[notice] A new release of pip available: 22.3.1 -> 23.3.1 [notice] To update, run: python.exe -m pip install --upgrade pip

knmcguire commented 1 year ago

let's continue in https://github.com/orgs/bitcraze/discussions/1038 as it might not be the same error we have looked at.

kenblu24 commented 1 year ago

Hello, I've attempted installation on a fresh Windows 11 x64 machine with Python 3.12. While it is true that cfclient has dependencies which cannot be installed on Python 3.12, the end culprit is not pyyaml~=5.3. In my experience, the problem is numpy<1.25.

This should work on all systems (use admin shell or gsudo on Windows):

pip install setuptools
pip install "cython<3.0.0" wheel
pip install "pyyaml==5.4.1" --no-build-isolation

(more info)

This is for Windows 10/11 x64: Download this: https://visualstudio.microsoft.com/visual-cpp-build-tools/ Run vs_BuildTools.exe In the Individual Components tab, search for "14.0", select MSVC v140 - VS 2015 C++ build tools (v14.00) for installation, and install. This will take about 3 Gb

Download this: https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/ Run winsdksetup.exe On the "Select the features you want to download" screen, select Windows SDK for C++ amd64 Apps NB: x64. Upon selecting that, several other features will be automatically selected. Download and install.

From C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x64, copy the following three files: | rc.exe | rcdll.dll | ServicingCommon.dll

and paste them inside this directory: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64

(more info)

You should now be able to install vispy:

pip install 'vispy~0.9.0'

The following should work for Python 3.11, but not Python 3.12:

pip install tomli
pip install 'numpy<1.24'
pip install 'numpy<1.24' --no-build-isolation

Python 3.12 users may see the following: ":52: RuntimeWarning: NumPy 1.24.4 may not yet support Python 3.12."

For Python 3.11, you should now be able to run the following:

pip install cfclient