AirSim icon indicating copy to clipboard operation
AirSim copied to clipboard

Not able to install airsim python

Open adityaomar3 opened this issue 1 year ago • 9 comments

Bug report

  • AirSim Version/#commit:
  • UE/Unity version:
  • autopilot version:
  • OS Version:

What's the issue you encountered?

Settings

How can the issue be reproduced?

Include full error message in text form

pip install airsim Collecting airsim Using cached airsim-1.8.1.tar.gz (20 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 ╰─> [27 lines of output] Traceback (most recent call last): File "C:\Python312\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 353, in main() File "C:\Python312\Lib\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:\Python312\Lib\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\Omar\AppData\Local\Temp\pip-build-env-p10yc3u8\overlay\Lib\site-packages\setuptools\build_meta.py", line 325, in get_requires_for_build_wheel return self._get_build_requires(config_settings, requirements=['wheel']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Omar\AppData\Local\Temp\pip-build-env-p10yc3u8\overlay\Lib\site-packages\setuptools\build_meta.py", line 295, in _get_build_requires self.run_setup() File "C:\Users\Omar\AppData\Local\Temp\pip-build-env-p10yc3u8\overlay\Lib\site-packages\setuptools\build_meta.py", line 480, in run_setup super(BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script) File "C:\Users\Omar\AppData\Local\Temp\pip-build-env-p10yc3u8\overlay\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup exec(code, locals()) File "", line 2, in File "C:\Users\Omar\AppData\Local\Temp\pip-install-7xlbe5zy\airsim_52dcecb4260c4b7aa1dbabc16a8c5fea\airsim_init.py", line 1, in from .client import * File "C:\Users\Omar\AppData\Local\Temp\pip-install-7xlbe5zy\airsim_52dcecb4260c4b7aa1dbabc16a8c5fea\airsim\client.py", line 3, in from .utils import * File "C:\Users\Omar\AppData\Local\Temp\pip-install-7xlbe5zy\airsim_52dcecb4260c4b7aa1dbabc16a8c5fea\airsim\utils.py", line 1, in import numpy as np #pip install numpy ^^^^^^^^^^^^^^^^^^ [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 is available: 23.2.1 -> 23.3.2 [notice] To update, run: python.exe -m pip install --upgrade pip PS C:\project\photogrammetry> pip install airsim Collecting airsim Using cached airsim-1.8.1.tar.gz (20 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 ╰─> [27 lines of output] Traceback (most recent call last): File "C:\Python312\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 353, in main() File "C:\Python312\Lib\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:\Python312\Lib\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\Omar\AppData\Local\Temp\pip-build-env-gfvytytx\overlay\Lib\site-packages\setuptools\build_meta.py", line 325, in get_requires_for_build_wheel return self._get_build_requires(config_settings, requirements=['wheel']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Omar\AppData\Local\Temp\pip-build-env-gfvytytx\overlay\Lib\site-packages\setuptools\build_meta.py", line 295, in _get_build_requires self.run_setup() File "C:\Users\Omar\AppData\Local\Temp\pip-build-env-gfvytytx\overlay\Lib\site-packages\setuptools\build_meta.py", line 480, in run_setup super(BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script) File "C:\Users\Omar\AppData\Local\Temp\pip-build-env-gfvytytx\overlay\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup exec(code, locals()) File "", line 2, in File "C:\Users\Omar\AppData\Local\Temp\pip-install-4likky2c\airsim_997319d56f7d48fca1814ce8fe1b6524\airsim_init.py", line 1, in from .client import * File "C:\Users\Omar\AppData\Local\Temp\pip-install-4likky2c\airsim_997319d56f7d48fca1814ce8fe1b6524\airsim\client.py", line 3, in from .utils import * File "C:\Users\Omar\AppData\Local\Temp\pip-install-4likky2c\airsim_997319d56f7d48fca1814ce8fe1b6524\airsim\utils.py", line 1, in import numpy as np #pip install numpy ^^^^^^^^^^^^^^^^^^ ModuleNotFoundError: No module named 'numpy' [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.

It is not able to install airsim even numpy is already installed What's better than filing an issue? Filing a pull request :).

adityaomar3 avatar Jan 28 '24 22:01 adityaomar3

i met the same problem,how to fix it?

Augustiu avatar Feb 06 '24 08:02 Augustiu

Try to use python version 3.8, it should work without any problem.

Mohmansy94 avatar Feb 07 '24 23:02 Mohmansy94

I used version 3.8 but met the same problem, for solved this issue I patched setup.py and install local package pip install .


import setuptools
# from airsim import __version__

with open("README.md", "r") as fh:
    long_description = fh.read()

setuptools.setup(
    name="airsim",
    version="1.8.1",
    author="Shital Shah",
    author_email="[email protected]",
    description="Open source simulator based on Unreal Engine for autonomous vehicles from Microsoft AI & Research",
    long_description=long_description,
    long_description_content_type="text/markdown",
    url="https://github.com/microsoft/airsim",
    packages=setuptools.find_packages(),
	license='MIT',
    classifiers=(
        "Programming Language :: Python :: 3",
        "License :: OSI Approved :: MIT License",
        "Operating System :: OS Independent",
    ),
    install_requires=[
          'msgpack-rpc-python', 'numpy', 'opencv-contrib-python'
    ],
)

Garans avatar Mar 11 '24 20:03 Garans

@Garans, thanks, that helped. But I experience the issue only in pyenv (Mac). Everything worked fine on conda (Win)

durach avatar Mar 13 '24 10:03 durach

I'm using this lib with remote connect from Mac to win

Garans avatar Mar 13 '24 10:03 Garans

I have the same issue when trying to install airsim python package version 1.6.0, 1.7.0 and 1.8.1 (latest) using Python 3.12. However I did manage to successfully install version 1.5.0.

Update: I ran into issues running the client.simGetImages() with airsim 1.5.0. Eventually I just downloaded the airsim 1.8.1 python package and installed it manually (instead of pip) by opening command prompt in the downloaded airsim package and running "python setup.py install". Now I am able to use airsim without problems.

MiguelPujol avatar Apr 10 '24 09:04 MiguelPujol

same hrere for a python 3.9, poetry project (tf 2.5, airsim 1.8.1)

It seems to work with this workaround


poetry lock
poetry install  # airsim fail with missing numpy dependency
 
poetry shell    # inlcude numpy in setuptools (build) path
  
pip install "airsim (==1.8.1)"

hute37 avatar Jun 14 '24 15:06 hute37