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

Problem finding libpython on Ubuntu #565

Closed
andreasnoack opened this issue Sep 13, 2018 · 10 comments
Closed

Problem finding libpython on Ubuntu #565

andreasnoack opened this issue Sep 13, 2018 · 10 comments

Comments

@andreasnoack
Copy link

This has caused some problems for CIBot lately

julia> ENV["PYTHON"]="/usr/bin/python3"
"/usr/bin/python3"

(v1.0) pkg> build PyCall
  Building Conda ─ `~/.julia/packages/Conda/m7vem/deps/build.log`
  Building PyCall  `~/.julia/packages/PyCall/rUul9/deps/build.log`
┌ Error: Error building `PyCall`:
│ ERROR: LoadError: Couldn't find libpython; check your PYTHON environment variable.
│
│ The python executable we tried was /usr/bin/python3 (= version3.6);
│ the library names we tried were ["libpython3.6m.so", "libpython3.6m", "libpython3.6", "libpython"]
│ and the library paths we tried were AbstractString["/usr/lib","/usr/lib", "/usr", "/usr/lib"]
│ Stacktrace:
│  [1] error(::String) at ./error.jl:33
│  [2] find_libpython(::String) at /home/andreasnoack/.julia/packages/PyCall/rUul9/deps/build.jl:129
│  [3] top-level scope at logging.jl:313
│  [4] top-level scope at /home/andreasnoack/.julia/packages/PyCall/rUul9/deps/build.jl:196
│  [5] include at ./boot.jl:317 [inlined]
│  [6] include_relative(::Module, ::String) at ./loading.jl:1038
│  [7] include(::Module, ::String) at ./sysimg.jl:29
│  [8] include(::String) at ./client.jl:388
│  [9] top-level scope at none:0in expression starting at /home/andreasnoack/.julia/packages/PyCall/rUul9/deps/build.jl:170
└ @ Pkg.Operations /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/Operations.jl:1068
@tkf
Copy link
Member

tkf commented Sep 14, 2018

We are trying to improve libpython discovery #556 (which is surprisingly hard). Can you run

wget https://gist.githubusercontent.com/tkf/d980eee120611604c0b9b5fef5b8dae6/raw/9f074cd233f83180676b4421212ed33c257968af/find_libpython.py
/usr/bin/python3 find_libpython.py --list-all

and paste the output (if any) here?

If it doesn't output anything, try:

/usr/bin/python3 find_libpython.py --list-all --verbose

Also, let me know the output of lsb_release -a just for record.

@andreasnoack
Copy link
Author

This one seems able to find libpython

andreasnoack@anubis:~$ /usr/bin/python3 find_libpython.py --list-all
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 17.10
Release:        17.10
Codename:       artful

@tkf
Copy link
Member

tkf commented Sep 14, 2018

Thanks, good to know.

@rishisubramanian
Copy link

Just letting you know that I have the same issue on Ubuntu 18.10 (Development). My libpython location is the same at /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0.
No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu Cosmic Cuttlefish (development branch) Release: 18.10 Codename: cosmic

@tkf
Copy link
Member

tkf commented Sep 15, 2018

If you feel brave you can try #556 with ] add PyCall#remotes/cache/pull/556/head :)

@andreasnoack
Copy link
Author

If you feel brave you can try #556 with ] add PyCall#remotes/cache/pull/556/head :)

Great. It works.

@huckl3b3rry87
Copy link

huckl3b3rry87 commented Sep 20, 2018

So, the master is fixed?

I am still getting a build error using the latest tagged version

configure: error: failed to find a C++ compiler or C++ compiler g++ does not work
================================[ ERROR: Ipopt ]================================

LoadError: failed process: Process(`./configure --prefix=/home/mavs/.julia/v0.6/Ipopt/deps/usr coin_skip_warn_cxxflags=yes '--with-blas=/home/mavs/.julia/v0.6/Ipopt/deps/usr/lib/libcoinblas.a -lgfortran' --with-lapack=/home/mavs/.julia/v0.6/Ipopt/deps/usr/lib/libcoinlapack.a ''`, ProcessExited(1)) [1]
while loading /home/mavs/.julia/v0.6/Ipopt/deps/build.jl, in expression starting on line 13

================================================================================
INFO: Building PyCall
===============================[ ERROR: PyCall ]================================

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

The python executable we tried was python3 (= version 3.5);
the library names we tried were String["libpython3.5m.so", "libpython3.5m", "libpython3.5", "libpython"]
and the library paths we tried were String["/usr/lib", "/usr/lib", "/usr", "/usr/lib"]
while loading /home/mavs/.julia/v0.6/PyCall/deps/build.jl, in expression starting on line 265

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

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

WARNING: Ipopt and PyCall had build errors.

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

================================================================================
INFO: Package database updated
INFO: Building Conda
INFO: Building PyCall
Info: PyCall is using /usr/bin/python2.7 (Python 2.7.12) at /usr/bin/python2.7, libpython = libpython2.7
Info: /home/mavs/.julia/v0.6/PyCall/deps/deps.jl has been updated
Info: /home/mavs/.julia/v0.6/PyCall/deps/PYTHON has been updated

Or is there a fix for this?

@tkf
Copy link
Member

tkf commented Sep 20, 2018

No master still has the problem. #556 is not merged yet.

@stevengj
Copy link
Member

Fixed by #556

@andreasnoack
Copy link
Author

Thanks for fixing this. Would it be possible to make a new release? This issue is still causing all PyCall dependent packages to fail CIBot testing.

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

5 participants