Comments (15)
@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.
I've forked it to see if this fixes the problem: https://github.com/richgong/heroku-buildpack-python
from pycall.rb.
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.
@raphaelfarzankashani I think @richgong's this commit fixes this issue.
Why do you want to contact me directly?
from pycall.rb.
I close this issue because this is not pycall.rb's responsibility.
from pycall.rb.
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.
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.
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.
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.
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.
Is there anyone who can write the description in README to explain how to use pycall on Heroku?
from pycall.rb.
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.
Yeah. actually wanted to leave a comment with the solution...
For Heroku it works with the fork I provided + you need to specifyLIBPYTHON
as/app/.heroku/python/bin/python3.9
in my case (I wanted to use 3.9.0) since defaultpython
andpython3
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.
Yeah. actually wanted to leave a comment with the solution...
For Heroku it works with the fork I provided + you need to specifyLIBPYTHON
as/app/.heroku/python/bin/python3.9
in my case (I wanted to use 3.9.0) since defaultpython
andpython3
execs are infrastructures ones.
To find needed executable path you can runheroku 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.
@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)
- CI: Add windows-latest in conda job
- gem install --pre pycall *Error* on Windows Ruby installed by Rubyinstaller HOT 7
- "[BUG] object allocation during garbage collection phase" on Windows HOT 1
- uninitialized constant PyCall::LibPython::Helpers HOT 7
- Using pycall on Dokku (Heroku compatible alternative) HOT 13
- PyCall::LibPythonFunctionNotFound (Unable to find the required symbol in libpython: _Py_NoneStruct) HOT 5
- _Py_NoneStruct (PyCall::LibPythonFunctionNotFound) HOT 1
- how to deploy to heroku? HOT 9
- import_module from other folder than lib? HOT 1
- Question about loading a subclass HOT 1
- exceptions not raised from within without_gvl block HOT 1
- pycall freezes and never resolves during a controller function HOT 1
- DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead
- Catching python STDOUT
- Memory issue HOT 2
- Memory leak with numpy HOT 1
- Unable to find required symbol in libpython when using a conda env HOT 1
- call with docx module, GIL is released (the current Python thread state is NULL) HOT 1
- cannot move cursor
- Test failure on 3.12 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pycall.rb.