Carla: RPC Error when trying to connect the Python API with the UE4 Editor

Created on 11 Jun 2019  Â·  23Comments  Â·  Source: carla-simulator/carla

Hi everyone,

I build the newest version of Carla (0.9.5) from source on Ubuntu 18.04.2.
After starting the Carla simulation in the UE4Editor and running the manual_control.py script, I get the following error:

Traceback (most recent call last): File "manual_control.py", line 861, in <module> main() File "manual_control.py", line 853, in main game_loop(args) File "manual_control.py", line 774, in game_loop world = World(client.get_world(), hud, args.filter, args.rolename) RuntimeError: rpc::rpc_error during call in function version

I also checked that the Ports 2000 and 2001 are free and only used by the UE4Editor.

Do you have a suggestion what might be causing this error?

Best Regards,

Paul

stale

Most helpful comment

The problem to me was that I was importing the wrong version of the API (I had several compiled ones). And it seems that the latest build method is no longer keeping the api on the path carla/PythonAPI/build/lib.linux-x86_64-3.6 which used to be standard. I am currently using the .egg file available when you create a package distribution and all seems to be working fine.

sorry I also have this problem now with latest version carla0.9.6 and I could not solve it :( so where do that keep api at the moment in new version? because it never connect to.py files even from carla examples and always get error for client.get_word(). I use python 2.7.15 as i always use this version for carla because it also has problem with python 3....

All 23 comments

Experiencing the same issue on Windows.

Some problem with the client.get_world() calling

Some problem with the client.get_world() calling

Experiencing the same issue building on master's 915e35d435203cb43ec7f462a1c.
Built on Ubuntu 17.10, UE4.22, running carla on packaged dist and API on Python3.6

It works for me on Python3.5, are you sure you built specifically for Python3.6?

It works for me on Python3.5, are you sure you built specifically for Python3.6?

I have compiled the API using make PythonAPI.3 while having a conda env with Python 3.6 activated. It worked for previous commits (cannot find the last commit it worked, but build tag was 0.9.0-1061-g18c60fba).

Does it generate the egg file with 3.6 tag?

Yes, it does.
creating 'dist/carla-0.9.5-py3.6-linux-x86_64.egg'

That's correct yes... not sure what can be causing the RPC call to fail. rpc::rpc_error during call in function version, that function returns only a string.

Could you reproduce the error?

Sorry, I don't have the bandwidth to test in Python3.6, we only support 3.5 right now.

The problem to me was that I was importing the wrong version of the API (I had several compiled ones). And it seems that the latest build method is no longer keeping the api on the path carla/PythonAPI/build/lib.linux-x86_64-3.6 which used to be standard. I am currently using the .egg file available when you create a package distribution and all seems to be working fine.

I have the same problem, but I am using Python2.7 in Ubuntu 16.04, I built Carla0.9.5 over UE4.22. Any suggestions? I also have the precompiled version installed, could that interfere somehow?

The problem to me was that I was importing the wrong version of the API (I had several compiled ones). And it seems that the latest build method is no longer keeping the api on the path carla/PythonAPI/build/lib.linux-x86_64-3.6 which used to be standard. I am currently using the .egg file available when you create a package distribution and all seems to be working fine.

sorry I also have this problem now with latest version carla0.9.6 and I could not solve it :( so where do that keep api at the moment in new version? because it never connect to.py files even from carla examples and always get error for client.get_word(). I use python 2.7.15 as i always use this version for carla because it also has problem with python 3....

There was a way to stop getting RuntimeError: rpc::rpc_error by ensuring

a.Same version of Python on all machines in n/w
b.Same version of CARLA on all machines in n/w
It worked for me, can someone please confirm that would be great ?

My setup

  • Windows local (CARLA 0.9.5- server render machine) - Python 3.7.0
  • Linux VM remote (CARLA 0.9.5- PythonAPI client manual_control.py) - Python 3.7.3

I have the same problem, but I am using Python2.7 in Ubuntu 16.04, I built Carla0.9.5 over UE4.22. Any suggestions? I also have the precompiled version installed, could that interfere somehow?

They way I solved it was generating a package with make package and then adding the .egg file in carla/Dist/CARLA_Shipping_0.9.xxx/LinuxNoEditor/PythonAPI/carla/dist/carla-0.9.x-pyX.X-linux-x86_64.egg to the python path (sys.path.append).

There was a way to stop getting RuntimeError: rpc::rpc_error by ensuring

a.Same version of Python on all machines in n/w
b.Same version of CARLA on all machines in n/w
It worked for me, can someone please confirm that would be great ?

My setup

  • Windows local (CARLA 0.9.5- server render machine) - Python 3.7.0
  • Linux VM remote (CARLA 0.9.5- PythonAPI client manual_control.py) - Python 3.7.3

Hi @adi-geek2 ,

I am trying to build the same set-up as yours on two separated laptops:
Windows (CARLA 0.9.5- server render machine) - Python 3.7.0
Linux (CARLA 0.9.5- PythonAPI client manual_control.py) - Python 3.5
After I ran:

Windows:
.\CarlaUE4.exe  -carla-server
Linux:
python3 manual_control.py --host=192.168.1.18

The linux client could not connect to the server and giving a runtime error. I've checked the bandwidth between two machines using iperf, which is around 10 Mbits/s. And I also checked connection from linux to 192.168.1.18:2000 using telnet, which is fine. Could you please kindly tell me how you set up the two machines and get it working? Thanks in advance!!

Hi ,

Did you check if there any firewall blockages ?

Best Regards,
Aditya Deshpande
+49 1782149231

On Wed, 14 Aug 2019, 01:23 cjerome0321, notifications@github.com wrote:

There was a way to stop getting RuntimeError: rpc::rpc_error by ensuring

a.Same version of Python on all machines in n/w
b.Same version of CARLA on all machines in n/w
It worked for me, can someone please confirm that would be great ?

My setup

  • Windows local (CARLA 0.9.5- server render machine) - Python 3.7.0
  • Linux VM remote (CARLA 0.9.5- PythonAPI client manual_control.py) -
    Python 3.7.3

Hi @adi-geek2 https://github.com/adi-geek2 ,

I am trying to build the same set-up as yours on two separated laptops:
Windows (CARLA 0.9.5- server render machine) - Python 3.7.0
Linux (CARLA 0.9.5- PythonAPI client manual_control.py) - Python 3.5
After I ran:

Windows:
.\CarlaUE4.exe -carla-server
Linux:
python3 manual_control.py --host=192.168.1.18

The linux client could not connect to the server and giving a runtime
error. I've checked the bandwidth between two machines using iperf, which
is around 10 Mbits/s. And I also checked connection from linux to
192.168.1.18:2000 using telnet, which is fine. Could you please kindly
tell me how you set up the two machines and get it working? Thanks in
advance!!

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/carla-simulator/carla/issues/1737?email_source=notifications&email_token=AF3CRDQC5JA6NRX3H36TVBLQEM65HA5CNFSM4HW46MD2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4HIKZI#issuecomment-521045349,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AF3CRDSFO7SZ2KJR6QA5YBTQEM65HANCNFSM4HW46MDQ
.

Hi , Did you check if there any firewall blockages ? Best Regards, Aditya Deshpande +49 1782149231
…
On Wed, 14 Aug 2019, 01:23 cjerome0321, @.*> wrote: There was a way to stop getting RuntimeError: rpc::rpc_error by ensuring a.Same version of Python on all machines in n/w b.Same version of CARLA on all machines in n/w It worked for me, can someone please confirm that would be great ? My setup - Windows local (CARLA 0.9.5- server render machine) - Python 3.7.0 - Linux VM remote (CARLA 0.9.5- PythonAPI client manual_control.py) - Python 3.7.3 Hi @adi-geek2 https://github.com/adi-geek2 , I am trying to build the same set-up as yours on two separated laptops: Windows (CARLA 0.9.5- server render machine) - Python 3.7.0 Linux (CARLA 0.9.5- PythonAPI client manual_control.py) - Python 3.5 After I ran: Windows: .\CarlaUE4.exe -carla-server Linux: python3 manual_control.py --host=192.168.1.18 The linux client could not connect to the server and giving a runtime error. I've checked the bandwidth between two machines using iperf, which is around 10 Mbits/s. And I also checked connection from linux to 192.168.1.18:2000 using telnet, which is fine. Could you please kindly tell me how you set up the two machines and get it working? Thanks in advance!! — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#1737?email_source=notifications&email_token=AF3CRDQC5JA6NRX3H36TVBLQEM65HA5CNFSM4HW46MD2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4HIKZI#issuecomment-521045349>, or mute the thread https://github.com/notifications/unsubscribe-auth/AF3CRDSFO7SZ2KJR6QA5YBTQEM65HANCNFSM4HW46MDQ .

Hi @adi-geek2 ,

Thanks for your quick reply. Now I am also getting the
RuntimeError: rpc::rpc_error during call in function version
I will try python3.7 on linux to see if it works for me.
Thanks!

[Solved, see below]

I am facing the same issue on Linux with the latest release (Carla 0.9.6) and have tried things with different python versions using a fresh virtual virtual environment with the dependencies installed. Python versions tried:

  • 2.7.16
  • 3.5.7
  • 3.6.9
  • 3.7.3

For each of these I am getting the same error as above, namely:

Traceback (most recent call last):
  File "PythonAPI/examples/manual_control.py", line 878, in <module>
    main()
  File "PythonAPI/examples/manual_control.py", line 870, in main
    game_loop(args)
  File "PythonAPI/examples/manual_control.py", line 786, in game_loop
    world = World(client.get_world(), hud, args)
RuntimeError: rpc::rpc_error during call in function version

I am using the pre-build version of the simulator and my PythonAPI/carla/dist directory contains

  • carla-0.9.6-py2.7-linux-x86_64.egg
  • carla-0.9.6-py3.5-linux-x86_64.egg

So I would assume that it should at least work with 2.7 and 3.5. Do I have to reverse-engineer the exact version of python that has been used during the build or is there any other way to do this? Have I missed any important steps? I simply followed the instructions of the documentation. That is:

  1. Downloaded 0.9.6 carla release
  2. ran the simulator using CarlaUE4.sh
  3. installed dependencies: pip install --user carla numpy pygame
  4. ran one of the examples in PythonAPI/examples/. In my case manual_control.py.

Are there any important obvious steps that I am missing. I can't find further details in the documentation on this.

Edit: found my mistake

Installing carla through pip was a bad idea in my case because the version pip installed was 0.9.5 (0.9.6 is not yet available as pointed out in #2036). I did this because my system version of python (3.7.3) complained bout the missing carla module (since for 3.7.3 the package does not have the corresponding egg file). Maybe the could error message could be a bit more informative in these cases. So if there are people with similar errors here:

1) Make sure that you are using a python version for which you have an egg file in PythonJAPI/carla/dist
2) and don't install carla through pip with the wrong version. In particular, if the system you are running has the full carla binaries (as downloaded from the release page of this repo), the correct carla module will already be part of the egg file. If you are running the python API on a client that does not have the full setup, install Carla through pip but make sure to get the version matching with you carla server. In particular, if you are using the latest release of carla the corresponding version might not yet be registered in pip.

Screenshot 2019-09-04 12:40:14

Use Pycharm and select the correct interpreter as show in image.
It should work

I realized today that dist folder and eventually the .egg files are built only on building CARLA with 'make package '. Sorry if this is repeat info, but it helped me

@nsubiron I think you can close this. Seems like everyone is realizing that the issue was on their side, not on CARLA's

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

metaluga145 picture metaluga145  Â·  4Comments

kk2491 picture kk2491  Â·  3Comments

syinari0123 picture syinari0123  Â·  4Comments

rowanmcallister picture rowanmcallister  Â·  3Comments

cstamatiadis picture cstamatiadis  Â·  3Comments