I want to import algolia python lib to my python 3 app engine project.
So I did
pip install algoliasearch -t lib
And in my lib folder I created __init__.py
Then In my project I import using
from lib.algoliasearch.search_client import SearchClient
So far so good. But in algolia library, for instance
lib\algoliasearch\search_client.py
There is also import statements as below:
from algoliasearch.helpers import endpoint, is_async_available
this works when I installed globally otherwise for installed in lib folder, it does not work when I deploy app engine.
As a solution I could update those files
from lib.algoliasearch.helpers import endpoint, is_async_available
which is a terrible solution.
On the other hand, if I apply:
import sys
sys.path.insert(0, './lib')
this time, it is broken at several part i.e.
libcrypto_path = find_library(b'crypto' if sys.version_info < (3,) else 'crypto')
if not libcrypto_path:
raise LibraryNotFoundError('The library libcrypto could not be found')
at
lib\asn1crypto\_perf\_big_num_ctypes.py
How can I properly import this algoliasearch lib?
Note: I could guess, Algolia team should update their packages by giving relative paths such as:
instead of
from algoliasearch.helpers import endpoint, is_async_available
this:
from helpers import endpoint, is_async_available