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

Couldn't find libpython #430

Closed
randomjc opened this issue Aug 16, 2017 · 4 comments
Closed

Couldn't find libpython #430

randomjc opened this issue Aug 16, 2017 · 4 comments

Comments

@randomjc
Copy link

Hi,

I get the following error when running Pkg.build("PyCall"):

===============================[ ERROR: PyCall ]================================

LoadError: Couldn't find libpython; check your PYTHON environment variable.

The python executable we tried was python (= version 2.7);
the library names we tried were ASCIIString["libpython2.7.so","libpython2.7","libpython"]
and the library paths we tried were UTF8String["/usr/lib","/usr/lib","/usr","/usr/lib"]
while loading /home/jc/.julia/v0.4/PyCall/deps/build.jl, in expression starting on line 13
================================================================================

================================[ BUILD ERRORS ]================================

WARNING: PyCall had build errors.

 - packages with build errors remain installed in /home/jc/.julia/v0.4
 - build the package(s) and all dependencies with `Pkg.build("PyCall")`
 - build a single package by running its `deps/build.jl` script

================================================================================

Here is my versioninfo():

Julia Version 0.4.5
Commit 2ac304d (2016-03-18 00:58 UTC)
Platform Info:
  System: Linux (x86_64-linux-gnu)
  CPU: Intel(R) Core(TM) i5-6300U CPU @ 2.40GHz
  WORD_SIZE: 64
  BLAS: libopenblas (NO_LAPACKE DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas
  LIBM: libopenlibm
  LLVM: libLLVM-3.8

I can see that there are files called libpython2.7.so.1 and libpython2.7.so.1.0 in /usr/lib and in /usr/lib/x86_64-linux-gnu, and libpython2.7.so in /usr/lib/python2.7/config-x86_64-linux-gnu. There is also some python3.5 directories and files lurking around, which does not sound like good installation. I don't know if my problem is related to a badly installed python, and if it's related to the problem discussed in #199. The last comment there suggests to set ENV["PYTHON"]="", but I have no idea how to do that. Any help would be greatly appreciated.

@stevengj
Copy link
Member

Make sure you have the python2.7-dev package (or whatever it is called in your Linux distro) installed.

@randomjc
Copy link
Author

That worked, thanks a lot! (Out of curiosity, was there an easy way for me to figure this out?)

@stevengj
Copy link
Member

You can do a package search on the filename: https://packages.ubuntu.com/search?searchon=contents&keywords=libpython2.7.so&mode=exactfilename&suite=zesty&arch=any

(I'm surprised the -dev package wasn't installed by default on your system.)

@randomjc
Copy link
Author

I see... Thanks again!

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