Giter VIP home page Giter VIP logo

Comments (15)

mrkn avatar mrkn commented on June 12, 2024 4

@umlx5h pycall.rb requires that Python is configured with --enable-shared.

But heroku's python seems not configured with --enable-shared.
See https://github.com/heroku/heroku-buildpack-python/blob/master/builds/runtimes/python-3.6.4#L13

from pycall.rb.

richgong avatar richgong commented on June 12, 2024

I've forked it to see if this fixes the problem: https://github.com/richgong/heroku-buildpack-python

from pycall.rb.

raphaelfarzankashani avatar raphaelfarzankashani commented on June 12, 2024

Hi @mrkn - how can I access this repo and this link? https://github.com/heroku/heroku-buildpack-python/blob/master/builds/runtimes/python-3.6.4#L13

Any way to contact you directly?

from pycall.rb.

mrkn avatar mrkn commented on June 12, 2024

@raphaelfarzankashani I think @richgong's this commit fixes this issue.

Why do you want to contact me directly?

from pycall.rb.

mrkn avatar mrkn commented on June 12, 2024

I close this issue because this is not pycall.rb's responsibility.

from pycall.rb.

dsounded avatar dsounded commented on June 12, 2024

Hello, @mrkn and thank you for the gem

I am trying to make it work on Heroku and had no luck...

Still PyCall::PythonNotFound: PyCall::PythonNotFound

This is my fork which should patch --enable-shared issue.

dsounded/heroku-buildpack-python@43cf2de

Did anything change before this topic was discussed for the last time ?
It even can't start the Puma now because of that error

(works perfectly locally)

from pycall.rb.

dsounded avatar dsounded commented on June 12, 2024

Here is the output:

DEBUG(find_libpython) find_libpython(nil)
DEBUG(find_libpython) investigate_python_config("python3")
DEBUG(find_libpython) libs: ["libpython3.9.a", "libpython3.9", "libpython"]
DEBUG(find_libpython) libpaths: ["/app/.heroku/python/lib", "/app/.heroku/python/lib", "", "/app/.heroku/python", "/app/.heroku/python/lib"]
DEBUG(find_libpython) Fiddle::DLError: /app/.heroku/python/lib/libpython3.9.a: invalid ELF header
DEBUG(find_libpython) Unable to find /app/.heroku/python/lib/libpython3.9.a.so
DEBUG(find_libpython) Unable to find /app/.heroku/python/lib/x86_64-linux-gnu/libpython3.9.a
DEBUG(find_libpython) Unable to find /app/.heroku/python/lib/x86_64-linux-gnu/libpython3.9.a.so
DEBUG(find_libpython) Fiddle::DLError: /app/.heroku/python/lib/libpython3.9.a: invalid ELF header
DEBUG(find_libpython) Unable to find /app/.heroku/python/lib/libpython3.9.a.so
DEBUG(find_libpython) Unable to find /app/.heroku/python/lib/x86_64-linux-gnu/libpython3.9.a
DEBUG(find_libpython) Unable to find /app/.heroku/python/lib/x86_64-linux-gnu/libpython3.9.a.so
DEBUG(find_libpython) Unable to find /libpython3.9.a
DEBUG(find_libpython) Unable to find /libpython3.9.a.so
DEBUG(find_libpython) Unable to find /x86_64-linux-gnu/libpython3.9.a
DEBUG(find_libpython) Unable to find /x86_64-linux-gnu/libpython3.9.a.so
DEBUG(find_libpython) Unable to find /app/.heroku/python/libpython3.9.a
DEBUG(find_libpython) Unable to find /app/.heroku/python/libpython3.9.a.so
DEBUG(find_libpython) Unable to find /app/.heroku/python/x86_64-linux-gnu/libpython3.9.a
DEBUG(find_libpython) Unable to find /app/.heroku/python/x86_64-linux-gnu/libpython3.9.a.so
DEBUG(find_libpython) Fiddle::DLError: /app/.heroku/python/lib/libpython3.9.a: invalid ELF header
DEBUG(find_libpython) Unable to find /app/.heroku/python/lib/libpython3.9.a.so
DEBUG(find_libpython) Unable to find /app/.heroku/python/lib/x86_64-linux-gnu/libpython3.9.a
DEBUG(find_libpython) Unable to find /app/.heroku/python/lib/x86_64-linux-gnu/libpython3.9.a.so
DEBUG(find_libpython) Unable to find /app/.heroku/python/lib/libpython3.9
DEBUG(find_libpython) Unable to find /app/.heroku/python/lib/libpython3.9.so
DEBUG(find_libpython) Unable to find /app/.heroku/python/lib/x86_64-linux-gnu/libpython3.9
DEBUG(find_libpython) Unable to find /app/.heroku/python/lib/x86_64-linux-gnu/libpython3.9.so
DEBUG(find_libpython) Unable to find /app/.heroku/python/lib/libpython3.9
DEBUG(find_libpython) Unable to find /app/.heroku/python/lib/libpython3.9.so
DEBUG(find_libpython) Unable to find /app/.heroku/python/lib/x86_64-linux-gnu/libpython3.9
DEBUG(find_libpython) Unable to find /app/.heroku/python/lib/x86_64-linux-gnu/libpython3.9.so
DEBUG(find_libpython) Unable to find /libpython3.9
DEBUG(find_libpython) Unable to find /libpython3.9.so
DEBUG(find_libpython) Unable to find /x86_64-linux-gnu/libpython3.9
DEBUG(find_libpython) Unable to find /x86_64-linux-gnu/libpython3.9.so
DEBUG(find_libpython) Unable to find /app/.heroku/python/libpython3.9
DEBUG(find_libpython) Unable to find /app/.heroku/python/libpython3.9.so
DEBUG(find_libpython) Unable to find /app/.heroku/python/x86_64-linux-gnu/libpython3.9
DEBUG(find_libpython) Unable to find /app/.heroku/python/x86_64-linux-gnu/libpython3.9.so
DEBUG(find_libpython) Unable to find /app/.heroku/python/lib/libpython3.9
DEBUG(find_libpython) Unable to find /app/.heroku/python/lib/libpython3.9.so
DEBUG(find_libpython) Unable to find /app/.heroku/python/lib/x86_64-linux-gnu/libpython3.9
DEBUG(find_libpython) Unable to find /app/.heroku/python/lib/x86_64-linux-gnu/libpython3.9.so
DEBUG(find_libpython) Unable to find /app/.heroku/python/lib/libpython
DEBUG(find_libpython) Unable to find /app/.heroku/python/lib/libpython.so
DEBUG(find_libpython) Unable to find /app/.heroku/python/lib/x86_64-linux-gnu/libpython
DEBUG(find_libpython) Unable to find /app/.heroku/python/lib/x86_64-linux-gnu/libpython.so
DEBUG(find_libpython) Unable to find /app/.heroku/python/lib/libpython
DEBUG(find_libpython) Unable to find /app/.heroku/python/lib/libpython.so
DEBUG(find_libpython) Unable to find /app/.heroku/python/lib/x86_64-linux-gnu/libpython
DEBUG(find_libpython) Unable to find /app/.heroku/python/lib/x86_64-linux-gnu/libpython.so
DEBUG(find_libpython) Unable to find /libpython
DEBUG(find_libpython) Unable to find /libpython.so
DEBUG(find_libpython) Unable to find /x86_64-linux-gnu/libpython
DEBUG(find_libpython) Unable to find /x86_64-linux-gnu/libpython.so
DEBUG(find_libpython) Unable to find /app/.heroku/python/libpython
DEBUG(find_libpython) Unable to find /app/.heroku/python/libpython.so
DEBUG(find_libpython) Unable to find /app/.heroku/python/x86_64-linux-gnu/libpython
DEBUG(find_libpython) Unable to find /app/.heroku/python/x86_64-linux-gnu/libpython.so
DEBUG(find_libpython) Unable to find /app/.heroku/python/lib/libpython
DEBUG(find_libpython) Unable to find /app/.heroku/python/lib/libpython.so
DEBUG(find_libpython) Unable to find /app/.heroku/python/lib/x86_64-linux-gnu/libpython
DEBUG(find_libpython) Unable to find /app/.heroku/python/lib/x86_64-linux-gnu/libpython.so
DEBUG(find_libpython) Fiddle::DLError: /app/.heroku/python/lib/libpython3.9.a: invalid ELF header
DEBUG(find_libpython) Fiddle::DLError: libpython3.9: cannot open shared object file: No such file or directory
DEBUG(find_libpython) Fiddle::DLError: libpython: cannot open shared object file: No such file or directory
Traceback (most recent call last):
	4: from -e:1:in `<main>'
	3: from /app/vendor/bundle/ruby/2.7.0/gems/pycall-1.3.1/lib/pycall.rb:13:in `builtins'
	2: from /app/vendor/bundle/ruby/2.7.0/gems/pycall-1.3.1/lib/pycall/init.rb:16:in `const_missing'
	1: from /app/vendor/bundle/ruby/2.7.0/gems/pycall-1.3.1/lib/pycall/init.rb:35:in `init'
/app/vendor/bundle/ruby/2.7.0/gems/pycall-1.3.1/lib/pycall/libpython/finder.rb:95:in `find_libpython': PyCall::PythonNotFound (PyCall::PythonNotFound)

from pycall.rb.

mrkn avatar mrkn commented on June 12, 2024

The debug log showed that pycall couldn't find libpython.so in all the candidate locations.

Where did you install the python built with --enable-shared? You should specify the location of the appropriate python command in PYTHON environment variable.

from pycall.rb.

dsounded avatar dsounded commented on June 12, 2024

Yeah. actually wanted to leave a comment with the solution...
For Heroku it works with the fork I provided + you need to specify LIBPYTHON as /app/.heroku/python/bin/python3.9 in my case (I wanted to use 3.9.0) since default python and python3 execs are infrastructures ones.

To find needed executable path you can run heroku run whereis python that helped me to find a path for needed version and now it looks good.

Thank you again for your time and this library!
Maybe this comment will help someone in the future :)

from pycall.rb.

ferrisoxide avatar ferrisoxide commented on June 12, 2024

I realise this issue is closed, but if it helps anyone I managed to get pycall working Heroku working using this buildpack:

https://github.com/ReforgeHQ/heroku-buildpack-python.git

from pycall.rb.

mrkn avatar mrkn commented on June 12, 2024

Is there anyone who can write the description in README to explain how to use pycall on Heroku?

from pycall.rb.

ferrisoxide avatar ferrisoxide commented on June 12, 2024

Is there anyone who can write the description in README to explain how to use pycall on Heroku?

@mrkn Took a stab at it here (#134). Might be worth someone else running their eyes over the delta, as I was only going by my notes from a project a few months back. Hope this is of some use.

from pycall.rb.

Tshamp7 avatar Tshamp7 commented on June 12, 2024

Yeah. actually wanted to leave a comment with the solution...
For Heroku it works with the fork I provided + you need to specify LIBPYTHON as /app/.heroku/python/bin/python3.9 in my case (I wanted to use 3.9.0) since default python and python3 execs are infrastructures ones.

To find needed executable path you can run heroku run whereis python that helped me to find a path for needed version and now it looks good.

Thank you again for your time and this library!
Maybe this comment will help someone in the future :)

when I attempt to specify LIBPYTHON with the correct path from heroku I get:

Fiddle::DLError: /app/.heroku/python/bin/python3.9: cannot dynamically load position-independent executable

@dsounded do you know how to fix this? thanks!

from pycall.rb.

Tshamp7 avatar Tshamp7 commented on June 12, 2024

Yeah. actually wanted to leave a comment with the solution...
For Heroku it works with the fork I provided + you need to specify LIBPYTHON as /app/.heroku/python/bin/python3.9 in my case (I wanted to use 3.9.0) since default python and python3 execs are infrastructures ones.
To find needed executable path you can run heroku run whereis python that helped me to find a path for needed version and now it looks good.
Thank you again for your time and this library!
Maybe this comment will help someone in the future :)

when I attempt to specify LIBPYTHON with the correct path from heroku I get:

Fiddle::DLError: /app/.heroku/python/bin/python3.9: cannot dynamically load position-independent executable

@dsounded do you know how to fix this? thanks!

I had to clear my build cache on heroku. Then it worked fine.

from pycall.rb.

buncis avatar buncis commented on June 12, 2024

@dsounded @Tshamp7 hello I have same problem and still can't make it work even with dsounded branch

I'm trying to use python -3.9.6 with --enable-shared
actually how to specify the LIBPYTHON that you guys talk about ?

I've set it on my config var
as

heroku config:set LIBPYTHON = /app/.heroku/python/bin/python3.9

or

heroku config:set libpython = /app/.heroku/python/bin/python3.9

and clear my build cache still it gives error when my rails app checking the rake tasks

my runtime.txt
python-3.9.6

and I'm using heroku-20 stack

apparently after checking my python3 on heroku its not builded with --enabled-shared even though I have using buildpacks that have --enable-shared options

from pycall.rb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.