Home Community Blog Buy Now

Misty Community Forum

Cannot get any programs to run using Python SDK. Always get the same error from __init__

Hi, I hope I can get some help on here. I downloaded the Python SDK using the instructions provided on github. Everytime I run an example program I get the following error:

…AppData/Local/Programs/Python/Python39/Lib\mistyPy_init_.py", line 93, in populateImages
for out in reply[‘result’]:
TypeError: string indices must be integers

I know that this is supposed to be accessing a dictionary, but for some reason it is thinking that I am referencing a string. I have not altered any of the code in any of the files I installed from the GitHub page, and have even tried deleting them and reinstalling. If anyone could send some insight my way that would be greatly appreciated!

are you still observing this?

@mplas , I initially struggled to properly set up Python SDK but was able to eventually get it to work. The examples on the github page and other things I have tried on my own now work for me.

So, I installed the Python SDK using pip command. I did not download anything from github explicitly. Below are the precise steps and my environment.

OS: Ubuntu 20.04 (I also tested on Windows 10 and it works there too)
Python: 3.8.10
IDE: Visual Studio Code

Once I had the virtual conda environment created. I installed Python 3.8.10 and then installed Python SDK using pip… The other dependencies such as requests, websockets were installed automatically when I did pip for the Misty-SDK.
pip install Misty-SDK

I tried to summarize the steps for my own sake and for future use when I was just getting started with Python SDK (and Misty II). Please feel free to check those out here.

The steps may not be very detailed since I was writing/summarizing for myself. If you need more details, please let me know. I can post them here. Thanks!