Dependencies
Dependencies are external packages or modules that a project requires to function properly. These are not included with the standard Launchpad libraries, so they need to be installed and managed separately.
INFO
Within Launchpad Dependencies is specially built feature for Python only. No other languages are supported as they have their own library management system.
Role of Dependencies
A dependency is essentially a piece of software that your project needs to access certain functionality. For example, if your Python project involves data analysis, you might depend on libraries like numpy
or pandas
for numerical computations and data manipulation, respectively. These libraries are developed and maintained by third parties and are not part of the core Python language.
Dependencies in Launchpad
Launchpad provides a convenient way to add libraries to your project without much fuss.
- Right-click on dependencies and select "Add Library".
- Search for the library in the search field.
- Select version of the library (if applicable). Selecting "Use Latest" will use the latest version available.
- Click "Add to Program" to add the library to your project .
- Ensure the library is imported in your code. See example below.
# Import the datetime library
import datetime
- Build and deploy your program.
INFO
The deployment pipeline will automatically package and install the library on the device. The library will be installed in a virtual environment and therefore will not interfere with other packages installed on the device.
DANGER
Launchpad Python repository synchronizes every 24 hours. Therefore, libraries that were added to the Python global repository will not appear until 24 hours after they were added. There is no other way to import a library at this stage other than the Dependency method that uses the Launchpad Python Repository.
Best Practices
- Regularly update dependencies to benefit from security patches, bug fixes, and new features.
- Test your project thoroughly when updating dependencies to ensure there are no compatibility issues.