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

ImportError .so file in python (invalid ELF header) #1439

Closed
Magdiel3 opened this issue May 12, 2020 · 1 comment
Closed

ImportError .so file in python (invalid ELF header) #1439

Magdiel3 opened this issue May 12, 2020 · 1 comment
Labels
type:bug Something isn't working

Comments

@Magdiel3
Copy link

Summary

I'm building a streamlit app with python and deploying it to heroku. The app uses the python wrapper from Starspace and works locally but when running online on Heroku shows an ImportError: /app/starwrap.so: invalid ELF header

Steps to reproduce

What are the steps we should take to reproduce the bug:

  1. Cloned the Starspace repo and followed the steps mentioned to compile the python wrapper
  2. Moved the generated starwrapper.so to my Heroku repo and imported it like
    import starwrap as sw
  3. Deploy app to Heroku

Expected behavior:

Running the streamlit app locally show no error and executes just fine. I can load a saved starspace model, make predictions and display some resutls.

Actual behavior:

In Heroku I get an error displayed when trying to import the starspace python wrapper.

ImportError: /app/starwrap.so: invalid ELF header
Traceback:
File "/app/.heroku/python/lib/python3.8/site-packages/streamlit/ScriptRunner.py", line 322, in _run_script
exec(code, module.dict)
File "/app/collaborative_filtering_interface.py", line 3, in
import starwrap as sw

Is this a regression?

That is, did this use to work the way you expected in the past?
No

Debug info

  • Streamlit version: 0.58.0
  • Python version: 3.8.2
  • OS version: MacOS

Additional information

@Magdiel3 Magdiel3 added type:bug Something isn't working status:needs-triage Has not been triaged by the Streamlit team labels May 12, 2020
@jrhone
Copy link
Contributor

jrhone commented May 18, 2020

Hi @Magdiel3 , I believe you have to build starwrap.so on the platform you plan to use it on. You can't build it on your Mac then use the binary on linux.

@jrhone jrhone closed this as completed May 18, 2020
@jrhone jrhone removed the status:needs-triage Has not been triaged by the Streamlit team label May 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants