microsoft / AirSim

Open source simulator for autonomous vehicles built on Unreal Engine / Unity, from Microsoft AI & Research
https://microsoft.github.io/AirSim/
Other
16.31k stars 4.54k forks source link

Not able to install airsim python #4920

Open adityaomar3 opened 8 months ago

adityaomar3 commented 8 months ago

Bug report

What's the issue you encountered?

Settings

How can the issue be reproduced?

1. 2.

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 :).

Augustiu commented 7 months ago

i met the same problem,how to fix it?

Mohmansy94 commented 7 months ago

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

Garans commented 6 months ago

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="shitals@microsoft.com",
    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'
    ],
)
durach commented 6 months ago

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

Garans commented 6 months ago

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

MiguelPujol commented 5 months ago

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.

hute37 commented 3 months ago

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)"