PythonでNASA(アメリカ航空宇宙局) APIを利用できるライブラリ「nasapy」のインストールについて解説しています。
nasapyは、NASA Open APIs(https://api.nasa.gov/)をPythonでも利用できるようにしたライブラリ・モジュールです。
■Python
今回のPythonのバージョンは、「3.6.8」を使用しています。(Windows10)(pythonランチャーでの確認)
■nasapyをインストールする
nasapyをインストールを行いますが、今回はpipを経由してインストールを行うので、まずWindowsのコマンドプロンプトを起動します。
pip install nasapy
起動後、上記のコマンドを入力し、Enterキーを押します。
なお、今回は、pythonランチャーを使用しており、Python Version 3.6.8にインストールを行うために、pipを使う場合にはコマンドでの切り替えを行います。
py -3.6 -m pip install nasapy
切り替えるために、上記のコマンドを入力し、Enterキーを押します。
Collecting nasapy Using cached https://files.pythonhosted.org/packages/ba/9c/81958e204eb8e0e38828d7b9e75c64ebda349b90e66c7a4b4cfacd9b45ba/nasapy-0.2.7-py2.py3-none-any.whl Collecting requests>=2.18 (from nasapy) Using cached https://files.pythonhosted.org/packages/29/c1/24814557f1d22c56d50280771a17307e6bf87b70727d975fd6b2ce6b014a/requests-2.25.1-py2.py3-none-any.whl Collecting chardet<5,>=3.0.2 (from requests>=2.18->nasapy) Using cached https://files.pythonhosted.org/packages/19/c7/fa589626997dd07bd87d9269342ccb74b1720384a4d739a1872bd84fbe68/chardet-4.0.0-py2.py3-none-any.whl Collecting urllib3<1.27,>=1.21.1 (from requests>=2.18->nasapy) Using cached https://files.pythonhosted.org/packages/09/c6/d3e3abe5b4f4f16cf0dfc9240ab7ce10c2baa0e268989a4e3ec19e90c84e/urllib3-1.26.4-py2.py3-none-any.whl Collecting idna<3,>=2.5 (from requests>=2.18->nasapy) Using cached https://files.pythonhosted.org/packages/a2/38/928ddce2273eaa564f6f50de919327bf3a00f091b5baba8dfa9460f3a8a8/idna-2.10-py2.py3-none-any.whl Collecting certifi>=2017.4.17 (from requests>=2.18->nasapy) Using cached https://files.pythonhosted.org/packages/5e/a0/5f06e1e1d463903cf0c0eebeb751791119ed7a4b3737fdc9a77f1cdfb51f/certifi-2020.12.5-py2.py3-none-any.whl Installing collected packages: chardet, urllib3, idna, certifi, requests, nasapy Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. Successfully installed certifi-2020.12.5 chardet-4.0.0 idna-2.10 nasapy-0.2.7 requests-2.25.1 urllib3-1.26.4
Enterキーを押すと、インストールが開始され、上記のように「Successfully installed」と表示されます。これが表示されれば、nasapyが正常にインストールされたことになります。
Could not install packages due to an EnvironmentError: [WinError 5] アクセスが拒否されました。: 'C:\\Program Files\\Python36\\Lib\\site-packages\\idna' Consider using the `--user` option or check the permissions.
インストールした際に、上記のエラーが表示される場合は、下記のコマンドを入力し、Enterキーを押します。
pip install nasapyy --user
py -3.6 -m pip install nasapy --user
なお、「Requirement already satisfied」と表示される場合は、すでにインストールが完了しています。
コメント