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

HELP - ImportError: cannot import name 'Auth' from 'planet' - HELP #230

Closed
vehlken opened this issue Jan 5, 2023 · 4 comments
Closed

HELP - ImportError: cannot import name 'Auth' from 'planet' - HELP #230

vehlken opened this issue Jan 5, 2023 · 4 comments

Comments

@vehlken
Copy link

vehlken commented Jan 5, 2023

Hello everybody,

first of all I'm new to the planet API and to programming at all. I'm trying to do the tutorial notebooks but get stuck right at the start.

In the "analysis-ready-data"-folder, "ard_1_intro_and_best_practices.ipynb"

when trying to run this chunk
"""
from datetime import datetime
import json
import os
from pathlib import Path
from pprint import pprint
import time
from zipfile import ZipFile
import planet

import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors as colors
from planet import Auth
from planet import Session, DataClient, OrdersClient, data_filter, order_request
import rasterio
from rasterio import plot
from shapely.geometry import MultiPolygon, shape
"""
in the "analysis-ready-data"-folder, "ard_1_intro_and_best_practices.ipynb"-notebook

i get this error message:

"""

ImportError Traceback (most recent call last)
in
11 import matplotlib.pyplot as plt
12 import matplotlib.colors as colors
---> 13 from planet import Auth
14 from planet import Session, DataClient, OrdersClient, data_filter, order_request
15 import rasterio

ImportError: cannot import name 'Auth' from 'planet' (/opt/conda/lib/python3.7/site-packages/planet/init.py)

"""

I'm on windows OS and use the JupyterNotebooks in a docker container as recommended here "https://github.com/planetlabs/notebooks"

i tried to use the "auth" command in other notebooks and also in a seperate PyCharm-environment but always fail to import or find the command.

Did anyone face the same issue or got an idea what I'm doing wrong?

with kind regards,

Leon

@vehlken vehlken changed the title ImportError: cannot import name 'Auth' from 'planet' (/opt/conda/lib/python3.7/site-packages/planet/__init__.py) HELP - ImportError: cannot import name 'Auth' from 'planet' - HELP Jan 5, 2023
@mkshah605
Copy link
Contributor

Hi Leon,

Thanks for your message. What version of the planet package are you using? You should be on some version of 2.0, as the previous 1.0 version did not use the Auth module. You can learn more about how to get started with our Planet SDK using this Quick Start Guide.

@vehlken
Copy link
Author

vehlken commented Jan 10, 2023

Good evening mkshah605,

thank you for your answer. I were running the notebook inside the recommended docker container. It turned out that the planet package provided there is on version 1.5.0.2 or something. I set up an new environment outside the docker container now and installed planet 2.+ and everything ist working fine now for me.

@mkshah605
Copy link
Contributor

That's great to hear! Glad you got it working. We are working on updating the instructions, including package requirements, for this repo to be more current and accessible so issues like this can be avoided in the future. Thank you for bringing this to our attention!

@mackenzie1
Copy link

This worked for me when I had a similar issue:
PyGithub/PyGithub#2550

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

3 participants