calm-artist-46894
05/04/2020, 4:59 PMlibcurl
that depends on shared library wich is not part of the Python package itself, what’s the recommended way to include them in a pex?
Currently I try:
pex --python=python3 pycurl -o testpycurl.pex
Then in a fresh Python3 container, I tried to use the pex:
root@41161a1cada4:~# ./testpycurl.pex
Python 3.6.8 (default, Jun 11 2019, 01:21:42)
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> import pycurl
Traceback (most recent call last):
File "<console>", line 1, in <module>
ImportError: libcurl.so.4: cannot open shared object file: No such file or directory
>>>
I understand this is beyond Python, i.e., pip install pycurl
itself would fail if libcurl
is not installed prior to install pycurl
, but would like to check if there any support from pex
, or this is believed to be solved by another layer of tools (e.g. docker)aloof-angle-91616
05/04/2020, 5:02 PMwitty-crayon-22786
05/04/2020, 5:14 PMpex
will use pip
to build the binary wheelpycurl
was pre-built: https://pypi.org/project/pycurl/#filespex
could do that…? https://stackoverflow.com/questions/23916186/how-to-include-external-library-with-python-wheel-packagealoof-angle-91616
05/04/2020, 5:18 PMwitty-crayon-22786
05/04/2020, 5:21 PMaloof-angle-91616
05/04/2020, 5:21 PMcalm-artist-46894
05/04/2020, 5:41 PMpex
as it is now, I can
1. either build the wheel in a way that the needed .so
are embedded (tensorflow
package is exactly this case)
2. or include the .so
file as loose file to the pex file, as well as some loading logic in my codealoof-angle-91616
05/04/2020, 5:45 PMwitty-crayon-22786
05/04/2020, 5:47 PMpycurl
wheel which would embed the shared library into the wheel, afaict. at that point pip/pex could use the new wheel, and it would be dependency-lessenough-analyst-54434
05/04/2020, 7:53 PM