komoot / staticmap

A small, python-based library for creating map images with lines, markers and polygons.

Home Page:https://www.komoot.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot install with pip

kambrium opened this issue · comments

I use Python 3.5.2 in a virtual environment on a machine with Lubuntu 16.04.6 LTS. I just tried to install staticmap in a brand new virtual environment with

pip install staticmap

and got the following message:

Collecting staticmap
Collecting requests (from staticmap)
  Downloading https://files.pythonhosted.org/packages/51/bd/23c926cd341ea6b7dd0b2a00aba99ae0f828be89d72b2190f27c11d4b7fb/requests-2.22.0-py2.py3-none-any.whl (57kB)
    100% |████████████████████████████████| 61kB 441kB/s 
Collecting futures (from staticmap)
  Using cached https://files.pythonhosted.org/packages/47/04/5fc6c74ad114032cd2c544c575bffc17582295e9cd6a851d6026ab4b2c00/futures-3.3.0.tar.gz
    Complete output from command python setup.py egg_info:
    This backport is meant only for Python 2.
    It does not work on Python 3, and Python 3 users do not need it as the concurrent.futures package is available in the standard library.
    For projects that work on both Python 2 and 3, the dependency needs to be conditional on the Python version, like so:
    extras_require={':python_version == "2.7"': ['futures']}
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-vgfyrmqc/futures/

I tried to reproduce it with Python 3.5.5 and pip 19.2.3 and it worked. I also checked it using python 2.7. can you provide more information about your setup @kambrium

The setup details can be found here.

Create a venv and activate it.

python3 -m venv /path/to/venv/of/staticmapservice
source /path/to/venv/of/staticmapservice/bin/activate

Clone staticmapservice and change to the application directory.

git clone https://github.com/kambrium/staticmapservice
cd staticmapservice

Install requirements.

pip install -r requirements.txt

Export the FLASK_APP variable and run the software.

export FLASK_APP=staticmapservice.py
flask run

In your browser, send a request with some query parameters to the API. Here's an example that should work:

http://127.0.0.1:5000/?w=400&h=300&z=9&marker=coords:48.25,11.22|diam:10|color:%233F33FF

As a response you should get a static map of southern Bavaria with a blue marker next to the city of Munich. See below for a detailed list of currently supported query parameters.

that does not help. To reproduce it, versions of pip and python are needed.

$ python --version
Python 3.5.2
$ pip --version
pip 8.1.1 from /home/john/doe/lib/python3.5/site-packages (python 3.5)

So I upgraded pip in my virtual environment and the installation works...

pip install --upgrade pip

that version is quite old (4.5 years). I am also not a pip expert to figure out how to make it work for older versions too.