Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bridge,py: syntax error #28

Open
pantment opened this issue Sep 27, 2021 · 1 comment
Open

bridge,py: syntax error #28

pantment opened this issue Sep 27, 2021 · 1 comment

Comments

@pantment
Copy link

Hello i am trying to run bridge.py but i see this

Traceback (most recent call last):
File "run_bridge.py", line 7, in
from cyber_py import cyber
File "/apollo/cyber/python/cyber_py/cyber.py", line 26, in
from google.protobuf.descriptor_pb2 import FileDescriptorProto
File "/usr/local/lib/python2.7/dist-packages/google/protobuf/descriptor_pb2.py", line 5, in
from google.protobuf import descriptor as _descriptor
File "/usr/local/lib/python2.7/dist-packages/google/protobuf/descriptor.py", line 113
class DescriptorBase(metaclass=DescriptorMetaclass):
^
SyntaxError: invalid syntax

@marcusvinicius178
Copy link

marcusvinicius178 commented Jan 19, 2022

Hi @pantelmen probably you are facing the same issue I have experienced. To solve this you need to follow this:

In USAGE section a pyton error will occur in carla-apollo container, when trying to run the scripts. To solve this, I used the approach from here: carla-simulator/carla#1466 . It will help:

• locate .egg-files in carla_apollo_bridge/carla-python0.9.6/carla/dist/
• change/install python version in conda enviroment which fits closest to an .egg-file (for me carla-0.9.6-py3.5-linux-x86_64.egg -> 3.5)
• delete all other .egg-files (just for tidiness)
• extract your .egg-file, e.g. carla-0.9.6-py3.5-linux-x86_64

• create setup.py inside the folder (carla-0.9.6-py3.5-linux-x86_64) with the following content:
from distutils.core import setup
setup(name='carla',
      version='0.9.6', #doesn't matter I guess
      py_modules=['carla'],
      )
• then you can install the carla-python-package via pip:

pip install -e ~/carla_apollo_bridge/carla-python-0.9.6/carla/dist/carla-0.9.6-py3.5-linux-x86_64
That solved it for me. I don't even need the egg-path-appending-stuff, w

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants