Chapter7:how to build venv(python3) on local PC?

I’m trying to build venv(python3) on my local PC to run the openai baseline.

Although I have followed the live class ‘How to use ROS with Python3’ step by setp,
after I have typed in ‘catkin_make -DPYTHON_EXECUTABLE:FILEPATH=/home/zxj/python3_ws/py3venv/bin/python’.

I got this message:

CMake Error at /opt/ros/kinetic/share/catkin/cmake/catkin_workspace.cmake:95 (message):
This workspace contains non-catkin packages in it, and catkin cannot build
a non-homogeneous workspace without isolation. Try the
‘catkin_make_isolated’ command instead.
Call Stack (most recent call first):
CMakeLists.txt:67 (catkin_workspace)

– Configuring incomplete, errors occurred!
See also “/home/zxj/python3_ws/build/CMakeFiles/CMakeOutput.log”.
See also “/home/zxj/python3_ws/build/CMakeFiles/CMakeError.log”.
Invoking “cmake” failed

And CMakeError.log :slight_smile:collect2: error:
ld returned 1 exit status
CMakeFiles/cmTC_3d131.dir/build.make:97: recipe for target ‘cmTC_3d131’ failed
make[1]: *** [cmTC_3d131] Error 1
make[1]: Leaving directory ‘/home/zxj/python3_ws/build/CMakeFiles/CMakeTmp’
Makefile:126: recipe for target ‘cmTC_3d131/fast’ failed
make: *** [cmTC_3d131/fast] Error 2

I am very confused about the result.
Would you like to tell me what’s wrong in that?
Thank you!

1 Like

@rtellez can you tak a look?

Hello, thanks for your attention. I still haven’t solved the problem.
And Would you like to tell me that has anyone ever tried the openai_ros package on the ROS Noetic?

sudo apt-get install python-catkin-tools python3-dev python3-numpy
sudo pip install virtualenv
mkdir -p python3_ws/src
cd python3_ws
virtualenv py3venv --python=python3
source ~/python3_ws/py3venv/bin/activate
cd ~/python3_ws/src/
git clone https://github.com/ros/geometry
git clone https://github.com/ros/geometry2
pip install pyaml rospkg empy catkin_pkg numpy
cd ~/python3_ws
catkin_make -DPYTHON_EXECUTABLE:FILEPATH=/home/zxj/python3_ws/py3venv/bin/python

and then

CMake Error at /opt/ros/kinetic/share/catkin/cmake/catkin_workspace.cmake:95 (message):
This workspace contains non-catkin packages in it, and catkin cannot build
a non-homogeneous workspace without isolation. Try the
‘catkin_make_isolated’ command instead.
Call Stack (most recent call first):
CMakeLists.txt:67 (catkin_workspace)

– Configuring incomplete, errors occurred!
See also “/home/zxj/python3_ws/build/CMakeFiles/CMakeOutput.log”.
See also “/home/zxj/python3_ws/build/CMakeFiles/CMakeError.log”.
Invoking “cmake” failed

I am aslo having the same problem here, did you get any luck with it?

I think you need to install dependencies. try

cd ~/python3_ws/
rosdep install --from-paths src --ignore-src -r -y
catkin_make
source devel/setup.bash