mapbox / mapbox-cli-py

Command line interface to Mapbox Web Services
MIT License
165 stars 44 forks source link

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

Closed Forsskieken closed 6 years ago

Forsskieken commented 6 years ago
### 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
yuletide commented 6 years ago

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

sgillies commented 6 years ago

@Forsskieken @yuletide I believe I have the fix in https://github.com/mapbox/mapbox-sdk-py/commit/f821d6159fb3a1f0f102895c821b1a006e811102, 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
sgillies commented 6 years ago

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