'NoneType' object has no attribute 'text' Error in connection to TM1 via Python

206 Views Asked by At

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!

0

There are 0 best solutions below