marceloprates / prettymaps

A small set of Python functions to draw pretty maps from OpenStreetMap data. Based on osmnx, matplotlib and shapely libraries.
GNU Affero General Public License v3.0
11.14k stars 527 forks source link

Error with installation on Python 3.9 #10

Closed flxai closed 3 years ago

flxai commented 3 years ago

If I follow the installation instructions, vsketch works, but for prettymaps I get the following error:

pip install "git+https://github.com/marceloprates/prettymaps.git"
Defaulting to user installation because normal site-packages is not writeable
Collecting git+https://github.com/marceloprates/prettymaps.git
  Cloning https://github.com/marceloprates/prettymaps.git to /tmp/pip-req-build-9bvx3_4y
  Running command git clone -q https://github.com/marceloprates/prettymaps.git /tmp/pip-req-build-9bvx3_4y
ERROR: Exception:
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/pip/_internal/cli/base_command.py", line 223, in _main
    status = self.run(options, args)
  File "/usr/lib/python3.9/site-packages/pip/_internal/cli/req_command.py", line 180, in wrapper
    return func(self, options, args)
  File "/usr/lib/python3.9/site-packages/pip/_internal/commands/install.py", line 320, in run
    requirement_set = resolver.resolve(
  File "/usr/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 121, in resolve
    self._result = resolver.resolve(
  File "/usr/lib/python3.9/site-packages/resolvelib/resolvers.py", line 454, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File "/usr/lib/python3.9/site-packages/resolvelib/resolvers.py", line 319, in resolve
    name, crit = self._merge_into_criterion(r, parent=None)
  File "/usr/lib/python3.9/site-packages/resolvelib/resolvers.py", line 176, in _merge_into_criterion
    crit = Criterion.from_requirement(self._p, requirement, parent)
  File "/usr/lib/python3.9/site-packages/resolvelib/resolvers.py", line 80, in from_requirement
    cands = build_iter_view(matches)
  File "/usr/lib/python3.9/site-packages/resolvelib/structs.py", line 148, in build_iter_view
    matches = list(matches)
  File "/usr/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 285, in <genexpr>
    if constraint.is_satisfied_by(c)
  File "/usr/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/base.py", line 66, in is_satisfied_by
    return self.specifier.contains(candidate.version, prereleases=True)
  File "/usr/lib/python3.9/site-packages/packaging/specifiers.py", line 790, in contains
    item = parse(item)
  File "/usr/lib/python3.9/site-packages/packaging/version.py", line 57, in parse
    return Version(version)
  File "/usr/lib/python3.9/site-packages/packaging/version.py", line 296, in __init__
    match = self._regex.search(version)
TypeError: expected string or bytes-like object

This is within a Miniconda environment using Python 3.9. Is there a way to fix this?

pierre-vo commented 3 years ago

Same message on arch with Python 3.9.6

edit: extra/python-pip 20.3.4-1 edit2: updated pip and installation worked

CharbelAD commented 3 years ago

Yes I could not download it using pip either, also Arch with python 3.9. But cloning works fine, you can try that.

asmunder commented 3 years ago

Also on Arch, I had to upgrade pip itself, then it installed smoothly.

flxai commented 3 years ago

Upgrading via pip install --upgrade pip lead to pip downloading multiple versions starting from version 21.2.4 and going backwards. (Discarding ... has different version in metadata: ...). I could update pip inside miniconda:

$ conda install pip
[...]
$ pip --version
pip 20.3.4 from /usr/lib/python3.9/site-packages/pip (python 3.9)

Unfortunately the installation still fails with the new pip. @asmunder what version of pip worked for you?

asmunder commented 3 years ago

Pip version 21.2.4 here.

CharbelAD commented 3 years ago

Upgrading via pip install --upgrade pip lead to pip downloading multiple versions starting from version 21.2.4 and going backwards. (Discarding ... has different version in metadata: ...). I could update pip inside miniconda:

$ conda install pip
[...]
$ pip --version
pip 20.3.4 from /usr/lib/python3.9/site-packages/pip (python 3.9)

Unfortunately the installation still fails with the new pip. @asmunder what version of pip worked for you?

This problem happened to me after installing vsketch, I updated pip site-wide (as root user) for it to be fixed. And then I cloned the library to use it.

jmbernabotto commented 3 years ago

Hello. I have pip version 21.2.4, but unfortunately, I can't install vsketch. I use Mac mini M1. It's perhaps the reason ! here the message ERROR: Could not find a version that satisfies the requirement vsketch (unavailable) (from versions: none) ERROR: No matching distribution found for vsketch (unavailable)

flxai commented 3 years ago

Thanks to both of you. Upgrading pip to 21.2.4 helped. The import of prettymaps works, but now vsketch is broken. I will close the issue because it is solved.

@jmbernabotto I'd suggest opening a new issue that details the commands you used. Your issue is different from this one and its current description is not clear enough to help you. Also maybe try invoking pip using pip3 install ... or even python3 -m pip install ....

abey79 commented 3 years ago

@jmbernabotto Use the latest of Python 3.9 series installed with MacPort. I know of no other setup that will properly work on M1 macs.