# quick gist to accompany post on building ROS Melodic w/python3 support | |
# https://www.miguelalonsojr.com/blog/robotics/ros/python3/2019/08/20/ros-melodic-python-3-build.html | |
# Warning: don't try to run this as a script. It probably won't work. | |
# remove all things python (optional) | |
sudo apt-get remove python-* | |
# remove previous installations of ROS | |
sudo apt-get remove ros-* | |
sudo apt-get remove ros-melodic-* | |
sudo apt-get autoremove | |
# setup python3 dependencies | |
sudo apt update | |
sudo apt install -y python3 python3-dev python3-pip build-essential | |
sudo -H pip3 install rosdep rospkg rosinstall_generator rosinstall wstool vcstools catkin_tools catkin_pkg | |
# initializ catkin build environment | |
sudo rosdep init | |
rosdep update | |
cd ~ | |
mkdir ros_catkin_ws | |
cd ros_catkin_ws | |
# TODO: get rqt_rviz rviz_plugin_tutorials librviz_tutorial building w/python3 | |
catkin config --init -DCMAKE_BUILD_TYPE=Release --blacklist rqt_rviz rviz_plugin_tutorials librviz_tutorial --install | |
# setup ROS install | |
rosinstall_generator desktop_full --rosdistro melodic --deps --tar > melodic-desktop-full.rosinstall | |
wstool init -j8 src melodic-desktop-full.rosinstall | |
# if packages fail to download, run the following | |
wstool update -j4 -t src | |
# setup environment and install dependencies | |
export ROS_PYTHON_VERSION=3 | |
pip3 install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-18.04 wxPython | |
# create the following script in the ros_catkin_ws directory and call it install_skip | |
#!/bin/bash | |
#Check whether root | |
if [ $(whoami) != root ]; then | |
echo You must be root or use sudo to install packages. | |
return | |
fi | |
#Call apt-get for each package | |
for pkg in "$@" | |
do | |
echo "Installing $pkg" | |
sudo apt-get -my install $pkg >> install.log | |
done | |
# and chmod it | |
chmod +x install_skip | |
# sed magic | |
sudo ./install_skip `rosdep check --from-paths src --ignore-src | grep python | sed -e "s/^apt\t//g" | sed -z "s/\n/ /g" | sed -e "s/python/python3/g"` | |
rosdep install --from-paths src --ignore-src -y --skip-keys="`rosdep check --from-paths src --ignore-src | grep python | sed -e "s/^apt\t//g" | sed -z "s/\n/ /g"`" | |
find . -type f -exec sed -i 's/\/usr\/bin\/env[ ]*python/\/usr\/bin\/env python3/g' {} + | |
# build ROS | |
catkin build | |
This comment has been minimized.
This comment has been minimized.
@zzh112119 Do you have another version of rosrun installed, perhaps the standard melodic install? You may want to check your paths to make sure which rosrun is being used if that's the case. Also, is the shebang in pytalker.py using python3? Also check genpy's message.py. It should be using python3 not python2. I recall seeing this issue in the past and it was related to the shebang. |
This comment has been minimized.
This comment has been minimized.
Everything worked great until I tried to build it! [build] Summary: 0 of 204 packages succeeded. [build] Ignored: 33 packages were skipped or are blacklisted. [build] Warnings: None. [build] Abandoned: 203 packages were abandoned. [build] Failed: 1 packages failed. [build] Runtime: 2.7 seconds total. Exception ignored in: <bound method BaseEventLoop.__del__ of <_UnixSelectorEventLoop running=False closed=True debug=False>> Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/trollius/base_events.py", line 395, in __del__ File "/usr/local/lib/python3.6/dist-packages/trollius/unix_events.py", line 65, in close File "/usr/local/lib/python3.6/dist-packages/trollius/unix_events.py", line 166, in remove_signal_handler File "/usr/lib/python3.6/signal.py", line 47, in signal TypeError: signal handler must be signal.SIG_IGN, signal.SIG_DFL, or a callable object What could have happened? this is on a fresh install of ubuntu. |
This comment has been minimized.
This comment has been minimized.
@Antietam , please post the error received for the package that failed to build. Also, be sure to read the blog post https://www.miguelalonsojr.com/blog/robotics/ros/python3/2019/08/20/ros-melodic-python-3-build.html and follow the instructions there. |
This comment has been minimized.
This comment has been minimized.
@zzh112119 Also, if you post the python script that you are trying to run, I can try to see what's going on. |
This comment has been minimized.
This comment has been minimized.
@drmaj The link you shared is broken. I re-fresh-installed ubuntu and have only followed your guide. I get to catkin build and it seems to fail on different packages everytime. the most common on it fails on it the dynamic_reconfigure Errors << dynamic_reconfigure:make /home/jacobksu/ros_catkin_ws/logs/dynamic_reconfigure/build.make.004.log Traceback (most recent call last): File "/home/jacobksu/ros_catkin_ws/src/dynamic_reconfigure/cfg/Test.cfg", line 37, in <module> from dynamic_reconfigure.parameter_generator_catkin import * File "/home/jacobksu/ros_catkin_ws/devel/.private/dynamic_reconfigure/lib/python3/dist-packages/dynamic_reconfigure/__init__.py", line 35, in <module> exec(__fh.read()) File "<string>", line 38, in <module> File "/home/jacobksu/ros_catkin_ws/install/lib/python3/dist-packages/roslib/__init__.py", line 50, in <module> from roslib.launcher import load_manifest File "/home/jacobksu/ros_catkin_ws/install/lib/python3/dist-packages/roslib/launcher.py", line 42, in <module> import rospkg ImportError: No module named rospkg make[2]: *** [/home/jacobksu/ros_catkin_ws/devel/.private/dynamic_reconfigure/include/dynamic_reconfigure/TestConfig.h] Error 1 make[1]: *** [CMakeFiles/dynamic_reconfigure_gencfg.dir/all] Error 2 make: *** [all] Error 2 cd /home/jacobksu/ros_catkin_ws/build/dynamic_reconfigure; catkin build --get-env dynamic_reconfigure | catkin env -si /usr/bin/make --jobserver-fds=3,4 -j; cd - ............................................................................... Failed << dynamic_reconfigure:make [ Exited with code 2 ] thanks again! |
This comment has been minimized.
This comment has been minimized.
@drmaj I was actually able to find out the problematic shebang in my own code.. And yes! ROS seems to be working properly with python3 env and code! (I installed ros_base instead of desktop_full version tho) But I noticed that during the step |
This comment has been minimized.
This comment has been minimized.
@zzh112119 It seems like the only way is to a) build boost against python3 from scratch b) ignore the dependencies when installing boost, or c) use |
This comment has been minimized.
This comment has been minimized.
When i use I get this error : "
" |
This comment has been minimized.
This comment has been minimized.
@MYComodo It seems like you have a different version of rosdep on your path. My rosdep with this build is under /usr/local/bin. Also, you can't just run rosdep. It will try to use the default melodic apt packages. You should use the following:
where [COMMAND] is what you want to do with rosdep, e.g. install, update, check, etc. This will skip all of the python based package dependencies. You'll then have to satisfy those dependencies manually by cloning those ros packages into your workspace and building them along with your packages. It's the only way I've found to reliably use ros with python3. Hopefully, with the next ros release, this won't be an issue any longer, since python is reaching end of life in 2020. |
This comment has been minimized.
This comment has been minimized.
i tried this code but it did not work. In my OS i am still using python3 and i have python2 too. This python3 can be the problem for this issue. Should i delete python3 too? |
This comment has been minimized.
This comment has been minimized.
No, this technique requires a python3 installation. If anything, you should remove python2, not python3. the problem seems to be the version of rosdep that you have installed. You should remove any old setup for ros, remove python2, and then try again. |
This comment has been minimized.
This comment has been minimized.
I'm trying to create a docker image using your instructions. And I have several problems:
But after checking the logs and manual installation it seems that everything is installed correctly... Is this a mistake?
All actions were performed in a container based on pure ubuntu:latest image. And I'm trying to build ROS-Comm (Bare Bones) This is my script:
I will be very grateful for help in this matter! |
This comment has been minimized.
This comment has been minimized.
I too ran into the python33 errors like in the previous comment. Without digging fulling into what strings are being replaced, perhaps tweaking @kiselevsky: I believe your issue (1) may be due to |
This comment has been minimized.
This comment has been minimized.
Installing boost with python3 from source works! A few additional errors that I faced along with their solutions are given in following: AttributeError: 'bytes' object has no attribute 'read' runtime error on running roscore. I'm not sure why this happens, but I believe the previous version of shlex required bytestrings to be passed to its functions which now require simple strings. So I just removed the conversion from string to bytestring wherever shlex split() function was used raising this error. The files that I updated are following:
One addition that I did while building the source files was that I didn't only replace the shebangs but used the 2to3 automated python script for converting all the source files to python3. There were a few files with wrong print syntaxes that were easily fixed with the script. The script can be called as follows.
|
This comment has been minimized.
This comment has been minimized.
Any updates here on a resolution? We're trying to do the same thing and ran into the same problem, except we're building with |
This comment has been minimized.
This comment has been minimized.
Unfortunatley I don't have a dockerfile handy, but I did get to the point where I had a better understanding of how to get a python3 package to build. The key thing that I did was to do it in docker: (1) started from the ubuntu:18.04 base image (2) figure out what dependencies were needed while (3) working towards building the base ros packages from source with the -DPYTHON_VERSION=3 flag, (4) then sourcing this python3-built workspace and building my workspace of interest, again with the -DPYTHON_VERSION=3 flag. |
This comment has been minimized.
This comment has been minimized.
I completed all the ROS build, when catkin_make was called, I got the below error.
has anyone solved this problem? |
This comment has been minimized.
This comment has been minimized.
build success. setting /run_id to a19b38b4-4f0e-11ea-95bf-e8d8d16102f5 |
This comment has been minimized.
This comment has been minimized.
I know this goes against the thread but for anyone who wants to use ROS with python3 its better to just build your own project with python3 instead of building the whole ROS. You can build any project with -DPYTHON_VERSION=3 and ROS_PYTHON_VERSION=3. If you want to use anything that depends on python3, just rebuild that specific package with python3 as well. I tried this solution and it worked but I had to rebuild every project every time which was not worth it. Instead, when I just built my own project with python3 it worked completely well with original ros, meaning there are no conflicts running python3 and ros together since internally ros is already updated to work with python3 when you set the flag ROS_PYTHON_VERSION=3. Cheers. |
This comment has been minimized.
This comment has been minimized.
Can you elaborate by what you mean? I am not sure of the process. |
This comment has been minimized.
This comment has been minimized.
I will just list down the steps (tested on ROS/melodic Ubuntu 18.04):
|
This comment has been minimized.
This comment has been minimized.
Thanks for your time. I did try the above steps, and I got the below error
I guess the package has lot of dependencies which could not be resolved. I tried tracing back to all the dependency but it is a huge mess. |
This comment has been minimized.
This comment has been minimized.
@drmaj Thank you for the detailed explanation. The ROS team has started migrating towards python3 (for melodic on Ubuntu 18.04) which has caused an error in your Changing the In the sed magic section on your blog you state:
Using exact match also allows the command to be run multiple times without any problems. No need to warn users to "Be sure to only run this once." The modified
|
This comment has been minimized.
This comment has been minimized.
@sharp-developer, thank you for the script, it helps! By the way do you have a timeline about the ROS python2->python3 migration? I'm trying to use the |
This comment has been minimized.
This comment has been minimized.
@yuanzhedong Glad I could help! I ended up reverting back as I also ran into various issues. It's my understanding that the ROS Noetic will target only Python 3. It is scheduled to be released on May 23rd, 2020. |
This comment has been minimized.
This comment has been minimized.
@sharp-developer |
This comment has been minimized.
This comment has been minimized.
Noob here. Trying to run
I am trying to follow the instructions on a Raspberry Pi running Raspbian Buster Lite and had previously installed Ros Melodic from source according to this tutorial. Before trying the instructions above, I simply deleted my existing ros_catkin_ws and catkin_ws. Thank you very much for any help! |
This comment has been minimized.
This comment has been minimized.
@AabedSolayman @nkueng I was able to get through the entire process with the following changes (if my memory serves me correctly)
I started with a clean install of Ubuntu 18.04 (virtual machine) That being said I ended up abandoning this build because I ran into more issues after finishing the build. Given the fact that Python 3 support will be available in just a few months in the next ROS release it wasn't worth the trouble. |
This comment has been minimized.
This comment has been minimized.
I got the same errors as @antietam76, when performing
and so on for all 204 packages until the error summary:
So after installing
I'm on Ubuntu 18.04.4 LTS |
This comment has been minimized.
This comment has been minimized.
I am at the same step. What I did here was removed all occurrences of "--install-layout=deb " in the "python_distutils_install.sh" files.
|
This comment has been minimized.
This comment has been minimized.
Just a guess but are you installing the python3 versions? If using apt to install |
This comment has been minimized.
This comment has been minimized.
# ensure there are no ros packages
sudo apt-get remove --autoremove ros-*
# check for updates
sudo apt update
# ensure /etc/ros removal
sudo rm -rf /etc/ros/
# install the python3 libraries
sudo apt install -y python3 python3-dev python3-pip build-essential
# Remove python2
sudo apt purge -y python2.7-minimal
# link python -> python3
sudo ln -s /usr/bin/python3 /usr/bin/python
# Same for pip
sudo ln -s /usr/bin/pip3 /usr/bin/pip
# install the ros dependencies
sudo -H pip3 install --no-cache-dir --ignore-installed rosdep rospkg rosinstall_generator rosinstall wstool vcstools catkin_tools catkin_pkg
# initialize catkin build environment
sudo rosdep init && rosdep update
# create catkin workspace
mkdir -p ~/ros_catkin_ws/src && cd "$_/.."
# initialize catkin workspace (will show warning about Extending... ignore that)
catkin config --init -DCMAKE_BUILD_TYPE=Release --blacklist rqt_rviz rviz_plugin_tutorials librviz_tutorial --install
# generate a ros melodic install
rosinstall_generator desktop_full --rosdistro melodic --deps --tar > melodic-desktop-full.rosinstall
# initialize the install
wstool init -j8 src melodic-desktop-full.rosinstall
# setup environment and isntall dependencies
export ROS_PYTHON_VERSION=3
# install wxPython
pip3 install -U -f --no-cache-dir --ignore-installed https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-18.04 wxPython
# create install_skip file
printf '#/bin/bash\nif [ $(whoami) != root ]; then\n echo You must be root or use sudo to install packages.\n return\nfi\n\nfor pkg in "$@"\ndo\n echo "Installing $pkg"\n sudo apt-get -my install $pkg >> install.log\ndone' > install_skip
# make file executable
chmod +x install_skip
# install python 3 packages
sudo ./install_skip `rosdep check --from-paths src --ignore-src | grep python | sed -e "s/^apt\t//g" | sed -z "s/\n/ /g" | sed -e "s/\<python\>/python3/g"`
# skip python 2 packages
rosdep install --from-paths src --ignore-src -y --skip-keys="`rosdep check --from-paths src --ignore-src | grep python | sed -e "s/^apt\t//g" | sed -z "s/\n/ /g"`"
# rename all old python links to python3
find . -type f -exec sed -i 's/\/usr\/bin\/env[ ]*\<python\>/\/usr\/bin\/env python3/g' {} +
# build ros
catkin build
# export python path
export PYTHONPATH=/usr/lib/python3/dist-packages
# source setup
source ~/ros_catkin_ws/install/setup.bash Running this worked for me. |
This comment has been minimized.
This comment has been minimized.
@sharpe-developer, yes you were right, but when I installed python3-empy, and it didn't change anything. @metalglove, this line gave this error:
Not sure what that was I continued. Everything was fine up to
It says it can't find python3-empy, but it loks like it is installed and sits comfortably in |
This comment has been minimized.
This comment has been minimized.
@yev-d I could have tempered with that line last-minute... remove --no-cache-dir and --ignore-installed.
|
This comment has been minimized.
This comment has been minimized.
@metalglove, that line worked, thanks! But the |
This comment has been minimized.
This comment has been minimized.
@yev-d Did you run my complete script? what does the catkin build error show? |
This comment has been minimized.
This comment has been minimized.
@metalglove, yup. Everything was fine except catkin build and this little thing.
it doesn't find
Then as I come to catkin build command, this comes out:
|
This comment has been minimized.
This comment has been minimized.
@yev-d Ah. "E: Unable to locate package python3-wxtools" makes sense, since we install it using the pip3 command above. And, the script changes all the python references to python3 hence it trying to install python3-wxtools. This can be ignored. Try I am currently not at my Ubuntu machine. Tomorrow I will spin up a new VM and run the complete script and check if I missed something in the script. |
This comment has been minimized.
This comment has been minimized.
@metalglove, yeah, after installing
Yeah, no worries, take your time. I'm gonna look for a support group for Emotionally-Defeated-by-ROS-Installation-Anonymous group. |
This comment has been minimized.
This comment has been minimized.
Oh, I know how to fix that error! --install-layout=deb needs to be removed from all the generated installs scripts. |
This comment has been minimized.
This comment has been minimized.
@metalglove, nice! it solved THAT problem, and even started installing bunch of packages. But it failed miserably with 592 lines of errors for bunch of packages. |
This comment has been minimized.
This comment has been minimized.
I've installed a new OS with Ubuntu 18.04.4, and I ran all the code that @metalglove commented above
To this one:
So now that this is done, how can I make sure that it works? After so many failed attempts I have my doubts. Also, |
This comment has been minimized.
This comment has been minimized.
@yev-d conda uses its own python environment. Hence you will not be able to call roscore. you have to do this each time. You can add that last line to your .bashrc and comment the anaconda lines there. |
This comment has been minimized.
This comment has been minimized.
The complete script for installing ROS with python3.
|
This comment has been minimized.
This comment has been minimized.
@metalglove, Just to clarify... so after all of this, should |
This comment has been minimized.
This comment has been minimized.
@yev-d It should work. If everything installed fine. You should be able to open a new terminal and make sure that you have deactivated anaconda environment |
This comment has been minimized.
This comment has been minimized.
Can i link ros-kinetic with python 3.5 using the above process |
This comment has been minimized.
This comment has been minimized.
I would add |
This comment has been minimized.
This comment has been minimized.
@drmaj have you tried this with 20.04? |
This comment has been minimized.
This comment has been minimized.
@juancamilog Use Noetic in 20.04, it will be released in two weeks and supports Python 3 out of the box. |
This comment has been minimized.
This comment has been minimized.
Hi, I would like to know how could I catkin_make or catkin build certain package, e.g. video_stream_opencv in src folder? Thanks |
This comment has been minimized.
This comment has been minimized.
In the folder video_stream_opencv. |
This comment has been minimized.
This comment has been minimized.
@metalglove Thanks!! |
This comment has been minimized.
This comment has been minimized.
I would like to know should I ignore are the warnings when building ROS? @metalglove. Thanks! |
This comment has been minimized.
This comment has been minimized.
Hi @metalglove, I encountered an issue where it doesn't detect any launch files. Any solution to resolve this issue? thanks |
This comment has been minimized.
This comment has been minimized.
Hi @metalglove, I need pyhton3 in ROS for a project and I followed your blog post and its publication on April 2nd and gives me error when I apply the following line:
If I continue with the installation when I do "catkin build" this error occurs:
If I try "roscore" at the end of it all gives me error. I followed the suggestions in the previous post and nothing. Could you help me, please? Thanks |
This comment has been minimized.
This comment has been minimized.
It was not my blog post, but I took an interest in this script. I have since moved to ROS neotic (which supports python 3 by default). |
This comment has been minimized.
This comment has been minimized.
@metalglove But did you get python3 up and running with ROS Melodic? |
This comment has been minimized.
This comment has been minimized.
I solved this one by a hack. Apparently there's a bug in that tasks file for the version of python we both seem to be using. (Are you on a raspberry PI?) I simply edited /usr/local/lib/python3.7/dist-packages/trollius/tasks.py and deleted the 'async' reference at the top of the file and then deleted the entire function at line 565. (it even says it's been deprecated) |
This comment has been minimized.
This comment has been minimized.
I'm using nvidia's jetson nano. I searched and found no ROS2 installation that already has python3 nor ros noetic. That's why it's important to be able to install. Did you even use some algorithm in python3 and it worked well? Deep Learning algorithm? @metalglove |
This comment has been minimized.
This comment has been minimized.
I knew this was going too well: Errors << xmlrpcpp:make /home/pi/ros_catkin_ws/logs/xmlrpcpp/build.make.000.log /home/pi/ros_catkin_ws/src/ros_comm/xmlrpcpp/src/XmlRpcClient.cpp: In member function �virtual std::__cxx11::string XmlRpc::XmlRpcClient::generateHeader(size_t) const�: /home/pi/ros_catkin_ws/src/ros_comm/xmlrpcpp/src/XmlRpcClient.cpp:330:3: error: �snprintf� is not a member of �std� std::snprintf(buff,40,":%d\r\n", _port); ^ /home/pi/ros_catkin_ws/src/ros_comm/xmlrpcpp/src/XmlRpcClient.cpp:330:3: note: suggested alternative: In file included from /home/pi/ros_catkin_ws/src/ros_comm/xmlrpcpp/src/XmlRpcClient.cpp:8:0: /usr/include/stdio.h:354:12: note: �snprintf� extern int snprintf (char *__restrict __s, size_t __maxlen, ^ /home/pi/ros_catkin_ws/src/ros_comm/xmlrpcpp/src/XmlRpcClient.cpp:335:3: error: �snprintf� is not a member of �std� std::snprintf(buff,40,"%zu\r\n\r\n", length); ^ /home/pi/ros_catkin_ws/src/ros_comm/xmlrpcpp/src/XmlRpcClient.cpp:335:3: note: suggested alternative: In file included from /home/pi/ros_catkin_ws/src/ros_comm/xmlrpcpp/src/XmlRpcClient.cpp:8:0: /usr/include/stdio.h:354:12: note: �snprintf� extern int snprintf (char *__restrict __s, size_t __maxlen, ^ make[2]: *** [CMakeFiles/xmlrpcpp.dir/build.make:63: CMakeFiles/xmlrpcpp.dir/src/XmlRpcClient.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:137: CMakeFiles/xmlrpcpp.dir/all] Error 2 make: *** [Makefile:141: all] Error 2 cd /home/pi/ros_catkin_ws/build/xmlrpcpp; catkin build --get-env xmlrpcpp | catkin env -si /usr/bin/make --jobserver-auth=3,4; cd - Any thoughts? |
This comment has been minimized.
This comment has been minimized.
I solved this by wiping the SD card on my pi and reinstalling from scratch. |
This comment has been minimized.
This comment has been minimized.
I also had massive problems with installing wxTools, so I skipped as I didn't need it (everything I do is headless). I also changed my build to a ros_base instead of a desktop_full. So if anyone is coming here to successfully build melodic on a headless raspberryPi ZeroW running rasbian buster the changes I needed were:
Thanks to everyone here, I've now got ros1 running on a Pi using python3. |
This comment has been minimized.
This comment has been minimized.
Thanks for the instructions! I'm following them and they are helpful! Can I also ask how you figured out the instructions? Did you get them from some other sources? I tried to search in the ROS official website and ROS source code repositories but didn't seem to find them. How did you find the instructions? |
This comment has been minimized.
This comment has been minimized.
@zzh112119, Hi, I have same question with you. Is your problem related to YAMLObject Syntax solved by uninstall python2? which installed accidentally after install libboost? |
This comment has been minimized.
This comment has been minimized.
Trial and Error :-)
Did you check this? If the head of the file is : Make sure that it points to python3 Or change it to: |
This comment has been minimized.
This comment has been minimized.
@graemerae, thanks for your reply, after changing to #!/usr/bin/python3, it's working, cheer! |
This comment has been minimized.
This comment has been minimized.
Hi, I got following error. Exception ignored in: <bound method BaseEventLoop.del of <_UnixSelectorEventLoop running=False closed=True debug=False>> I tried to change this line #/usr/bin/python3 and it doesn |
This comment has been minimized.
This comment has been minimized.
Does roscore and a simple python publisher working? This problem should be fine. |
This comment has been minimized.
This comment has been minimized.
Hi I ran into the following problem:
I fixed this with "sudo apt-get install python3-[package]", now I get this when building:
...
I know that others experienced the same. I tried the solutions they used, but it does not help in my case. |
This comment has been minimized.
This comment has been minimized.
[build] Ignored: 33 packages were skipped or are blacklisted. I am getting the same error after following the recommended steps.I am trying install ros melodic on ubuntu 18.04.Please help. |
This comment has been minimized.
This comment has been minimized.
@metalglove if i change your script from melodic to noetic it should work? i will test it today... |
This comment has been minimized.
This comment has been minimized.
There is a supported noetic version for Python3. |
This comment has been minimized.
This comment has been minimized.
@metalglove thanks for taking the time to reply on a sunday :) i worked until 6 am yesterday haha!
Also, I am trying to build a docker image with ubuntu20.04, cuda11 (or 10) with cudnn8 (or 7), but all the available images (official) are either ubuntu18 or below with cuda10, cudnn7, and the ubuntu20 ones have only cuda11 and the package for cudnn8 do not exist yet.. ugh! |
This comment has been minimized.
This comment has been minimized.
I am facing same problem any solution that worked I followed all the steps |
This comment has been minimized.
This comment has been minimized.
Errors << compressed_image_transport:make /home/internrobot/ros_catkin_ws/logs/compressed_image_transport/build.make.000.log Warnings << rqt_image_view:install /home/internrobot/ros_catkin_ws/logs/rqt_image_view/build.install.000.log cd /home/internrobot/ros_catkin_ws/build/rqt_image_view; catkin build --get-env rqt_image_view | catkin env -si /usr/bin/make install; cd - Errors << compressed_depth_image_transport:make /home/internrobot/ros_catkin_ws/logs/compressed_depth_image_transport/build.make.000.log I am getting these issues, I followed the same steps listed in https://www.miguelalonsojr.com/blog/robotics/ros/python3/2019/08/20/ros-melodic-python-3-build.html |
This comment has been minimized.
This comment has been minimized.
Does this setup mean that all new ros packages (e.g my own) need to be installed in the build workspace (ros_catkin_ws)? |
This comment has been minimized.
This comment has been minimized.
Unfortunately I couldn't get this python3 configuration to work for me when I was experimenting with this. Having this issue as well: Exception ignored in: <bound method BaseEventLoop.del of <_UnixSelectorEventLoop running=False closed=True debug=False>> What would be the best way to revert the changes made by 'gistfile1.txt' to get back to using Python2.7 with catkin build? |
This comment has been minimized.
This comment has been minimized.
UPDATE: Never-mind. For my particular situation 'catkin_tools' was not completed uninstalled all the way, so had to go into '/usr/local/bin' and manually delete the catkin related binaries as well as as the ros binaries then re-installed ros-melodic and python-catkin-tools and I was back up and running with my old setup using Python2.7. |
This comment has been minimized.
This comment has been minimized.
hi @metalglove, I have followed ur way and succesfully installed. after using the source " source ~/ros_catkin_ws/install/setup.bash" i can use roscore and it works without ant error. But I have a question how can i install moveit for ros melodic. Because whenever i try it gives error it can not locate the file. even if i use source before installing. What I am doing wrong ? Example I open new terminal: source ~/ros_catkin_ws/install/setup.bash and here is the error: E: Unable to locate package ros-melodic-moveit |
This comment has been minimized.
This comment has been minimized.
HI @MBaranPeker, You cannot just use You should download the source code and then build it with python 3. Here is the guide could probably help you. Let me know if this works for you. Cheers, |
This comment has been minimized.
This comment has been minimized.
Hi, @YijiongLin. Thank you so much. It is working now. |
This comment has been minimized.
This comment has been minimized.
Hey! I was able to install ROS, but am not able to import rospy. I am trying to install ROS on Google Colab and the following were the commands that I used to install ros-base:
When I do pip list, rospy shows up in the list. But when I try to import rospy, I get the following error:
Also I can import rospkg in python, but none of the other ros modules. Any idea what could be the problem? |
This comment has been minimized.
This comment has been minimized.
Hi, Let me add a small remark for all the people (including me) who have encountered problems building ROS Melodic with Python 3. It is possible to make ROS Melodic work with Python 3 via an "apt" command, without having to build all the ROS packages with Python 3. The procedure is detailed here : https://dhanoopbhaskar.com/blog/2020-05-07-working-with-python-3-in-ros-kinetic-or-melodic/ . Regards, XV25 |
This comment has been minimized.
(Moved this from the blog for history preservation purpose)
Two errors were encountered during setting up with this tutorial:
This will not affect launching roscore just as you posted before.
This is an interesting error.. Python seems to be complaining about the python3's metaclass syntax here. And with the traceback log, ROS is trying to run with python3 here but somehow ended up using python2 when the error happens.
Does anyone have any insight?