Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: request() got an unexpected keyword argument 'json' #117

Open
iandees opened this issue May 1, 2018 · 0 comments
Open

TypeError: request() got an unexpected keyword argument 'json' #117

iandees opened this issue May 1, 2018 · 0 comments

Comments

@iandees
Copy link

iandees commented May 1, 2018

What you've tried already

I'm on an EC2 m5.2xl instance running Amazon Linux. Following installation instructions, I used pip:

pip install --user mapboxcli

That installed and I was able to run mapbox:

$ mapbox --version
/home/ec2-user/.local/lib/python2.7/site-packages/mapbox/services/distance.py:20: MapboxDeprecationWarning: The distance module will be removed in the next version. Use the matrix module instead.
  "Use the matrix module instead.", MapboxDeprecationWarning)
0.7.0

I generated a dataset using tippecanoe and am trying to upload it, but it fails:

$ mapbox upload tiger2017-delta /mnt/osmqa/missing_tiger.mbtiles
/home/ec2-user/.local/lib/python2.7/site-packages/mapbox/services/distance.py:20: MapboxDeprecationWarning: The distance module will be removed in the next version. Use the matrix module instead.
  "Use the matrix module instead.", MapboxDeprecationWarning)
Uploading data source  [####################################]  100%
Traceback (most recent call last):
  File "/home/ec2-user/.local/bin/mapbox", line 11, in <module>
    sys.exit(main_group())
  File "/home/ec2-user/.local/lib/python2.7/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/ec2-user/.local/lib/python2.7/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/ec2-user/.local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/ec2-user/.local/lib/python2.7/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/ec2-user/.local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/ec2-user/.local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/ec2-user/.local/lib/python2.7/site-packages/mapboxcli/scripts/uploads.py", line 71, in upload
    callback=callback)
  File "/home/ec2-user/.local/lib/python2.7/site-packages/mapbox/services/uploads.py", line 278, in upload
    return self.create(url, tileset, name=name, patch=patch)
  File "/home/ec2-user/.local/lib/python2.7/site-packages/mapbox/services/uploads.py", line 166, in create
    resp = self.session.post(uri, json=msg)
  File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 377, in post
    return self.request('POST', url, data=data, **kwargs)
TypeError: request() got an unexpected keyword argument 'json'

After a few minutes typing this bug report, I tried running that again and got:

$ mapbox upload tiger2017-delta /mnt/osmqa/missing_tiger.mbtiles
/home/ec2-user/.local/lib/python2.7/site-packages/mapbox/services/distance.py:20: MapboxDeprecationWarning: The distance module will be removed in the next version. Use the matrix module instead.
  "Use the matrix module instead.", MapboxDeprecationWarning)
Uploading data source  [###################################-]   99%
{"id":"cjgnpsl6f0k8d5so3bohz0hjj","name":"tiger2017-delta","complete":false,"error":null,"created":"2018-05-01T13:34:41.777Z","modified":"2018-05-01T13:34:41.777Z","tileset":"openstreetmapus.tiger2017-delta","owner":"openstreetmapus","progress":0}

Other information

  • Version numbers for mapboxcli and mapbox (from, e.g., pip list) :

    mapbox                       0.15.1
    mapboxcli                    0.7.0
    
  • Operating System : Amazon Linux

  • Python version number : Python 2.7.13

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant