Python installation#
Install the RTI Connext Python API with pip and run a Hello World program.
Choose the evaluator or customer instructions below.
Note that a full Connext installation is required to use add-on libraries, the code generator, infrastructure services, tools, and utilities.
1. Install the Python API#
Evaluating Connext#
Install the latest evaluation package from PyPI:
python -m pip install rti.connext
To install a specific version, use python -m pip install rti.connext==<version>,
where <version> is from Release history.
Already a customer#
Use the commercial Python package included in your Connext host installation. If the host package is not installed yet, download its installer for your platform from the RTI Customer Portal and run it.
Install the Python API from that installation:
python -m pip install rti.connext.activated -f "<Connext installation directory>/resource/python_api"
Replace <Connext installation directory> with the path to your commercial
host installation. Keep the quotes if the path contains spaces.
2. Set up your license#
Customers using rti.connext.activated can skip this step.
This package does not require a license file to run Python applications.
Evaluators using rti.connext need a license file.
Download a license activation file at evaluation.rti.com .
(Log in with your RTI account or create a new account, then open
your RTI license .)
You will download rti_license.dat.
(You don’t need to download any additional installer at this point to continue using the Python API.)
Copy rti_license.dat to the directory where you will run the example below,
or set the environment variable RTI_LICENSE_FILE to the full path of the
license file.
3. Run a Hello World program#
Run a simple Connext application to verify the installation in a directory of your choice.
Create a file named hello_publisher.py with the following content:
from time import sleep
import rti.connextdds as dds
from rti.types.builtin import String
participant = dds.DomainParticipant(0)
topic = dds.Topic(participant, "Hello", String)
writer = dds.DataWriter(topic)
for i in range(100):
writer.write(String(f"Hello World #{i}"))
sleep(1)
Create a file named hello_subscriber.py with the following content:
import rti.connextdds as dds
import rti.asyncio
from rti.types.builtin import String
async def main():
participant = dds.DomainParticipant(0)
topic = dds.Topic(participant, "Hello", String)
reader = dds.DataReader(topic)
async for data in reader.take_data_async():
print(data)
rti.asyncio.run(main())
In one terminal, run the subscriber:
$ python hello_subscriber.py
In another terminal, run the publisher:
$ python hello_publisher.py
You should see the following output in the subscriber terminal:
String(value='Hello World #0')
String(value='Hello World #1')
...
Congratulations! You have successfully installed the Connext Python API.
(If you have trouble, see troubleshooting information. Or ask the Connext Chatbot.)
Next steps#
Now you’re ready to build your own Connext distributed applications. You can complete many of the tutorials with just the Python API, but some require the full Connext installation.