Skip to content

Error using with python3 #95

@Rezenders

Description

@Rezenders

Is this package compatible with python3? I saw that there are a few commits related to this topic.

I am trying to build ROS from source using python3, everything builds just fine.
But when I run capability_server I get the following error:

Traceback (most recent call last):
  File "/ros_catkin_ws/install_isolated/lib/capabilities/capability_server", line 8, in <module>
    from rospy.impl import tcpros_service
  File "/ros_catkin_ws/install_isolated/lib/python3/dist-packages/rospy/__init__.py", line 49, in <module>
    from .client import spin, myargv, init_node, \
  File "/ros_catkin_ws/install_isolated/lib/python3/dist-packages/rospy/client.py", line 52, in <module>
    import roslib
  File "/ros_catkin_ws/install_isolated/lib/python3/dist-packages/roslib/__init__.py", line 50, in <module>
    from roslib.launcher import load_manifest  # noqa: F401
  File "/ros_catkin_ws/install_isolated/lib/python3/dist-packages/roslib/launcher.py", line 42, in <module>
    import rospkg
ImportError: No module named rospkg
================================================================================REQUIRED process [capability_server-7] has died!
process has died [pid 27571, exit code 1, cmd /ros_catkin_ws/install_isolated/lib/capabilities/capability_server __name:=capability_server __log:=/root/.ros/log/211af6f2-a85e-11eb-a4ff-0242ac110002/capability_server-7.log].
log file: /root/.ros/log/211af6f2-a85e-11eb-a4ff-0242ac110002/capability_server-7*.log
Initiating shutdown!
================================================================================

It seems that this package is still trying to import rospkg from python2. I don't know if I build it wrongly or if it is related to the package itself. Sorry if this is my mistake.

I am building the workspace like this:
$ export ROS_PYTHON_VERSION=3 && python3 ./src/catkin/bin/catkin_make_isolated --install -CMAKE_BUILD_TYPE=Release -j1 --catkin-make-args all

BTW, I am using ubuntu 18.04 and ROS melodic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions