The following is the code I use. I removed the values in the connection string, except the one for ssl.
A colleague gave it to me, and the code works for him.
from TM1py import TM1Service
with TM1Service(address="", port=, ssl=False, namespace="", gateway="") as tm1:
print('SW Version:\n')
print(tm1.server.get_product_version())
cube_names = tm1.cubes.get_all()
print('\nCube Names:\n')
for cube_name in cube_names:
print(cube_name)
When I ran the program above, it returned the TM1 version, but nothing was returned for the cube name. There was no error.
By the way, I just realized recently that the address in the connection string is for a Cognos server that I never use before.
When I access the Cognos server using a web browser, I saw some cubes.
Thank you