ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

ImportError: No module named wx

asked 2016-05-05 17:07:32 -0600

AsifA gravatar image

Hi. I am using husky_description and want to launch description.launch, which I was used to successfully launch in ROS Hydro at Ubuntu 12.04. Now I am using ROS Indigo on Ubuntu 14.04 and it shows me following error.

Traceback (most recent call last): File "/opt/ros/indigo/lib/joint_state_publisher/joint_state_publisher", line 5, in <module> import wx ImportError: No module named wx

[joint_state_publisher-3] process has died [pid 11298, exit code 1, cmd >/opt/ros/indigo/lib/joint_state_publisher/joint_state_publisher __name:=joint_state_publisher __log:=/home/asif/.ros/log/5bdd4b1c-130a-11e6-a55d-d4bed970caa5/joint_state_publisher-3.log]. log file: /home/asif/.ros/log/5bdd4b1c-130a-11e6-a55d-d4bed970caa5/joint_state_publisher-3*.log

I can not import wx in python shell as well (it shows the same ImportError). In another system (ROS Indigo, Ubuntu 14.04 and default installations of python2.7), it works fine. I have installed wxtools using sudo apt-get install python-wxtools. and the error is still there. Probably, the error is due to some additional python installations such as Anaconda 2.4.1 and SALOME. Any idea how to handle it? Thanks

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2016-05-05 18:45:46 -0600

ahendrix gravatar image

updated 2016-05-05 18:46:04 -0600

On my 14.04 system, the python wx module is part of the python-wxgtk2.8 package. I'd suggest that you try installing that package:

sudo apt-get install python-wxgtk2.8
edit flag offensive delete link more

Comments

Its already installed on my system. To make sure, I removed and installed again but no luck. Do you think there are some path issues?

AsifA gravatar image AsifA  ( 2016-05-06 00:36:57 -0600 )edit

Your question says:

Probably, the error is due to some additional python installations such as Anaconda 2.4.1 and SALOME.

Does that mean that you have Anaconda installed?

ahendrix gravatar image ahendrix  ( 2016-05-06 01:17:56 -0600 )edit

Yes. I have Anaconda and SALOME installed.

AsifA gravatar image AsifA  ( 2016-05-06 03:04:38 -0600 )edit
1

I don't have any experience with Anaconda myself, but other posts on answers.ros.org indicate that it doesn't behave well with system-installed python modules. I would try to run ROS with the system version of python, or try to set your PYTHONPATH so that Anaconda uses the system python libraries.

ahendrix gravatar image ahendrix  ( 2016-05-06 03:16:09 -0600 )edit

As a last resort you can uninstall Anaconda.

ahendrix gravatar image ahendrix  ( 2016-05-06 03:17:50 -0600 )edit

By "system-installed python modules" you mean the python that comes by default with Ubuntu 14.04?

AsifA gravatar image AsifA  ( 2016-05-06 03:20:52 -0600 )edit
1

By system-installed python modules, I'm referring to any python modules that are installed through apt-get. (They're usually in /usr/lib/python2.7/dist-packages )

ahendrix gravatar image ahendrix  ( 2016-05-06 13:55:11 -0600 )edit

Hi, have you found the solution to this "No module named wx" problem yet? I am using ROS Indigo on Ubuntu 14.04, and I have tried "sudo apt-get install python-wxgtk2.8", and have no luck getting rid of this problem.

cvcook gravatar image cvcook  ( 2016-07-08 09:08:19 -0600 )edit
0

answered 2016-08-14 14:32:21 -0600

schwarmcyc gravatar image

Hi I face with the same proble because of Python Anaconda can you type python --version to check? if it echo Python 2.x.x :: Anaconda 2.x.x (64-bit) problably the problem

step1. uncomment export PATH="/home/<your user>/anaconda3/bin:$PATH" in your ~/.bashrc

step2. $rm -r ~/catkin_ws/build

step3. catkin_make again

Delete your build folder after turning off anaconda. CMake will cache the Python executable it finds.

http://answers.ros.org/question/22054...

cheers.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2016-05-05 17:07:32 -0600

Seen: 1,975 times

Last updated: Aug 14 '16