Historically, we’ve used a combination of our own libraries (which we upload via jupyter notebook) and pip installed python packages to run protocols. This is so we could use things such as gspread pandas and numpy in opentrons protocols.
This works well and fine on opentrons version 6.2.1, but since we obtained a flex, we would love if all of our opentrons versions were the same (currently 8.3).
When running protocols via the app, the v8.3 opentrons does not seem to recognize any non-native python packages, even though we already installed them on the opentrons via SSH. (Please note: I am not talking about the pre-simulate on the computer connected (picture below of what I am not talking about)) This has always been a small issue that our users have just ignored, even on 6.2.1
When we try to run this protocol via the app, it gives the error “gspread-pandas not found” or whatever library we’re trying to use.
This is an issue because we have many protocols that currently work with this method on 6.2.1 and it would be wonderful to use the new parameters features that released with 8.0+ (and to use the same app we use for OT2s with the FLEX)
It feels like the pi on the opentrons is using a different environment of python than the base, and that it is not recognizing the packages that were installed via SSH. Does anyone else have a similar problem to this or has anyone found a solution?
I think Opentrons changed around 7.2(?). We have to run a certain version of numpy as our dependencies changed as we are now using Python 3.10.0
On 7.2.x you’d do the following (We did a big dependency update, so now Python is on 3.10.x)
if pip doesn’t work, trypip3
Pandas won’t necessarily work out of the box, you have to install a specific version compatible with numpy 1.22.3
You could probably do some hilarious hacking at runtime with your sys.path to make it work even when uploaded from the app if you’re interested in an adventure.
It turns out that dotenv wasn’t working the same way from opentrons version 6.2 and version 8.3. Also a lower version of gspread did it fine.
I did find I had to create a new python environment and change the .path in the app settings in order to get the “new” runtime parameters to work with external libraries
If anyone is reading this in the future and has a similar problem feel free to shoot me a message!