can't install wxPython on Anaconda Python
Asked Answered
G

3

7

I installed Anaconda Python on my RHEL6 system. In order to run gnuradio I need wxPython. For that reason I did

conda install wxpython

The problem is when I try to import Wx module in python. Then the following error arises:

>>> import wx
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/scr1/nemanja/install/anaconda/lib/python2.7/site-packages/wx-3.0-gtk2/wx/__init__.py", line 45, in <module>
from wx._core import *
File "/scr1/nemanja/install/anaconda/lib/python2.7/site-packages/wx-3.0-gtk2/wx/_core.py", line 4, in <module>
import _core_
ImportError: /scr1/nemanja/install/anaconda/lib/python2.7/site-packages/wx-3.0-gtk2/wx/../../../../libwx_gtk2u-3.0.so.0: undefined symbol: g_malloc_n

What is missing here?

Gleich answered 2/10, 2015 at 8:55 Comment(2)
you only need wxpython if you want to use the GNU Radio wx gui components, which are deprecated by now.Bianca
I installed a custom Python module that needs wx with ~/anaconda/bin/pip, which also installed the prerequisites. Sadly, this has fallen over with the same error as the one reported here. I then installed wx independently with ~/anaconda/bin/conda install wxpython, and it works like a charm. wxpython-4.0.4 , Python 3.7.6Quarterage
M
5

I had a small python script that used wx many years ago, and recently started using anaconda. Then, I faced the same issue when I tried to run the script with the anaconda python as it didn't include the wx package. To try sorting out the issue, what I did is:

binstar search -t conda wxpython

Which will list up the name (i.e., wxpython), version, type and platform. Select the right version for you when using the command:

conda install -c anaconda wxpython=(version)

In which 3.0 for (version) works for me on Windows 7.

Maggs answered 22/6, 2016 at 3:24 Comment(0)
E
2

I just had a similar problem installing WX on Anaconda.

The system was running Windows 7, Anaconda 4.3.22 and needed to install wxPython 4.0.0a2.

#Did'nt work in my case.
$conda install -c anaconda wxpython=(version)

I'm not exactly sure why this didn't work but the error message reported that the dependencies were incorrect. The wxpython was expecting Python 2 and Anaconda is running Python 3.

However, the issue was resolved by running the following from the "Anaconda Prompt".

$conda install -c melund wxpython=4.0.0a2

Here's some more documentation for anyone interested or more knowledgeable.

Eureka answered 14/7, 2017 at 19:25 Comment(0)
G
0

First of all, you don't need wx to build GNU Radio -- most people are steering away from WX in favor of the Qt Widgets, which have largely superseeded the WX functionality. That being said, if you rely on anything that uses wx:

Now, it seems that anaconda's version of wxpython is broken. I'd say: ignore and uninstall that, simply use the one that you should be available via EPEL. It will work better, especially since GNU Radio will probably have a better time linking against things that are properly installed using yum/rpm.

Glycoprotein answered 23/10, 2015 at 10:14 Comment(2)
Well I did install gnuradio only with qtgui support, but I am not able to run filter_design which is very important for me.Gleich
@Nexy_sm: I can understand that. Looks like you'll really need to install yum install wxPython-devel , from EPEL, rebuild GNU Radio with gr-wxgui support enabled, and try again!Bianca

© 2022 - 2024 — McMap. All rights reserved.