Jasper_M
Jasper_M

Reputation: 1

Carla installation error: python setup.py egg_info did not run successfully. error: metadata-generation-failed

When I tried to install the Autonomous Driving simulator Carla and input the command pip3 install carla, it went wrong with the infomation as follows:

Defaulting to user installation because normal site-packages is not writeable
Collecting carla
  Using cached carla-0.9.5.tar.gz (3.9 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [8 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-_w7w01nj/carla_09d577e291614b99b70f02f9b3c3d74c/setup.py", line 114, in <module>
          ext_modules=get_libcarla_extensions(),
        File "/tmp/pip-install-_w7w01nj/carla_09d577e291614b99b70f02f9b3c3d74c/setup.py", line 31, in get_libcarla_extensions
          linux_distro = platform.dist()[0]  # pylint: disable=W1505
      AttributeError: module 'platform' has no attribute 'dist'
      [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.

Before this I followed the official instruction to input the command pip3 install --user -Iv setuptools==47.3.1. It went wrong with the infomation as follows:

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
anaconda-client 1.11.0 requires setuptools>=58.0.4, but you have setuptools 47.3.1 which is incompatible.
spyder 5.3.3 requires setuptools>=49.6.0, but you have setuptools 47.3.1 which is incompatible.

What can I do to solve this problem?

I tried to follow the error infomation to adjust the version of some dependencies as follows:

pip3 install --user -Iv pyqt5==5.15 pyqtwebengine==5.15 setuptools==58.0.4 clyent==1.2.1 nbformat==5.4.0 numpy==1.20

But it didn't work.

Upvotes: -1

Views: 1346

Answers (1)

phd
phd

Reputation: 94511

Let me copy some part from https://stackoverflow.com/a/76172450/7976758 :

The problem is, that carla does not have whl files for MacOS and 0.9.5 is the most recent version with sources attached to it. It happens to be incompatible with your python version though, as the setup.py contains code that does not work in python >=3.8, see here.

As Klaus D. has mentioned in comments, you should try to install a more recent version. For that you will have to install from github.

Thanks, @FlyingTeller ! Now my addition: install directly from Github (making pip to clone):

pip install "git+https://github.com/carla-simulator/carla#egg=carla&subdirectory=PythonAPI/carla"

Upvotes: 1

Related Questions