diff --git a/Docs/build_faq.md b/Docs/build_faq.md index 160cf4991..a99af7658 100644 --- a/Docs/build_faq.md +++ b/Docs/build_faq.md @@ -104,6 +104,59 @@ make PythonAPI.docs + +
+
+ Cannot run example scripts or "RuntimeError: rpc::rpc_error during call in function version" +
+ +![faq_rpc_error](img/faq_rpc_error.jpg) + +If running a script returns an output similar to this, there is a problem with the `.egg` file in the PythonAPI. + +First of all, open `/PythonAPI/carla/dist`. There should be an `.egg` file for the corresponding CARLA and Python version you are using (similar to `carla-0.X.X-pyX.X-linux-x86_64.egg`). Make sure the file matches the Python version you are using. To check your Python version use the following command. + +```sh +python3 --version # CARLA no longer provides support for Python2, so we are dismissing it here +``` + +If either the file is missing or you think it could be corrupted, try rebuilding again. +```sh +make clean +make PythonAPI +make launch +``` +Now try one of the example scripts again. + +```sh +cd PythonAPI/examples +python3 dynamic_weather.py +``` + +If the error persists, the problem is probably related with your PythonPATH. These scripts automatically look for the `.egg` file associated with the build, so maybe there is any other `.egg` file in your PythonPATH interfering with the process. Show the content of the PythonPATH with the following command. + +```sh +python -c "import sys; print('\n'.join(sys.path))" +``` +Look up in the output for other instances of `.egg` files in a route similar to `PythonAPI/carla/dist`, and get rid of these. They probably belong to other instances of CARLA installations. + +Ultimately there is the option to add the `.egg` file of your build to the PythonPATH using the `~/.bashrc`. This is not the recommended way, as the path will need an update for every new release. + +First, open the `~/.bashrc`. +```sh +gedit ~/.bashrc +``` +Edit the following line to match your CARLA and Python version. In other words, change `carla-0.9.10-py3.6-linux-x86_64.egg` for the name of your `.egg` file. +``` +export PYTHONPATH=$PYTHONPATH:${CARLA_ROOT}/PythonAPI/carla/dist/carla-0.9.10-py3.6-linux-x86_64.egg:${CARLA_ROOT}/PythonAPI/carla/agents:${CARLA_ROOT}/PythonAPI/carla +``` +Add the line to the `~/.bashrc`, save the file, and reset the terminal for changes to be effective. + +After cleaning the PythonPATH or adding the path to the new `.egg` file, all the example scripts should work properly. + +
+ + --- ## Windows build diff --git a/Docs/img/faq_rpc_error.jpg b/Docs/img/faq_rpc_error.jpg new file mode 100644 index 000000000..55233715e Binary files /dev/null and b/Docs/img/faq_rpc_error.jpg differ