Requirements: You need to have completed the Anaconda installation tutorial.
By the end of this lesson, you will be abel to:
- import the Watson package into Python
Description of this lesson:
- Type: step-by-step tutorial
- Estimated time for completion: 20 mins.
In order to access and use functionalities of the Bluemix platform in your own python code, you need to install a python module.
This module, called watson-developer-cloud, has been developed by IBM for python developers. It is an API to the Bluemix platform.
"In computer programming, an application programming interface (API) is a set of subroutine definitions, protocols, and tools for building application software. In general terms, it is a set of clearly defined methods of communication between various software components." Wikipedia
- Open a terminal, get into the
cbcenvironment by typing:
source activate cbcNote: if you work in Windows just type activate cbc (discard source) in the Anaconda Prompt or launch Anaconda Prompt (cbc) from the menu..
- Install the python module called
watson_developer_cloudby typing:
pip install --upgrade watson-developer-cloudIt should display some installation messages (see screencast below).
-
Also, we will use the module
python-dotenvto manage credentials to the Watson API. Type:pip install --upgrade python-dotenv
-
Finally, we will ue the module
pytestto run test cases on your code before submitting it. Type:pip install --upgrade pytest
You can test your installation by running ipython. In your terminal type:
ipythonand then, within ipython, type:
import watson_developer_cloudIf you have no error message, you're done !
