Closed bakerde-2024 closed 8 months ago
try: sudo apt-get install python3-distutils
In a command prompt or Python? New to the TM1py app and python.
Enter this command in the command line (command prompt)
With that question, I'm gonna believe that you are using a Windows OS.
I think you are using a virtual environment which gets created while using an IDE to open the folder as a project. To avoid this, you can close the IDE and open the folder in it again. But, this time use the native python interpreter and not a virtual environment.
Yes, running on Windows OS. Downloaded and installed python from Microsoft store and ran the PIP to install TM1py. Opened a command prompt in the samples directory and ran python check.py. I will try reinstalling Python to see if it can fix the error.
Maybe late, but anyway:
There is a missing module: distutils Many examples rely on Python before V 3.10. With this version module distutils was depriated, but remained in installation libs. In version 3.12 module distutils was removed. Threfore this results in an error
In most cases you only need function strtobool. For this you have the alternative
pip install str2bool
Then replace distutils by strtobool and str2bool. Like this:
from str2bool import str2bool
from TM1py.Services import TM1Service
ssl = str2bool("F")
Describe what did you try to do with TM1py ran python check.py
Describe what's not working the way you expect Expected questions for TM1 server information and got the following error ModuleNotFoundError: No module named 'distutils'
Version
Additional context PS C:\TM1py\tm1py-master\TM1py\tm1py-samples-master> python check.py Traceback (most recent call last): File "C:\TM1py\tm1py-master\TM1py\tm1py-samples-master\check.py", line 6, in
from distutils.util import strtobool
ModuleNotFoundError: No module named 'distutils'
PS C:\TM1py\tm1py-master\TM1py\tm1py-samples-master>