bmtgoncalves / pynasa Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
These lines don't seem to correctly package resources.json
. I had to wget it directly into my virtualenv's site-packages/pyNASA
folder after getting this error:
(Using Python 3.5)
In [2]: nasa = pyNASA() [65/804]
WARNING:root:Requests made without an app_token will be subject to strict throttling limits.
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
<ipython-input-2-4515acee3e8d> in <module>()
----> 1 nasa = pyNASA()
/home/fubar/.envs/nasa/lib/python3.5/site-packages/pyNASA/__init__.py in __init__(self, token, secret)
10 self.client = Socrata("data.nasa.gov", token)
11
---> 12 data = pkg_resources.resource_string(__name__, "resources.json")
13 resources = json.loads(data.decode())
14
/home/fubar/.envs/nasa/lib/python3.5/site-packages/pkg_resources/__init__.py in resource_string(self, package_or_requirement, resource_name)
1213 """Return specified resource as a string"""
1214 return get_provider(package_or_requirement).get_resource_string(
-> 1215 self, resource_name
1216 )
1217
/home/fubar/.envs/nasa/lib/python3.5/site-packages/pkg_resources/__init__.py in get_resource_string(self, manager, resource_name)
1455
1456 def get_resource_string(self, manager, resource_name):
-> 1457 return self._get(self._fn(self.module_path, resource_name))
1458
1459 def has_resource(self, resource_name):
/home/fubar/.envs/nasa/lib/python3.5/site-packages/pkg_resources/__init__.py in _get(self, path)
1575
1576 def _get(self, path):
-> 1577 with open(path, 'rb') as stream:
1578 return stream.read()
1579
FileNotFoundError: [Errno 2] No such file or directory: '/home/fubar/.envs/nasa/lib/python3.5/site-packages/pyNASA/resources.json'
Running the following code results in the subsequent error.
>>> from pyNASA import pyNASA
>>> nasa = pyNASA()
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-2-4515acee3e8d> in <module>()
----> 1 nasa = pyNASA()
/Users/foo/anaconda2/lib/python2.7/site-packages/pyNASA/__init__.py in __init__(self, token, secret)
14
15 for dataset in resources:
---> 16 pyNASA._add_resource_(**dataset)
17
18 def _add_resource_(id, name, description):
TypeError: unbound method _add_resource_() must be called with pyNASA instance as first argument (got nothing instead)
Running the basic case here https://bmtgoncalves.github.io/pyNASA/ shows the following error. I already moved resources.json to the pyNASA folder
Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 26 2016, 12:10:39)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
`from pyNASA import pyNASA
nasa = pyNASA
data = nasa.outgassing()
Traceback (most recent call last):
File "", line 1, in
AttributeError: class pyNASA has no attribute 'outgassing'`
Initializing the class as 'PyNASA()' shows a 'not defined' error:
Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 26 2016, 12:10:39)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
from pyNASA import pyNASA
nasa = PyNASA()
Traceback (most recent call last):
File "", line 1, in
NameError: name 'PyNASA' is not defined`
nasa = pyNASA()
FileNotFoundError Traceback (most recent call last)
in ()
----> 1 nasa = pyNASA()
c:\users\harkirat\appdata\local\programs\python\python36\lib\site-packages\pyNASA_init_.py in init(self, token, secret)
10 self.client = Socrata("data.nasa.gov", token)
11
---> 12 data = pkg_resources.resource_string(name, "resources.json")
13 resources = json.loads(data.decode())
14
c:\users\harkirat\appdata\local\programs\python\python36\lib\site-packages\pkg_resources_init_.py in resource_string(self, package_or_requirement, resource_name)
1147 """Return specified resource as a string"""
1148 return get_provider(package_or_requirement).get_resource_string(
-> 1149 self, resource_name
1150 )
1151
c:\users\harkirat\appdata\local\programs\python\python36\lib\site-packages\pkg_resources_init_.py in get_resource_string(self, manager, resource_name)
1391
1392 def get_resource_string(self, manager, resource_name):
-> 1393 return self._get(self._fn(self.module_path, resource_name))
1394
1395 def has_resource(self, resource_name):
c:\users\harkirat\appdata\local\programs\python\python36\lib\site-packages\pkg_resources_init_.py in _get(self, path)
1514
1515 def _get(self, path):
-> 1516 with open(path, 'rb') as stream:
1517 return stream.read()
1518
FileNotFoundError: [Errno 2] No such file or directory: 'c:\users\harkirat\appdata\local\programs\python\python36\lib\site-packages\pyNASA\resources.json'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.