I have installed many libraries for a project, but two specific libraries are giving me trouble when trying to import to python. These two are matplotlib.pyplot and wxpython. I have already followed many tutorial to see how to properly install these packages into python but so far I have had no luck. Here is the error that get when trying to import:
Traceback (most recent call last):
File "/Users/AhmedNiri/Ahmed/2D_Mapping_Program_V7.py", line 13, in <module>
import matplotlib.pyplot as plt
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib-1.3.1-py2.7-macosx-10.9-x86_64.egg/matplotlib/pyplot.py", line 98, in <module>
_backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib-1.3.1-py2.7-macosx-10.9-x86_64.egg/matplotlib/backends/__init__.py", line 28, in pylab_setup
globals(),locals(),[backend_name],0)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib-1.3.1-py2.7-macosx-10.9-x86_64.egg/matplotlib/backends/backend_wxagg.py", line 6, in <module>
import backend_wx # already uses wxversion.ensureMinimal('2.8')
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib-1.3.1-py2.7-macosx-10.9-x86_64.egg/matplotlib/backends/backend_wx.py", line 53, in <module>
raise ImportError(missingwxversion)
ImportError: Matplotlib backend_wx and backend_wxagg require wxversion, which was not found.
So how do I know that these two libraries have been installed properly and in the desired directory? I know that this might be an easy question to answer but I have been trying for a while to solve this and I also haven't had too much experience with python. Thanks in advance.
import wxversion... if its not there you should re-install wxPython using apt-get (try following these directions wiki.wxpython.org/InstallingOnUbuntuOrDebian)import wxversionin a normal python shell? this implies you have multiple python interpretters (maybe 2.7 and 3.4) and whatever you are using to run your script is using the python that you do not have wx installed in ... Im guessing your wx is installed on one interpretter and your matplotlib is using a different interpretter.