Kozea / cairocffi

CFFI-based cairo bindings for Python.
https://doc.courtbouillon.org/cairocffi
BSD 3-Clause "New" or "Revised" License
208 stars 54 forks source link

Can't install new release #211

Closed mikehearn closed 1 year ago

mikehearn commented 1 year ago

The new 1.5.0 release doesn't install for me using pipenv and Ubuntu 20 LTS:

Adding cairosvg to Pipfile's [packages]…
Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
 self.repository.get_dependencies(ireq)
  File "/usr/lib/python3/dist-packages/pipenv/patched/piptools/repositories/pypi.py", line 174, in get_dependencies
    legacy_results = self.get_legacy_dependencies(ireq)
  File "/usr/lib/python3/dist-packages/pipenv/patched/piptools/repositories/pypi.py", line 222, in get_legacy_dependencies
    result = reqset._prepare_file(self.finder, ireq, ignore_requires_python=True)
  File "/usr/lib/python3/dist-packages/pipenv/patched/notpip/req/req_set.py", line 644, in _prepare_file
    abstract_dist.prep_for_dist()
  File "/usr/lib/python3/dist-packages/pipenv/patched/notpip/req/req_set.py", line 134, in prep_for_dist
    self.req_to_install.run_egg_info()
  File "/usr/lib/python3/dist-packages/pipenv/vendor/pip9/req/req_install.py", line 435, in run_egg_info
    call_subprocess(
  File "/usr/lib/python3/dist-packages/pipenv/vendor/pip9/utils/__init__.py", line 705, in call_subprocess
    raise InstallationError(
pip9.exceptions.InstallationError: Command "python setup.py egg_info" failed with error code 1 in /tmp/tmp1bi2di3ibuild/cairocffi/
liZe commented 1 year ago

Hi!

The stack trace doesn’t explain what’s this "error code 1", so it’s hard to find what’s going on. Do you have a more explicit error message hidden somewhere?

It works with the latest version of pipenv. I’ve tried to use pipenv’s version provided by Ubuntu 20.04 (seems to be 11.9.0), but it looks like it doesn’t work with Python 3.9+, and I don’t have Python 3.8 installed anymore.

mikehearn commented 1 year ago

Yeah, I know sorry. I didn't get any other more useful error - that stack trace is it. Maybe there's a flag to tell pipenv to show subprocess output? I'm not particularly expert at Python.

liZe commented 1 year ago

Maybe there's a flag to tell pipenv to show subprocess output?

Do you get something interesting with the --verbose option?

mikehearn commented 1 year ago

Good tip:

INFO:pip9._vendor.requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): pypi.org
INFO:notpip.req.req_set:Collecting cairocffi==1.5.0
INFO:pip9.download:File was already downloaded /home/mike/.cache/pipenv/pkgs/cairocffi-1.5.0.tar.gz
INFO:pip9.utils:Complete output from command python setup.py egg_info:
INFO:pip9.utils:Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.8/tokenize.py", line 392, in open
    buffer = _builtin_open(filename, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmpcnwhj1_nbuild/cairocffi/setup.py'
liZe commented 1 year ago

FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmpcnwhj1_nbuild/cairocffi/setup.py'

Then it means that the version of pip bundled in your version of pipenv is not able to install packages that don’t include a setup.py file. (I think that it’s supported in pip since 2018…)

For know, if you can’t use a more recent version of pipenv (you can in a Python virtual environment), you’ll be stuck with the precedent version of cairocffi :/.

mikehearn commented 1 year ago

OK so this is to do with Ubuntu 20 being too old? It's probably about time to upgrade anyway.

liZe commented 1 year ago

OK so this is to do with Ubuntu 20 being too old?

Yes, pipenv 11.9.0 is provided by Ubuntu, and it’s 5 years old.

It's probably about time to upgrade anyway.

You can upgrade Ubuntu, or just install pipenv in a virtual environment if you prefer.