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

upload functionality busted in pip version of mapbox CLI? #75

Closed
sbma44 opened this issue Aug 31, 2016 · 4 comments
Closed

upload functionality busted in pip version of mapbox CLI? #75

sbma44 opened this issue Aug 31, 2016 · 4 comments

Comments

@sbma44
Copy link
Member

sbma44 commented Aug 31, 2016

on a vanilla morec2:

$ sudo apt-get update -y
$ pip install mapboxcli
$ export MapboxAccessToken='xyz...'
$ mapbox upload example.geojson sbma44.uploadtest
Usage: mapbox upload [OPTIONS]

Error: Got unexpected extra arguments (example.geojson sbma44.uploadtest)

$ mapbox upload --help
Usage: mapbox upload [OPTIONS]

  Warning: entry point could not be loaded. Contact its author for help.

  Traceback (most recent call last):
    File "/usr/local/lib/python2.7/dist-packages/click_plugins/core.py", line 37, in decorator
      group.add_command(entry_point.load())
    File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2087, in load
      if require: self.require(env, installer)
    File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2100, in require
      working_set.resolve(self.dist.requires(self.extras),env,installer)))
    File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 632, in resolve
      raise VersionConflict(dist,req) # XXX put more info here
  VersionConflict: (six 1.5.2 (/usr/lib/python2.7/dist-packages), Requirement.parse('six>=1.8.0'))

Options:
  --help  Show this message and exit.
@sbma44
Copy link
Member Author

sbma44 commented Aug 31, 2016

Tried this with pip3; same story. Fixed the format of the access token env var as well, to no avail.

Interesting error when running the command without any params:

$ mapbox
Usage: mapbox [OPTIONS] COMMAND [ARGS]...

  This is the command line interface to Mapbox web services.

  Mapbox web services require an access token. Your token is shown on the
  https://www.mapbox.com/studio/account/tokens/ page when you are logged in.
  The token can be provided on the command line

    $ mapbox --access-token MY_TOKEN ...

  as an environment variable named MAPBOX_ACCESS_TOKEN (higher precedence)
  or MapboxAccessToken (lower precedence).

    $ export MAPBOX_ACCESS_TOKEN=MY_TOKEN
    $ mapbox ...

  or in a config file

    ; configuration file mapbox.ini
    [mapbox]
    access-token = MY_TOKEN

  The OS-dependent default config file path is something like

    ~/Library/Application Support/mapbox/mapbox.ini
    ~/.config/mapbox/mapbox.ini
    ~/.mapbox/mapbox.ini

Options:
  --version            Show the version and exit.
  -v, --verbose        Increase verbosity.
  -q, --quiet          Decrease verbosity.
  --access-token TEXT  Your Mapbox access token.
  -c, --config PATH    Config file
  --help               Show this message and exit.

Commands:
  config       † Warning: could not load plugin. See `mapbox config --help`.
  dataset      † Warning: could not load plugin. See `mapbox dataset --help`.
  directions   † Warning: could not load plugin. See `mapbox directions
               --help`.
  distance     † Warning: could not load plugin. See `mapbox distance --help`.
  geocoding    † Warning: could not load plugin. See `mapbox geocoding
               --help`.
  mapmatching  † Warning: could not load plugin. See `mapbox mapmatching
               --help`.
  staticmap    † Warning: could not load plugin. See `mapbox staticmap
               --help`.
  surface      † Warning: could not load plugin. See `mapbox surface --help`.
  upload       † Warning: could not load plugin. See `mapbox upload --help`.

Wondering if this is a pythonpath thing specific to ubuntu? I've had success using the tool via homebrew.

@perrygeo
Copy link
Contributor

We saw the same thing #48 . There's python apt packages in ubuntu that pin six to an old version. One of the mapbox cli dependencies needs a newer version. There's no way to solve it directly without monkeying around with ubuntu's python environment which can lead to Bad Things™.

virtualenv is the right solution - isolate the python deps you need and you should be fine.

@sbma44
Copy link
Member Author

sbma44 commented Aug 31, 2016

makes sense! closing as dupe and/or ubuntu problem

@sbma44 sbma44 closed this as completed Aug 31, 2016
@perrygeo
Copy link
Contributor

This should work on a vanilla ubuntu system

Installation:

$ sudo apt-get install python-pip python-virtualenv
$ virtualenv -p $(which python) /tmp/env
$ source /tmp/env/bin/activate
(env)$ pip install mapboxcli

Then you can run it like this if the virtualenv is activated

(env)$ mapbox upload --help
...

Or by absolute path if you're in a different shell

(env)$ deactivate
$ /tmp/env/bin/mapbox upload --help

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

2 participants