I am still new to using ROS. I have a similar problem regarding this topic.
I am attempting to build a Python3 virtual environment to run a package that is coded in Python3, in my laptop’s ROS Melodic.
The package in question is located in this link: GitHub - osrf/autodock: ROS packages for automatic docking
My procedure is as below:
I ran the command sudo apt-get install python-catkin-tools python3-dev python3-numpy.
I ran the command sudo pip install virtualenv. However, my error message said that there was no pip. So, I ran the command sudo apt install python-pip, and then I ran the previous command.
I continued to follow the instructions in the notebook until the activation of the python3_ws.
I skipped the steps regarding installing dependencies until I ran the command “catkin_make -DPYTHON_EXECUTABLE:FILEPATH=/home/user/python3_ws/py3venv/bin/python”. However, it resulted in the following error:
CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find PythonInterp: Found unsuitable version “1.4”, but required
is at least “2” (found /home/user/python3_ws/py3venv/bin/python)
Call Stack (most recent call first):
– Configuring incomplete, errors occurred!
See also “/home/dan501mk2/python3_ws/build/CMakeFiles/CMakeOutput.log”.
Invoking “cmake” failed
I tried to follow the solutions that were available previously, such as using catkin build but to no avail. I would like to add that this isn’t my first attempt to build the virtual environment. I followed the instructions, got stuck at the exact same error as described, deleted the workspace and redo the instructions again. I deleted the package in question and redo the instructions for the virtual environment, hoping there would be some changes in the ROS behaviour, but the error still remains the same.
As far I understand the error, it appears that the virtual environment is attempting to search for the wrong Python Interpreter. However, I do not understand how it happened. Any tips?