Developing apps in Eclipse
After you set up your development environment, you can import it into Eclipse to use the features in the Eclipse integrated development environment (IDE) to develop your app.
Prerequsites
Install PyDev Into Eclipse
Install PyDev into Eclipse for development.
- To install from the Eclipse Marketplace, click Help > Eclipse Marketplace on the main Eclipse Help panel.
- Paste the Pydev url (e.g., http://pydev.org/updates) into the ‘work with:’ field and press Enter.
- Select the Pydev checkbox in the table below and click Next
- Continue through wizard and accept the license agreement for Pydev.
Create a New Project
Create a new project to develop your app in.
- After you install PyDev, switch the perspective to PyDev.
- In the PyDev perspective, click File > New > PyDev project.
- In the PyDev Project window, type a project name.
- In the Grammar Version list, select 3.6.
- In the Interpreter list, select python3.
- Click Create links to existing sources, and click Next.
- Click Add external source folder, browse to the root directory of your development workspace, click OK, and then click Finish. The new Eclipse PyDev project that contains your development workspace appears in your Package Explorer.
Install QPyLib for development
Download and install the latest version of qpylib into your Python site-packages library.
- Check the latest tagged version of qpylib from this site: https://github.com/IBM/qpylib/tags (e.g., 2.0.1).
- Download the latest version of qpylib from the public github repo by running the following commands:
QPYLIB_VERSION=2.0.1
curl -s -OL \
https://github.com/IBM/qpylib/releases/download/${QPYLIB_VERSION}/qpylib-${QPYLIB_VERSION}.tar.gz
- Install the QPyLib package using pip:
QPYLIB_VERSION=2.0.1
python -m pip install qpylib-${QPYLIB_VERSION}.tar.gz
- If it is not already installed, install Flask into your local site-packages library by running the following command:
python -m pip install Flask
Add the external library to the Pydev project
- Right-click on the project in Eclipse and select Properties.
- Select PyDev - PYTHONPATH.
- Select External Libraries, then select Add source folder.
- Browse to the site packages folder from your local site-packages folder for Python. If you are unsure where this is, run the following command from a terminal window:
python -c 'import site; print(site.getsitepackages())'
- Click Apply, then click Close.