Running Tessitura REST API with a python exe

This isn't necessarily a Tessitura issue, but the issue is popping up whenever I try to use the Tessitura API. I've been using Python to access the REST API and it seems to be working great. Anytime I run a POST or GET request from the PyCharm IDE everything works fine. 

Now I am trying to compile my script into an executable file using pyinstaller. I ran into some issues with it missing the modules but now I've gotten so far as it to run the script, but once it hits the Tessitura module and tries to run the _init_.py file it says its missing the pkg_resources module. I looked through the Tessitura _init_.py file and the first thing it tries to do is import the pkg_resources module. The pkg_resources module is found in the site-packages folder in the venv directory right along side the Tessitura module. So I don't know why when I run the script through PyCharm it knows where to find the module but when it runs as an exe it can't find it. Do I need to make a copy of the pkg_resources folder and move it into the Tessitura folder?

Parents
  • ,

    I was interested to see your post.  Are you using pip install tessitura to get the tessitura library?  Or have you created a Tessitura library of your own?

    If you are using the pip install tessitura method, as far as I know, you will be the first person to use the library in the context of compiled (.exe) python application.  I'd love to learn some more about what you are doing and am glad to see what I can do to help.

    --Tom

  • Tom,

    You were the one who actually provided me the info on the Tessitura Python library. I think back in 2020 you sent me a github link that I think said to use pip to install it.

    The nature of this project is pretty simple, we want to perform a data dump from Grouper into our Tessitura database. I've built all the local resources: tables procedures and what not. The python script calls the Grouper API and then I loop through the data and pull out the data points that are then inserted into our Tessitura table using the execute custom procedure method. I don't get any "missing modules" errors when I run it through the pycharm console.

    When using pyinstaller, it was initially not recognizing the requests and tessitura modules when I created the exe. I found that I needed to run a --path argument on the pyinstaller to specify the file path for all the project site-packages. So I'm wondering if the same thing needs to be done for the Tessitura module, but I can't seem to figure out how to get that done.

Reply
  • Tom,

    You were the one who actually provided me the info on the Tessitura Python library. I think back in 2020 you sent me a github link that I think said to use pip to install it.

    The nature of this project is pretty simple, we want to perform a data dump from Grouper into our Tessitura database. I've built all the local resources: tables procedures and what not. The python script calls the Grouper API and then I loop through the data and pull out the data points that are then inserted into our Tessitura table using the execute custom procedure method. I don't get any "missing modules" errors when I run it through the pycharm console.

    When using pyinstaller, it was initially not recognizing the requests and tessitura modules when I created the exe. I found that I needed to run a --path argument on the pyinstaller to specify the file path for all the project site-packages. So I'm wondering if the same thing needs to be done for the Tessitura module, but I can't seem to figure out how to get that done.

Children