0

I'm a total newbie when it comes to TM1 and Python and I'm getting the below error when trying to connect and extract a bit of data using the TM1py package. The Error:

Traceback (most recent call last):
  File "D:\TM3.py", line 4, in <module>
TM1Service(address="11.22.33.123", Servers="serverName", port=85, user='activeuser', password='correctpassword', ssl=True)
  File "D:\Program Files (x86)\Python39-32\lib\site-packages\TM1py\Services\TM1Service.py", line 15, in __init__
    self._tm1_rest = RestService(**kwargs)
  File "D:\Program Files (x86)\Python39-32\lib\site-packages\TM1py\Services\RestService.py", line 200, in __init__
    self._start_session(
  File "D:\Program Files (x86)\Python39-32\lib\site-packages\TM1py\Services\RestService.py", line 368, in _start_session
    self._version = response.text
AttributeError: 'NoneType' object has no attribute 'text'

The Code:

from TM1py.Services import TM1Service
from TM1py.Utils.Utils import build_pandas_dataframe_from_cellset

with TM1Service(address="11.22.33.123", Servers="serverName", port=85, user='activeuser', password='correctpassword', ssl=True) as tm1:
    data =tm1.cubes.cells.execute_view(cube_name="CubeName", view_name="ViewName", private=True)
    df=build_pandas_dataframe_from_cellset(data,multiindex=False)
    tm1.logout()
df.to_csv(r'D:\data.csv', index = False, header=True)

The exact same code works perfectly on a different VM and extracts the data. I've setup the new VM to mirror (same version of Python, all packages - pip list, identical proxy setup, Network access from the new VM to TM1 tested and works etc.).

Somehow on the newly setup VM I get this error when running the Py script in CMD/Task. I've searched everywhere and I can't find the cause or a fix. All help highly appreciated!

ViforSmph
  • 1
  • 1
  • Looks like when its making a call to the service, for what ever reason its not getting a response. Which leaves the `response` variable witha type of `None`. None is the python equivalent of null, it doesnt have a attribute called text. so when the code calls response.text it gets an error – Chris Doyle Nov 25 '21 at 17:31
  • Maybe check your connectivity or authentication etc. – Chris Doyle Nov 25 '21 at 17:32
  • Thank you Chris, I have tested connectivity and authentication - both are fine. It's very strange that the service is not properly responding. Haven't been able to find the reason yet, but still investigating. – ViforSmph Dec 03 '21 at 07:39

0 Answers0