hello,when I execute the command "make PythonAPI" ,I got the error as belows:
Setup.sh: llvm-5.0 already installed.
Setup.sh: boost-1.67.0 already installed.
Setup.sh: rpclib-d1146b7 already installed.
Setup.sh: googletest-1.8.0 already installed.
Setup.sh: Generating CMake configuration files.
Setup.sh: Success!
BuildLibCarla.sh: Building LibCarla "Client" configuration.
ninja: no work to do.
[1/1] Install the project...
-- Install configuration: "Client"
BuildLibCarla.sh: Success!
BuildPythonAPI.sh: Building Python API for Python 2.
compiling:
I try the commond "sudo apt-get install python-dev" ""sudo apt-get install python3-dev" ""sudo apt-get install libevent-dev" ,but it does not help.
I found the error occurs when build with Python3
Hi,
it seems that you have different versions of Python3 on your system. When building libboost, Python 3.5 was used (coming from /usr/bin/python3), whereas, when building the PythonAPI, the build system tries to use Python 3.7 (coming from /usr/bin/env python3).
You can test that by running
/usr/bin/env python3
and just
/usr/bin/python3
Most likely, the first one will report 3.7 as version, the second one 3.5.
If my guess is correct, you can try to remove the location of your local Python3.7 installation from your PATH environment. Does this work?
Best regards,
After make PythonAPI, I also got a version mismatch issue which I describe in https://github.com/carla-simulator/ros-bridge/issues/13#issue-392947489.
Hi,
it seems that you have different versions of Python3 on your system. When building libboost, Python 3.5 was used (coming from /usr/bin/python3), whereas, when building the PythonAPI, the build system tries to use Python 3.7 (coming from /usr/bin/env python3).You can test that by running
/usr/bin/env python3
and just
/usr/bin/python3
Most likely, the first one will report 3.7 as version, the second one 3.5.If my guess is correct, you can try to remove the location of your local Python3.7 installation from your PATH environment. Does this work?
Best regards,
yes锛孖t just works as you said 锛侊紒 thanks very much.
Excellent. Btw. with the new 0.9.2 release the problem should be gone. We adapted the code such that it automatically uses the correct Python. 馃憤
I guess I can close the issue?
yes. you can close the issue.
thank you very much.
gcc -pthread -shared -B /home/torquato/miniconda3/compiler_compat -L/home/torquato/miniconda3/lib -Wl,-rpath=/home/torquato/miniconda3/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.7/source/libcarla/libcarla.o -Ldependencies/lib -L/usr/lib/gcc/x86_64-linux-gnu/7 -o build/lib.linux-x86_64-3.7/carla/libcarla.cpython-37m-x86_64-linux-gnu.so /home/torquato/Desktop/carla_env/carla/PythonAPI/dependencies/lib/libcarla_client.a /home/torquato/Desktop/carla_env/carla/PythonAPI/dependencies/lib/librpc.a /home/torquato/Desktop/carla_env/carla/PythonAPI/dependencies/lib/libboost_filesystem.a /home/torquato/Desktop/carla_env/carla/PythonAPI/dependencies/lib/libboost_python37.a -lpng -ljpeg -ltiff /usr/lib/gcc/x86_64-linux-gnu/7/libstdc++.a
gcc: error: /home/torquato/Desktop/carla_env/carla/PythonAPI/dependencies/lib/libboost_python37.a: No such file or directory
error: command 'gcc' failed with exit status 1
Util/BuildTools/Linux.mk:65: recipe for target 'PythonAPI' failed
make: *** [PythonAPI] Error 1
which python
/home/torquato/miniconda3/bin/python
md5-9670465390e166a523cfa545ba32b039
python
Python 3.7.2 (default, Dec 29 2018, 06:19:36)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Using latest version pulled from the master repository gives the same error.
--edit
I even tried to remove miniconda and use the default python3.5 on ubuntu16 with nose2 installed but it didn't work either.
I managed to solve the issue through this steps.
rm -r Build/boost-*
I deleted the default configuration of miniconda in ~/.bashrc using nano or gedit
make PythonAPI
I had the same issue with 0.9.5 and UE 4.22 running Ubuntu 18.04
I ran the build with a conda python 3.7 env. Somehow it then fails to create the right libboost_python37.a files. I tried the above suggested methods and just reran make PythonAPI with a new conda 3.5 env. This doesnt work because the libboost files files are already missing. What worked for me was just deleting the whole carla folder, then creating a new conda environment with python 3.5 as default and building again. Should look something like this:
conda create --name carla_env python=3.5
conda activate carla_env
[u might want to add the UE path again for this new env : export UE4_ROOT=~/UnrealEngine_4.22 or whereever ur UE lies and what version you are using]
sudo rm -rf carla
git clone https://github.com/carla-simulator/carla
cd carla
./Update.sh
make launch
make PythonAPI
make package
hope that helps someone :)
Hi,
it seems that you have different versions of Python3 on your system. When building libboost, Python 3.5 was used (coming from /usr/bin/python3), whereas, when building the PythonAPI, the build system tries to use Python 3.7 (coming from /usr/bin/env python3).You can test that by running
/usr/bin/env python3
and just
/usr/bin/python3
Most likely, the first one will report 3.7 as version, the second one 3.5.If my guess is correct, you can try to remove the location of your local Python3.7 installation from your PATH environment. Does this work?
Best regards,
Hi, Exactly, from my part, i got 3.7 for the first one and 3.6 for the second one. But I have a lot of algos woking on both. Should I really remove one of them ?
I don't know if it helps anyone in this case but I've had similar errors due to the usage of anaconda which I managed to fix (namely, I wanted to create a virtual env using anaconda and work with the pythonAPI for carla and python3, under Ubuntu 18.04 LTS and UnrealEngine_4.22).
In order to start from a clean slate (especially if you've attempted other unsuccessful manipulations), when building carla on linux, you'll need to go to the root carla directory and execute
make clean
then delete the build folder (which is left intact after make clean is executed
rm -r Build/
Then, you have to remember the PythonAPI only support python27 and python35. What I did, which seemed to work is create a conda environment with python35 (which is the one I'm interested in using):
conda create -n carla python=3.5
conda activate carla
If I try to follow the instructions as is, however, this will not be enough. I run into issues relating to the inability to find pyconfig.h (but only for python35 for some reason). So I ended up following this explanation here which overall just suggests to locate the pyconfig.h file for anaconda and run:
export CPLUS_INCLUDE_PATH="$CPLUS_INCLUDE_PATH:path/to/your/Anaconda3/include/python3.7m"
(yes, for some reason, the 3.7 works).
I could then run (-j16 is for multithreading):
make launch -j16
and then (you may attempt -j16 if you want)
make PythonAPI
make package -j16
And then I don't have any issues with compilation anymore.
I tried cleaning the build and tried
export CPLUS_INCLUDE_PATH="$CPLUS_INCLUDE_PATH:path/to/your/Anaconda3/include/python3.7m"
and then building again.
I got
carla/PythonAPI/carla/dependencies/lib/libboost_python35.a: No such file or directory
I also checked
You can test that by running
/usr/bin/env python3
and just
/usr/bin/python3
Both versions are the same for me (when I remove conda from my bash).
I don't know if it helps anyone in this case but I've had similar errors due to the usage of anaconda which I managed to fix (namely, I wanted to create a virtual env using anaconda and work with the pythonAPI for carla and python3, under Ubuntu 18.04 LTS and UnrealEngine_4.22).
In order to start from a clean slate (especially if you've attempted other unsuccessful manipulations), when building carla on linux, you'll need to go to the root carla directory and execute
make clean
then delete the build folder (which is left intact after make clean is executed
rm -r Build/
Then, you have to remember the PythonAPI only support python27 and python35. What I did, which seemed to work is create a conda environment with python35 (which is the one I'm interested in using):
conda create -n carla python=3.5
conda activate carlaIf I try to follow the instructions as is, however, this will not be enough. I run into issues relating to the inability to find pyconfig.h (but only for python35 for some reason). So I ended up following this explanation here which overall just suggests to locate the pyconfig.h file for anaconda and run:
export CPLUS_INCLUDE_PATH="$CPLUS_INCLUDE_PATH:path/to/your/Anaconda3/include/python3.7m"
(yes, for some reason, the 3.7 works).
I could then run (-j16 is for multithreading):
make launch -j16
and then (you may attempt -j16 if you want)
make PythonAPI
make package -j16And then I don't have any issues with compilation anymore.
I solve the problem with this way. Thank you very much.
I get these problems as well but already when making launch.
I'm running Ubuntu 18.04 LTS,
no anaconda,
/usr/bin/env python3 gives me 3.5,
/usr/bin/python3 gives me 3.6
running make launch crashes on "Setup.sh: Extracting boost for Python 3" with "fatal error: 'pyconfig.h' file not found"
running make PythonAPI results in "gcc: error: /home/tum-vt/carla/PythonAPI/carla/dependencies/lib/libboost_python35.a: No such file or directory"
I have tried all kinds of paths for "export CPLUS_INCLUDE_PATH="$CPLUS_INCLUDE_PATH" but nothing seems to work
I have no idea what to do anymore. I'd favor to build Carla with python3.5 and the sole purpose of the computer I'm working on is to run Carla. Can you please help me
Also having the same issue, having tried all the same steps above^
I was now able to fix this by taking a closer look at the errors that are thrown when pyconfig.h could not be found. In my case clang was looking at the wrong path. It looked for pyconfig.h in usr/include/python3.5 while I only had a usr/include/python3.5m directory. My very ugly solution was to rename the folder and create a link to it at the same place with the old name.
My guess is that there should be a clang config file where one could change the path for python3 but I have not looked into it.
@papabst Did you get past the issue with make PythonAPI? I was also able to get make launch working by adding the anaconda python3.5m file to the CPLUS_INCLUDE_PATH but it still didn't help with the second libboost_python35.a error that comes when you try to build PythonAPI. Weirdly enough the setup script runs through without (noticeable) errors and compiles boost for python 2.7 but not 3.5.
@KShah707
Here is my solution. It seems the problem occours when using anaconda:
gcc: error: _[carla_repository_folder]_/carla/PythonAPI/carla/dependencies/lib/libboost_python37.a: No such file or directory
error: command 'gcc' failed with exit status 1
Util/BuildTools/Linux.mk:83: recipe for target 'PythonAPI' failed
make: * [PythonAPI] Error 1
cd ~/anaconda3/envs/_[your_anaconda_enviroenment_name]_/lib
cp libboost* _[carla_repository_folder]_/carla/PythonAPI/carla/dependencies/lib
Most helpful comment
I don't know if it helps anyone in this case but I've had similar errors due to the usage of anaconda which I managed to fix (namely, I wanted to create a virtual env using anaconda and work with the pythonAPI for carla and python3, under Ubuntu 18.04 LTS and UnrealEngine_4.22).
In order to start from a clean slate (especially if you've attempted other unsuccessful manipulations), when building carla on linux, you'll need to go to the root carla directory and execute
then delete the build folder (which is left intact after make clean is executed
Then, you have to remember the PythonAPI only support python27 and python35. What I did, which seemed to work is create a conda environment with python35 (which is the one I'm interested in using):
If I try to follow the instructions as is, however, this will not be enough. I run into issues relating to the inability to find pyconfig.h (but only for python35 for some reason). So I ended up following this explanation here which overall just suggests to locate the pyconfig.h file for anaconda and run:
(yes, for some reason, the 3.7 works).
I could then run (-j16 is for multithreading):
and then (you may attempt -j16 if you want)
And then I don't have any issues with compilation anymore.