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: int() argument must be a string, a bytes-like object or a number, not 'NoneType' #19

Closed
lastproxy opened this issue Jul 26, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@lastproxy
Copy link

below is my script for downloading landsat 8 data:

import landsatxplore.api
from landsatxplore.earthexplorer import EarthExplorer

# Initialize a new API instance and get an access key
api = landsatxplore.api.API(username='xxxxx', password='xxx')

# Request
scenes = api.search(
    dataset='LANDSAT_8_C1',
    latitude=38.7,
    longitude=115.5,
    start_date='2019-01-01',
    end_date='2020-01-01',
    max_cloud_cover=50)

print('{} scenes found.'.format(len(scenes)))

ee = EarthExplorer(username='xxxxx', password='xxx')
for scene in scenes:
    print(scene['acquisitionDate'], scene['entityId'])
    ee.download(scene_id=scene['entityId'], output_dir='.')


api.logout()
ee.logout()

and the error msg looks like this:

20 scenes found.
2019-01-05 LC81230332019005LGN00
Traceback (most recent call last):
  File "download.py", line 21, in <module>
    ee.download(scene_id=scene['entityId'], output_dir='.')
  File "/home/user/anaconda3/lib/python3.7/site-packages/landsatxplore-0.6-py3.7.egg/landsatxplore/earthexplorer.py", line 95, in download
    filename = self._download(url, output_dir)
  File "/home/user/anaconda3/lib/python3.7/site-packages/landsatxplore-0.6-py3.7.egg/landsatxplore/earthexplorer.py", line 75, in _download
    file_size = int(r.headers.get("Content-Length"))
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'

Could you please give me a hint on this error?

@yannforget yannforget added the bug Something isn't working label Jul 27, 2020
@yannforget
Copy link
Owner

Thanks for the bug report,

The issue should be fixed in the last release

@Ahmed-0357
Copy link

i am getting the same error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants