bitcraze / crazyflie-clients-python

Host applications and library for Crazyflie written in Python.
Other
301 stars 468 forks source link

Cfclient not getting installed on windows using both build from source and pypi package methods #670

Closed darshit-desai closed 1 year ago

darshit-desai commented 1 year ago

Errors encountered while installing cfclient on windows 10 enterprise

I tried installing using both methods and it doesn't work,

1st method using pypi package, the errors are mentioned below:

C:\Users\darshit>pip3 install cfclient
Collecting cfclient
  Downloading cfclient-2023.6-py3-none-any.whl (309 kB)
     ---------------------------------------- 309.1/309.1 kB 19.9 MB/s eta 0:00:00
Requirement already satisfied: cflib>=0.1.23 in d:\crazyflie-lib-python (from cfclient) (0.1.23)
Requirement already satisfied: appdirs~=1.4.0 in c:\users\darshit\appdata\local\packages\pythonsoftwarefoundation.python.3.11_qbz5n2kfra8p0\localcache\local-packages\python311\site-packages (from cfclient) (1.4.4)
Collecting pyzmq~=25.0 (from cfclient)
  Downloading pyzmq-25.1.0-cp311-cp311-win_amd64.whl (1.1 MB)
     ---------------------------------------- 1.1/1.1 MB 18.2 MB/s eta 0:00:00
Requirement already satisfied: pyqtgraph~=0.11 in c:\users\darshit\appdata\local\packages\pythonsoftwarefoundation.python.3.11_qbz5n2kfra8p0\localcache\local-packages\python311\site-packages (from cfclient) (0.12.4)
Collecting PyYAML~=5.3 (from cfclient)
  Downloading PyYAML-5.4.1.tar.gz (175 kB)
     ---------------------------------------- 175.1/175.1 kB ? eta 0:00:00
  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\darshit\AppData\Local\Temp\pip-build-env-2g1nhfk3\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.

              By 2023-Oct-30, you need to update your project and remove deprecated calls
              or your builds will no longer be supported.

              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\darshit\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "C:\Users\darshit\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\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\darshit\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\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\darshit\AppData\Local\Temp\pip-build-env-2g1nhfk3\overlay\Lib\site-packages\setuptools\build_meta.py", line 341, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\darshit\AppData\Local\Temp\pip-build-env-2g1nhfk3\overlay\Lib\site-packages\setuptools\build_meta.py", line 323, in _get_build_requires
          self.run_setup()
        File "C:\Users\darshit\AppData\Local\Temp\pip-build-env-2g1nhfk3\overlay\Lib\site-packages\setuptools\build_meta.py", line 338, in run_setup
          exec(code, locals())
        File "<string>", line 271, in <module>
        File "C:\Users\darshit\AppData\Local\Temp\pip-build-env-2g1nhfk3\overlay\Lib\site-packages\setuptools\__init__.py", line 107, in setup
          return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\darshit\AppData\Local\Temp\pip-build-env-2g1nhfk3\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
          return run_commands(dist)
                 ^^^^^^^^^^^^^^^^^^
        File "C:\Users\darshit\AppData\Local\Temp\pip-build-env-2g1nhfk3\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
          dist.run_commands()
        File "C:\Users\darshit\AppData\Local\Temp\pip-build-env-2g1nhfk3\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "C:\Users\darshit\AppData\Local\Temp\pip-build-env-2g1nhfk3\overlay\Lib\site-packages\setuptools\dist.py", line 1234, in run_command
          super().run_command(command)
        File "C:\Users\darshit\AppData\Local\Temp\pip-build-env-2g1nhfk3\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "C:\Users\darshit\AppData\Local\Temp\pip-build-env-2g1nhfk3\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 314, in run
          self.find_sources()
        File "C:\Users\darshit\AppData\Local\Temp\pip-build-env-2g1nhfk3\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 322, in find_sources
          mm.run()
        File "C:\Users\darshit\AppData\Local\Temp\pip-build-env-2g1nhfk3\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 551, in run
          self.add_defaults()
        File "C:\Users\darshit\AppData\Local\Temp\pip-build-env-2g1nhfk3\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 589, in add_defaults
          sdist.add_defaults(self)
        File "C:\Users\darshit\AppData\Local\Temp\pip-build-env-2g1nhfk3\overlay\Lib\site-packages\setuptools\command\sdist.py", line 104, in add_defaults
          super().add_defaults()
        File "C:\Users\darshit\AppData\Local\Temp\pip-build-env-2g1nhfk3\overlay\Lib\site-packages\setuptools\_distutils\command\sdist.py", line 251, in add_defaults
          self._add_defaults_ext()
        File "C:\Users\darshit\AppData\Local\Temp\pip-build-env-2g1nhfk3\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\darshit\AppData\Local\Temp\pip-build-env-2g1nhfk3\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. 

2nd method using build from source,

D:\>git clone https://github.com/bitcraze/crazyflie-clients-python
Cloning into 'crazyflie-clients-python'...
remote: Enumerating objects: 11489, done.
remote: Counting objects: 100% (2709/2709), done.
remote: Compressing objects: 100% (1160/1160), done.
Receiving objects: 100% (11489/11489), 16.71 MiB | 30.12 MiB/s, done.ed 8780

Resolving deltas: 100% (7876/7876), done.

D:\>cd crazyflie-clients-python

D:\crazyflie-clients-python>
D:\crazyflie-clients-python>pip3 install -e .
Obtaining file:///D:/crazyflie-clients-python
  Preparing metadata (setup.py) ... done
Requirement already satisfied: cflib>=0.1.23 in d:\crazyflie-lib-python (from cfclient==2023.6.post3+f290d52) (0.1.23)
Requirement already satisfied: appdirs~=1.4.0 in c:\users\darshit\appdata\local\packages\pythonsoftwarefoundation.python.3.11_qbz5n2kfra8p0\localcache\local-packages\python311\site-packages (from cfclient==2023.6.post3+f290d52) (1.4.4)
Collecting pyzmq~=25.0 (from cfclient==2023.6.post3+f290d52)
  Downloading pyzmq-25.1.0-cp311-cp311-win_amd64.whl (1.1 MB)
     ---------------------------------------- 1.1/1.1 MB 24.5 MB/s eta 0:00:00
Requirement already satisfied: pyqtgraph~=0.11 in c:\users\darshit\appdata\local\packages\pythonsoftwarefoundation.python.3.11_qbz5n2kfra8p0\localcache\local-packages\python311\site-packages (from cfclient==2023.6.post3+f290d52) (0.12.4)
Collecting PyYAML~=5.3 (from cfclient==2023.6.post3+f290d52)
  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\darshit\AppData\Local\Temp\pip-build-env-t0gp7m3i\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.

              By 2023-Oct-30, you need to update your project and remove deprecated calls
              or your builds will no longer be supported.

              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\darshit\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "C:\Users\darshit\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\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\darshit\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\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\darshit\AppData\Local\Temp\pip-build-env-t0gp7m3i\overlay\Lib\site-packages\setuptools\build_meta.py", line 341, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\darshit\AppData\Local\Temp\pip-build-env-t0gp7m3i\overlay\Lib\site-packages\setuptools\build_meta.py", line 323, in _get_build_requires
          self.run_setup()
        File "C:\Users\darshit\AppData\Local\Temp\pip-build-env-t0gp7m3i\overlay\Lib\site-packages\setuptools\build_meta.py", line 338, in run_setup
          exec(code, locals())
        File "<string>", line 271, in <module>
        File "C:\Users\darshit\AppData\Local\Temp\pip-build-env-t0gp7m3i\overlay\Lib\site-packages\setuptools\__init__.py", line 107, in setup
          return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\darshit\AppData\Local\Temp\pip-build-env-t0gp7m3i\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
          return run_commands(dist)
                 ^^^^^^^^^^^^^^^^^^
        File "C:\Users\darshit\AppData\Local\Temp\pip-build-env-t0gp7m3i\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
          dist.run_commands()
        File "C:\Users\darshit\AppData\Local\Temp\pip-build-env-t0gp7m3i\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "C:\Users\darshit\AppData\Local\Temp\pip-build-env-t0gp7m3i\overlay\Lib\site-packages\setuptools\dist.py", line 1234, in run_command
          super().run_command(command)
        File "C:\Users\darshit\AppData\Local\Temp\pip-build-env-t0gp7m3i\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "C:\Users\darshit\AppData\Local\Temp\pip-build-env-t0gp7m3i\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 314, in run
          self.find_sources()
        File "C:\Users\darshit\AppData\Local\Temp\pip-build-env-t0gp7m3i\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 322, in find_sources
          mm.run()
        File "C:\Users\darshit\AppData\Local\Temp\pip-build-env-t0gp7m3i\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 551, in run
          self.add_defaults()
        File "C:\Users\darshit\AppData\Local\Temp\pip-build-env-t0gp7m3i\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 589, in add_defaults
          sdist.add_defaults(self)
        File "C:\Users\darshit\AppData\Local\Temp\pip-build-env-t0gp7m3i\overlay\Lib\site-packages\setuptools\command\sdist.py", line 104, in add_defaults
          super().add_defaults()
        File "C:\Users\darshit\AppData\Local\Temp\pip-build-env-t0gp7m3i\overlay\Lib\site-packages\setuptools\_distutils\command\sdist.py", line 251, in add_defaults
          self._add_defaults_ext()
        File "C:\Users\darshit\AppData\Local\Temp\pip-build-env-t0gp7m3i\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\darshit\AppData\Local\Temp\pip-build-env-t0gp7m3i\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.
Cafeynman commented 1 year ago

after digging in this I think the issue is Python 3.10 PyYAML may not support for Python 3.10, if using python==3.8 it will be fine

ataffanel commented 1 year ago

I updated dependencies in the master branch, can you please try again to install from source?

darshit-desai commented 1 year ago

Ok I'll try it out once with 3.11.x if it doesn't work I'll make a venv with 3.8 and install it there

darshit-desai commented 1 year ago

I was able to install cfclient from the source using the latest commit, but when I tried to install/build the dev version a different error occured. It is described below:

D:\crazyflie-clients-python>pip3 install -e .[dev]
Obtaining file:///D:/crazyflie-clients-python
  Preparing metadata (setup.py) ... done
Requirement already satisfied: cflib>=0.1.23 in d:\crazyflie-lib-python (from cfclient==2023.6.post4+d387b70) (0.1.23)
Requirement already satisfied: appdirs~=1.4.0 in c:\users\darshit\appdata\local\packages\pythonsoftwarefoundation.python.3.11_qbz5n2kfra8p0\localcache\local-packages\python311\site-packages (from cfclient==2023.6.post4+d387b70) (1.4.4)
Requirement already satisfied: pyzmq~=25.0 in c:\users\darshit\appdata\local\packages\pythonsoftwarefoundation.python.3.11_qbz5n2kfra8p0\localcache\local-packages\python311\site-packages (from cfclient==2023.6.post4+d387b70) (25.1.0)
Requirement already satisfied: pyqtgraph~=0.11 in c:\users\darshit\appdata\local\packages\pythonsoftwarefoundation.python.3.11_qbz5n2kfra8p0\localcache\local-packages\python311\site-packages (from cfclient==2023.6.post4+d387b70) (0.12.4)
Requirement already satisfied: PyYAML~=6.0.1 in c:\users\darshit\appdata\local\packages\pythonsoftwarefoundation.python.3.11_qbz5n2kfra8p0\localcache\local-packages\python311\site-packages (from cfclient==2023.6.post4+d387b70) (6.0.1)
Requirement already satisfied: qasync~=0.23.0 in c:\users\darshit\appdata\local\packages\pythonsoftwarefoundation.python.3.11_qbz5n2kfra8p0\localcache\local-packages\python311\site-packages (from cfclient==2023.6.post4+d387b70) (0.23.0)
Requirement already satisfied: qtm~=2.1.1 in c:\users\darshit\appdata\local\packages\pythonsoftwarefoundation.python.3.11_qbz5n2kfra8p0\localcache\local-packages\python311\site-packages (from cfclient==2023.6.post4+d387b70) (2.1.2)
Requirement already satisfied: numpy<1.25,>=1.20 in c:\users\darshit\appdata\local\packages\pythonsoftwarefoundation.python.3.11_qbz5n2kfra8p0\localcache\local-packages\python311\site-packages (from cfclient==2023.6.post4+d387b70) (1.24.3)
Requirement already satisfied: vispy~=0.13.0 in c:\users\darshit\appdata\local\packages\pythonsoftwarefoundation.python.3.11_qbz5n2kfra8p0\localcache\local-packages\python311\site-packages (from cfclient==2023.6.post4+d387b70) (0.13.0)
Requirement already satisfied: pyserial~=3.5 in c:\users\darshit\appdata\local\packages\pythonsoftwarefoundation.python.3.11_qbz5n2kfra8p0\localcache\local-packages\python311\site-packages (from cfclient==2023.6.post4+d387b70) (3.5)
Requirement already satisfied: pyqt5~=5.15.0 in c:\users\darshit\appdata\local\packages\pythonsoftwarefoundation.python.3.11_qbz5n2kfra8p0\localcache\local-packages\python311\site-packages (from cfclient==2023.6.post4+d387b70) (5.15.9)
Requirement already satisfied: PyQt5-sip>=12.9.0 in c:\users\darshit\appdata\local\packages\pythonsoftwarefoundation.python.3.11_qbz5n2kfra8p0\localcache\local-packages\python311\site-packages (from cfclient==2023.6.post4+d387b70) (12.12.1)
Requirement already satisfied: pysdl2~=0.9.14 in c:\users\darshit\appdata\local\packages\pythonsoftwarefoundation.python.3.11_qbz5n2kfra8p0\localcache\local-packages\python311\site-packages (from cfclient==2023.6.post4+d387b70) (0.9.16)
Requirement already satisfied: pysdl2-dll==2.24.0 in c:\users\darshit\appdata\local\packages\pythonsoftwarefoundation.python.3.11_qbz5n2kfra8p0\localcache\local-packages\python311\site-packages (from cfclient==2023.6.post4+d387b70) (2.24.0)
Collecting pre-commit (from cfclient==2023.6.post4+d387b70)
  Downloading pre_commit-3.3.3-py2.py3-none-any.whl (202 kB)
     ---------------------------------------- 202.8/202.8 kB 12.0 MB/s eta 0:00:00
Collecting cx_freeze==5.1.1 (from cfclient==2023.6.post4+d387b70)
  Downloading cx_Freeze-5.1.1.tar.gz (61 kB)
     ---------------------------------------- 61.4/61.4 kB ? eta 0:00:00
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [10 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\darshit\AppData\Local\Temp\pip-install-5h6_l2n1\cx-freeze_928d044d988845e48bb14f3c030fe8ef\setup.py", line 5, in <module>
          import cx_Freeze
        File "C:\Users\darshit\AppData\Local\Temp\pip-install-5h6_l2n1\cx-freeze_928d044d988845e48bb14f3c030fe8ef\cx_Freeze\__init__.py", line 7, in <module>
          from cx_Freeze.windist import *
        File "C:\Users\darshit\AppData\Local\Temp\pip-install-5h6_l2n1\cx-freeze_928d044d988845e48bb14f3c030fe8ef\cx_Freeze\windist.py", line 1, in <module>
          import distutils.command.bdist_msi
      ModuleNotFoundError: No module named 'distutils.command.bdist_msi'
      [end of output]

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

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

D:\crazyflie-clients-python>

Also in the installation instructions there are four terminal commands which are said to be added once the build is installed

cfclient
cfheadless
cfloader
cfzmq

I am only able to launch the cfclient with the command given below, what are the ways to check other 3? (cfheadless, cfloader, cfzmq)

I am able to launch cfclient using this command given in installation instructions python3 -m cfclient.gui

ataffanel commented 1 year ago

The dev install is not to be installed anymore, did you find that in the documentation? (it was used for building a windows installer for the client, but we have given-up a while ago since it was constantly breaking ...).

As for the commands, they are installed by pip but it does not appear to be in your environment path. This seems to be a user-only install of Python 3.11, I am not sure where pip puts the scripts in that case (pip does create cfclient.exe, cfloader.exe, etc... on Windows).

The list of the script can be seen in setup.py: https://github.com/bitcraze/crazyflie-clients-python/blob/master/setup.py#L86-L89

For example, to run cfloader, you can run python -m cfloader

darshit-desai commented 1 year ago

Hi I didn't see the Dev install notice in the installation instructions. Rest of it I'm sure it works, I tried the same for Ubuntu and it was able to add the executables to the path, thank you for your help.