def add_pip_package(self, requirement):
self._pip_packages.append(str(requirement))<EOL>pr = pkg_resources.Requirement.parse(requirement) <EOL>self.exclude_packages.add(pr.project_name)<EOL>
Add a Python package dependency for this topology.

If the package defined by the requirement specifier
is not pre-installed on the build system then the
package is installed using `pip` and becomes part
of the Streams application bundle (`sab` file).
The package is expected to be available from `pypi.org`.


If the package is already installed on the build system
then it is not added into the `sab` file.
The assumption is that the runtime hosts for a Streams
instance have the same Python packages installed as the
build machines. This is always true for IBM Cloud
Private for Data and the Streaming Analytics service on IBM Cloud.

The project name extracted from the requirement
specifier is added to :py:attr:`~exclude_packages`
to avoid the package being added by the dependency
resolver. Thus the package should be added before
it is used in any stream transformation.

When an application is run with trace level ``info``
the available Python packages on the running system
are listed to application trace. This includes
any packages added by this method.

Example::

    topo = Topology()
    # Add dependency on pint package
    # and astral at version 0.8.1
    topo.add_pip_package('pint')
    topo.add_pip_package('astral==0.8.1')

Args:
    requirement(str): Package requirements specifier.

.. warning::
    Only supported when using the build service with
    a Streams instance in IBM Cloud Private for Data
    or Streaming Analytics service on IBM Cloud.

.. note::
    Installing packages through `pip` is preferred to
    the automatic dependency checking performed on local
    modules. This is because `pip` will perform a full
    install of the package including any dependent packages
    and additional files, such as shared libraries, that
    might be missed by dependency discovery.

.. versionadded:: 1.9