dload icon indicating copy to clipboard operation
dload copied to clipboard

Cannot reproduce README example: KeyError: '__file__'

Open nestorSag opened this issue 3 years ago • 10 comments

I try to run the examples from the repo's README file but I get an error. The version of dload is 0.6, python is 3.6.9 and the requests library is 2.23.0; OS is Ubuntu 18.04

import dload
dload.save('https://upload.wikimedia.org/wikipedia/commons/thumb/d/d3/Albert_Einstein_Head.jpg/800px-Albert_Einstein_Head.jpg', '~/einstein.jpg')  
Traceback (most recent call last):
  File "/home/nestor/.local/share/virtualenvs/dl_projects-d1owGBMD/lib/python3.6/site-packages/dload/__init__.py", line 72, in save
    c_path = os.path.dirname(namespace['__file__'])
KeyError: '__file__'
None
''

nestorSag avatar Jul 15 '20 13:07 nestorSag