-
-
Notifications
You must be signed in to change notification settings - Fork 230
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
Trafilatura can't be loaded after installing it to local folder #30
Comments
Thank you, it was indeed a problem, I fixed it in 1a57635, could you please confirm by trying the version straight from the repository? ( |
Hey, thanks for the fast response! I just made a new environment and tried to set up everything. However, (even if the package gets downloaded into the "package"-folder) I get following error:
|
Hi, the changes I introduced created a bug on some platforms but I don't
think it was the issue here.
I guess you face a package managing issue, as lxml should have been
installed and added to your Python path.
It seems that errors linked to target directories with pip are not fully
documented: pypa/pip#8725
Maybe this kind of approach could be useful for you:
https://stackoverflow.com/questions/24174821/how-to-change-default-install-location-for-pip/24175174#24175174
|
Afaik, lxml needs to be compiled and installed for each machine. Therefore, „portable“ compatibility (install it to a folder and copy it anywhere and run it) can’t be achieved with lxml. In my case I would like to push it on AWS Lambda (localstack; can't install things easily there). I guess it won’t work as long as this project builds on lxml. However, I already found some alternatives for now (I expose your project via a REST-Service on my machine for development purposes). Later (on AWS) I should be able to use EC2 to install all necessary packages such as lxml. |
Hi @HaIDsIEx, please refer to this answer and this code snippet, both show how to solve the issue with LXML. |
Hi,
I just tried to install your awsome project to an local folder (
pip install --target {path}/package trafilatura
). After installing it I cant load it withfrom package import trafilatura
:Python code used:
Note:
I'm using Python 3.7.6 with pip 20.0.2.
Edit:
A quick fix (for me) is replacing
TEI_SCHEMA = pkg_resources.resource_filename('trafilatura', 'data/tei-schema.pickle')
in "xml.py" withTEI_SCHMEA = './data/tei-schema.pickle'
andchange line 11 in settings.py from
from trafilatura import __version__
tofrom ..trafilatura import __version__
The text was updated successfully, but these errors were encountered: