Ask Your Question

ImportError: No module named wx

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

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

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

ahendrix gravatar image

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

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


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 imageAsifA ( 2016-05-06 00:36:57 -0500 )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 imageahendrix ( 2016-05-06 01:17:56 -0500 )edit

Yes. I have Anaconda and SALOME installed.

AsifA gravatar imageAsifA ( 2016-05-06 03:04:38 -0500 )edit

I don't have any experience with Anaconda myself, but other posts on 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 imageahendrix ( 2016-05-06 03:16:09 -0500 )edit

As a last resort you can uninstall Anaconda.

ahendrix gravatar imageahendrix ( 2016-05-06 03:17:50 -0500 )edit

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

AsifA gravatar imageAsifA ( 2016-05-06 03:20:52 -0500 )edit

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 imageahendrix ( 2016-05-06 13:55:11 -0500 )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 imagecvcook ( 2016-07-08 09:08:19 -0500 )edit

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

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.


edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



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

Seen: 1,367 times

Last updated: Aug 14 '16