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

lxml for Python 3.9 or later #816

Open
elektrokokke opened this issue Feb 28, 2023 · 5 comments
Open

lxml for Python 3.9 or later #816

elektrokokke opened this issue Feb 28, 2023 · 5 comments
Labels

Comments

@elektrokokke
Copy link

I am trying to use soco in a BeeWare project, which gives me the following error when building for Android:

Chaquopy: Installing for arm64-v8a
Looking in indexes: https://pypi.org/simple, https://chaquo.com/pypi-7.0, https://chaquo.com/pypi-13.1
Collecting soco
Using cached soco-0.29.1-py2.py3-none-any.whl (160 kB)
Collecting toga-android~=0.3.0
Using cached toga_android-0.3.0-py3-none-any.whl (40 kB)
Collecting requests
Using cached requests-2.28.2-py3-none-any.whl (62 kB)
Collecting xmltodict
Using cached xmltodict-0.13.0-py2.py3-none-any.whl (10.0 kB)
Collecting lxml
Using cached lxml-4.9.2.tar.gz (3.7 MB)
ERROR: Command errored out with exit status 1:
command: /home/jacobs/beeware-tutorial/beeware-venv/bin/python3.10 -S -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-4t8fd_w7/lxml/setup.py'"'"'; file='"'"'/tmp/pip-install-4t8fd_w7/lxml/setup.py'"'"';import chaquopy_monkey; chaquopy_monkey.disable_native();f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' --no-user-cfg egg_info --egg-base /tmp/pip-pip-egg-info-8w42_kat
cwd: /tmp/pip-install-4t8fd_w7/lxml/
Complete output (3 lines):
Building lxml version 4.9.2.
Building without Cython.
Error: Please make sure the libxml2 and libxslt development packages are installed.
----------------------------------------
ERROR: Failed to install lxml from https://files.pythonhosted.org/packages/06/5a/e11cad7b79f2cf3dd2ff8f81fa8ca667e7591d3d8451768589996b65dec1/lxml-4.9.2.tar.gz#sha256=2455cfaeb7ac70338b3257f41e21f0724f4b5b0c0e7702da67ee6c3640835b67 (from soco->-r requirements.txt (line 1)).
For assistance, please raise an issue at https://github.com/chaquo/chaquopy/issues.
Chaquopy: Exit status 1

I guess this might be due to Chaquopy trying to install lxml from the generic tar.gz instead of from the android wheel. When I specify the lxml version as 4.6.3 (the latest available for lxml from Chaquopy), the error stays the same, again the tar.gz version from https://pypi.org/simple is used.
I wonder what I can do to work around this? The error said to file an issue with Chaquopy, that is why I came here. But maybe this is something to be filed with Beeware?

@mhsmith
Copy link
Member

mhsmith commented Feb 28, 2023

Strange, it works fine for me. Are you able to visit https://chaquo.com/pypi-7.0 in a browser, and download the lxml wheels manually?

If the problem persists, please try the following:

  • In your app directory, edit android/gradle/.../app/build.gradle, and add the following line to the pip section:
    options "-v"
    
  • Run the build again.
  • Save the log to a file, and attach it to this issue.

@elektrokokke
Copy link
Author

I checked the URL, and I can download the wheel manually.
Here is the log file of the verbose build.
briefcase.2023_02_28-21_15_37.build.log

It suggests that the tags don't match, but I cannot see which one is the problem.
I also attach the build.gradle file for reference (I renamed it to .txt so it can be attached here):
build.gradle.txt

@elektrokokke
Copy link
Author

Ahhh, I think I get the issue. I am using Python 3.10, but the Chaquopy wheel for lxml only is available for Python 3.8, is that right?
Will try with Python 3.8 then...

@elektrokokke
Copy link
Author

Tried it with Python 3.8, which works.
Sorry, I should have known from the cp38 tag.

@mhsmith mhsmith changed the title lxml not installed from https://chaquo.com/pypi-7.0 index, but from tar.gz, resulting in "Error: Please make sure the libxml2 and libxslt development packages are installed." Failed to install lxml on non-default Python versions Mar 1, 2023
@mhsmith
Copy link
Member

mhsmith commented Mar 1, 2023

This package is currently only available for Python 3.8. You can set your app’s Python version by following the instructions here.

If you'd like to try building this package for another Python version, follow the instructions here. This package did not require any patching at all, so building it shouldn't be too difficult. And if you're successful, please make a pull request so we can add the build to the public repository.

If anyone else needs this package for Python 3.9 or later, please click the thumbs up button above, and subscribe to this issue to receive updates.

@mhsmith mhsmith reopened this Mar 1, 2023
@mhsmith mhsmith changed the title Failed to install lxml on non-default Python versions lxml for Python 3.9 or later Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants