mapbox/mapbox-cli-py

python MapboxDeprecationWarning: The distance module will be removed in the next version. Use the matrix module instead. "Use the matrix module instead.", MapboxDeprecationWarning)

Forsskieken opened this issue · 3 comments

What you've tried already

I'm trying to upload a 9MB roads.geojson to my datasets

Expected outcome

I'would like to see this new dataset in my datasets or tilesets

Actual outcome

C:\Users\guyf>mapbox --access-token sk.eyJ1IjoiZm9yc3N1eCIs--I USED My Actual keytratarad2MjV1Z3pqIn0.yPUcxMm330v0O0kIHfsJfw
c:\users\guyf\appdata\local\programs\python\python36-32\lib\site-packages\mapbox\services\distance.py:15: MapboxDeprecationWarning: The distance module will be removed in the next version. Use the matrix module instead.
"Use the matrix module instead.", MapboxDeprecationWarning)
Traceback (most recent call last):
File "c:\users\guyf\appdata\local\programs\python\python36-32\lib\runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "c:\users\guyf\appdata\local\programs\python\python36-32\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\Users\guyf\AppData\Local\Programs\Python\Python36-32\Scripts\mapbox.exe_main
.py", line 5, in
File "c:\users\guyf\appdata\local\programs\python\python36-32\lib\site-packages\mapboxcli\scripts\cli.py", line 14, in
from mapboxcli.scripts import (
File "c:\users\guyf\appdata\local\programs\python\python36-32\lib\site-packages\mapboxcli\scripts\distance.py", line 11, in
type=click.Choice(mapbox.Distance().valid_profiles),
AttributeError: 'Distance' object has no attribute 'valid_profiles'

Other information

  • Version numbers for mapboxcli and mapbox (from, e.g., pip list) :
    C:\Users\guyf>pip freeze
    boto3==1.5.13
    botocore==1.8.27
    CacheControl==0.12.3
    certifi==2017.11.5
    chardet==3.0.4
    click==6.7
    click-plugins==1.0.3
    cligj==0.4.0
    docutils==0.14
    idna==2.6
    iso3166==0.8
    jmespath==0.9.3
    mapbox==0.15.0
    mapboxcli==0.7.0
    msgpack-python==0.5.1
    polyline==1.3.2
    python-dateutil==2.6.1
    requests==2.18.4
    s3transfer==0.1.12
    six==1.11.0
    uritemplate==3.0.0
    urllib3==1.22

  • Operating System : WINDOWS 10

  • Python version number :3.6

  • How did you install the mapbox cli? Homebrew, pip, other? :pip

I'm getting this error also with vanilla python 2.7 on a fresh ubuntu image, with or without virtualenv

@Forsskieken @yuletide I believe I have the fix in mapbox/mapbox-sdk-py@f821d61, but a Travis backlog is preventing me from releasing this afternoon. Would you be willing to try installing directly from Github until I can make the release?

pip install git+https://github.com/mapbox/mapbox-sdk-py.git@f821d6159fb3a1f0f102895c821b1a006e811102#egg=mapbox

I'm going to close this ticket. pip install -U mapbox will be the solution once 0.15.1 is on PyPI (see mapbox/mapbox-sdk-py#220).