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

syntax error while running label-maker download --dest togo --config config.json? #155

Closed
PallawiSinghal opened this issue Nov 19, 2019 · 5 comments

Comments

@PallawiSinghal
Copy link
Contributor

PallawiSinghal commented Nov 19, 2019

when I run the command label-maker download --dest togo --config config.json
I get the following error?
Traceback (most recent call last):
File "/usr/local/bin/label-maker", line 11, in
load_entry_point('label-maker==0.6.1', 'console_scripts', 'label-maker')()
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 480, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 2693, in load_entry_point
return ep.load()
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 2324, in load
return self.resolve()
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 2330, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "/usr/local/lib/python2.7/dist-packages/label_maker/main.py", line 14, in
from label_maker.label import make_labels
File "/usr/local/lib/python2.7/dist-packages/label_maker/label.py", line 96
for tile in tiles(*bounding_box, [zoom]):
SyntaxError: only named arguments may follow expression

my config file contains:
{
"country": "togo",
"bounding_box": [1.09725, 6.05520, 1.34582, 6.30915],
"zoom": 12,
"classes": [
{ "name": "Roads", "filter": ["has", "highway"] },
{ "name": "Buildings", "filter": ["has", "building"] }
],
"imagery": "http://a.tiles.mapbox.com/v4/mapbox.satellite/{z}/{x}/{y}.jpg?access_token=pk.eyJ1IjoicGFsbG3owYzBqMv_lpWOWAUUV47kU7CQ",
"background_ratio": 1,
"ml_type": "classification"
}

@drewbo
Copy link
Contributor

drewbo commented Nov 19, 2019

@PallawiSinghal it looks like you're using python 2.7 but only 3.6+ is supported

@PallawiSinghal
Copy link
Contributor Author

PallawiSinghal commented Nov 19, 2019

Thank you. I changed that and it worked
Now when I run the above command I get the following error:
Can you please help. I have almost spent 3 days but I am not able to run this.

(venv) pallawi@pallawi-Nitro-AN715-51:~/my_new_project$ label-maker download --dest ./data/ --config config.json
Traceback (most recent call last):
File "/home/pallawi/my_new_project/venv/bin/label-maker", line 7, in
from label_maker.main import cli
File "/home/pallawi/my_new_project/venv/lib/python3.6/site-packages/label_maker/main.py", line 14, in
from label_maker.label import make_labels
File "/home/pallawi/my_new_project/venv/lib/python3.6/site-packages/label_maker/label.py", line 22, in
from label_maker.utils import class_match
ImportError: cannot import name 'class_match'

@PallawiSinghal
Copy link
Contributor Author

PallawiSinghal commented Nov 19, 2019

Finally I did it. yeeeee.
Just wrote
**from label_maker.utils impor t * **
and it worked.

@ramyaragupathy
Copy link

@drewbo - I'm still seeing this error:

from label_maker.utils import class_match ImportError: cannot import name 'class_match'

Did you update the files under lib directly @PallawiSinghal - even that threw the same error for me specifically for get_image function

@Rub21
Copy link

Rub21 commented Dec 17, 2019

@ramyaragupathy Maybe you could use label-maker from the docker container: https://github.com/developmentseed/docker-label-maker it works fine for me.

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

4 participants