Quantcast
Channel: MarsHut
Viewing all articles
Browse latest Browse all 6551

FilenotFoundError from shell but not from browser...

$
0
0
Hi!,
I have a error when i want open a file by a geoip2 library (a library for
geolocation IP from MaxMind DB).

*When I input this:*

*geoip2.database.Reader('http://localhost:6543/static/geoipdb/geolite2country.mmdb')*

*I get this error:*Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File
"/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/geoip2/database.py",
line 48, in __init__
self.db_reader = maxminddb.Reader(filename)
File
"/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/maxminddb/reader.py",
line 37, in __init__
with open(database, 'r+b') as db_file:
*FileNotFoundError: [Errno 2] No such file or directory:
'http://localhost:6543/static/geoipdb/geolite2country.mmdb'*

The curious thing about all this is that since the browser finds the
file... :S

Thanks!

Best,
Emilio

Viewing all articles
Browse latest Browse all 6551

Trending Articles