SOLUTION FOUND - Report: Further traceback showed that the problem was with Python/matplotlib, not Julia: in a command-line session with Python, the command import matplotlib failed with messages saying that a module named "compat" could not be found. Inspired by searching StackOverflow, <http://stackoverflow.com/questions/27850959/matplotlib-no-module-named-compat> I used sudo aptitude purge matplotlib to remove the Ubuntu-packaged version of that software, and then ran sudo pip install matplotlib to replace it with a new one. Julia can load initialize PyPlot now.
(The process required several iterations, because pip needs to see the compilation header files for many packages. So typically the pip install command would crash after a few minutes, I would guess which Ubuntu package named like *-dev to install using apt, and then we would try again. For safety reasons, I only prepended the sudo command after the compilation completed successfully and the only reason pip failed was insufficient permission to write its products into the protected system location /usr/local/lib/python2.7/dist-packages/matplotlib-1.4.2-nspkg.pth .) I hope this helps someone -- including, perhaps, my future self. On Tuesday, January 13, 2015 at 10:28:08 PM UTC-8, Philip Loewen wrote: > > I'm new to julia, trying to get PyPlot working. Eventually I hope to see > graphics in iJulia, but the GUI is not needed to reproduce the problem > detailed below. > > At the command line, saying "julia" reveals the header logo, including > relevant version info: > > Version 0.3.5 (2015-01-08 22:33 UTC) > Official http://julialang.org release > x86_64-linux-gnu > > Then here is a transcript of my one-command interactive session: > > julia> using PyPlot > Warning: error initializing module PyPlot: > PyCall.PyError(msg=":PyImport_ImportModule", > T=PyCall.PyObject(o=0x0000000093e401e0), > val=PyCall.PyObject(o=0x000000009131a1b8), > traceback=PyCall.PyObject(o=0x0000000091319fc8)) > > At this point I'm lost. Any suggestions? Searching this archive and others > suggested another command: > > julia> Pkg.test("PyCall") > INFO: Testing PyCall > INFO: PyCall tests passed > INFO: No packages to install, update or remove > > My system is Ubuntu 14.04.1 LTS. The Ubuntu-supplied package > python-matplotlib is installed; so are ipython, ipython-notebook, > python-pip. Inside julia, I have used Pkg.add(x) with each x in "Winston", > "Gadfly", "PyPlot", and "IJulia". > I have another Ubuntu box on which all this works, but apparently I was > too casual about taking notes on my previous installation to be able to > succeed with a second one. Suggestions would be most warmly welcomed -- > thanks! >
