Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error using @pyimport on Ubuntu 13.04 using python 2.7.4 #23

Closed
simonp0420 opened this issue Jun 5, 2013 · 4 comments
Closed

Error using @pyimport on Ubuntu 13.04 using python 2.7.4 #23

simonp0420 opened this issue Jun 5, 2013 · 4 comments

Comments

@simonp0420
Copy link

@pyimport is not able to find libpython2.7.so:

simonp@ubuntu:~$ julia
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "help()" to list help topics
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.2.0-1796.rbac428f9
 _/ |\__'_|_|_|\__'_|  |  Commit bac428f990 2013-06-03 15:11:03
|__/                   |


julia> using PyCall

julia> @pyimport math
ERROR: could not load module libpython2.7.so: libpython2.7.so: cannot open shared object file: No such file or directory
 in pyinitialize at /home/simonp/.julia/PyCall/src/PyCall.jl:320
 in pyimport at /home/simonp/.julia/PyCall/src/PyCall.jl:105
...

I looked around for similarly named libraries and found the following:

/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1
/usr/lib/python2.7/config-x86_64-linux-gnu/libpython2.7.so
/usr/share/doc/libpython2.7-minimal
/usr/share/doc/libpython2.7-stdlib
/usr/share/doc/libpython2.7
/usr/share/lintian/overrides/libpython2.7-minimal
/usr/share/lintian/overrides/libpython2.7-stdlib
/usr/share/lintian/overrides/libpython2.7
...

Any suggestions? I've used mostly Windows in the past, so I'm not sure what to do at this point.

Thanks,
Peter

@stevengj
Copy link
Member

stevengj commented Jun 5, 2013

Maybe install the python2.7-dev package?

Or manually run pyinitialize("/usr/lib/x86_64-linux-gnu/libpython2.7.so.1"). It is annoying that it is so difficult to automatically detect the name of the Python library...

@simonp0420
Copy link
Author

Installing the python-dev package did the trick! Thanks for the quick response and awesome package.

While trying the plotting example supplied in your documentation, I found that pylab.show() blocks execution of julia until the plot window is closed. I tried using the code you provided in Issue 21, but got the following error

julia> wx_eventloop()
ERROR: PyError (PyImport_ImportModule) <type 'exceptions.ImportError'>
ImportError('No module named wx',)

Is there a solution to allowing plots to be non-blocking?

Thanks,
Peter

@simonp0420 simonp0420 reopened this Jun 5, 2013
@simonp0420
Copy link
Author

Sorry, accidentally hit the "Close&Comment" button.

@stevengj
Copy link
Member

stevengj commented Jun 6, 2013

Probably you don't have the wxWindows package installed and are using the GTK interface with pylab. I have a GTK event loop, too, but the wx one works better and I would tend to recommend installing wx. Please continue discussion in #21.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants