1

I am slightly new to ubuntu,

I have a NASA-ADS dev_key to access some data on there system but am unable to:

  1. save it as an environment variable named ADS_DEV_KEY or
  2. save it to a file called ~/.ads/dev_key

after following the instructions in link https://pypi.python.org/pypi/ads/0.0.809

For the first option: I don't know any thing about how to save an environment variable naming ADS_DEV_KEY

For 2nd option I am unable to locate any directory naming .ads where I should save the text file for available key.

Note:

When I import installed ads library to python it gives me this error:

    Traceback (most recent call last):
    File "<pyshell#0>", line 1, in <module>
import ads
    File "/home/sibte/.local/lib/python2.7/site-packages/ads/__init__.py", line 9, in <module>
import network
    File "/home/sibte/.local/lib/python2.7/site-packages/ads/network.py", line 15, in <module>
from core import search
    File "/home/sibte/.local/lib/python2.7/site-packages/ads/core.py", line 19, in <module>
DEV_KEY = utils.get_dev_key()
    File "/home/sibte/.local/lib/python2.7/site-packages/ads/utils.py", line 31, in get_dev_key
raise IOError("no ADS API key found in ~/.ads/dev_key and no ADS_DEV_KEY "\
    IOError: no ADS API key found in ~/.ads/dev_key and no ADS_DEV_KEY environment variable found

Any help (preferably simple) regarding this issue?

1 Answer 1

0

You can create an ~/.ads directory. Assuming the API key is 123, open a terminal window with Ctrl+Alt+T and run these commands:

mkdir ~/.ads
echo '123' > ~/.ads/dev_key

If you want to set an environment variable instead, you can study this tutorial.

2
  • I used both the tricks but still the same error occured, I create .ads folder in the directory which python mentioned in error i.e; home/sibte/.local/lib/python2.7/site-packages/ads saved the dev_key in the file naming dev_key
    – Sibte Raza
    Sep 7, 2014 at 3:20
  • @user3269913: No, the directory should be /home/sibte/.ads Sep 7, 2014 at 6:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .