rticommunity / connextdds-py

Connext DDS Python API
Other
27 stars 12 forks source link

Failed to create DomainParticipant #41

Closed jmoore3024 closed 3 years ago

jmoore3024 commented 3 years ago

I've just installed everything fresh and have followed the directions at https://community.rti.com/static/documentation/connext-dds/current/api/connext_dds/api_python/building.html under Development Installation multiple times. Each time I try to run any examples I get the same error upon attempting to create a Domain Participant. I'll attach my simple example and error.

import rti.connextdds as dds
import time

participant = dds.DomainParticipant(0)
topic = dds.StringTopicType.Topic(participant, 'example')
writer = dds.StringTopicType.DataWriter(participant.implicit_publisher, topic)

while True:
    writer.write("Hello World!")
    time.sleep(1)
Traceback (most recent call last):

  File "C:\Users\username\AppData\Local\Temp/ipykernel_8564/1473888842.py", line 1, in <module>
    with dds.DomainParticipant(DOMAIN_ID) as participant:

Error: Failed to create DomainParticipant
marc-chiesa commented 3 years ago

Hi,

Could you verify the Python code that is running when the error occurs? The traceback doesn't seem to match the sample; the traceback shows a DomainParticipant being created in a with statement with a domain ID assigned to the variable DOMAIN_ID rather than one created in an assignment statement on domain 0.

Of course that doesn't necessarily relate to the problems you've been observing over the entire time, so can you also share the following information?

Thanks!

jmoore3024 commented 3 years ago

Thank you for the quick reply! My apologies, I pasted the wrong error code, but yes they are essentially the same.

Traceback (most recent call last):

  File "C:\Users\usernmae\AppData\Local\Temp/ipykernel_8564/1473888842.py", line 1, in <module>
    with dds.DomainParticipant(DOMAIN_ID) as participant:

Error: Failed to create DomainParticipant

RTI Connext DDS version: 6.1.0 Target Library: x64Win64VS2017 Python Version: 3.9.1 Windows Operating System

marc-chiesa commented 3 years ago

I installed Python 3.9.1 from python.org on Windows 10 and built connextdds-py with VS Express 2017.

I ran the following sequence of commands (note that the formal documentation on our community site has not been updated to reflect changes in versions since the latest release):

pip install wheel pip install setuptools pip install cmake pip install pybind11==2.7.1 python configure.py -j 8 --nddshome "C:\Program Files\rti_connext_dds-6.1.0" x64Win64VS2017 python setup.py bdist_wheel pip install .\dist\rti-0.1.0-cp39-cp39-win_amd64.whl

And everything worked as far as the Python tests are concerned. I just pushed an update to the release with only version changes, so if you pull the latest the last line would become after building:

pip install .\dist\rti-0.1.1-cp39-cp39-win_amd64.whl

but nothing in the actual implementation of the built package is changed.

Can you try with the sequence of commands above?

jmoore3024 commented 3 years ago

I ran all the commands and everything ran smoothly but I get the same error. I tried running the python script in a terminal instead of and IDE and the error had some more info.

RTI Connext DDS No source for License information
Please contact support@rti.com with any questions or comments.
Traceback (most recent call last):
  File "O:\dds_project\HelloWorld.py", line 11, in <module>
    participant = dds.DomainParticipant(0)
rti.connextdds.Error: Failed to create DomainParticipant

Prior to seeing this error, I had not configured the location of the license file in the RTI GUI so I thought I had found the source of my problems. But since seeing this, I set the license location and copied the license to the install directory, ran all the above commands again and still get the same error pasted in this comment.

marc-chiesa commented 3 years ago

Thanks for the update. I don't have a license managed install on Windows to test against at the moment, but could you try any of the solutions at the following link to see if it resolves the runtime issue you are seeing? Setting the license file in the GUI will fix any issues with running RTI tools and services from the launcher, but may not be sufficient for running your applications from the command line. If these options do not resolve the issue, I will perform some additional testing against a licensed managed install to see if I can reproduce and solve the problem.

Note that if you set an environment variable outside of the scope of the IDE/terminal, you will have to restart that application to get the new environment.

License Management

jmoore3024 commented 3 years ago

Yes! I was able to get it working by assigning the file location to the RTI_LICENSE_FILE environment variable. Thank you so much for your help!