Can we expect conda or pip install for pyGPlates?

I made a tutorial for my colleagues so they can learn and start scripting in pyGPlates. As most of them did not use Python before they could make a clean install of Python with Conda :ok_hand:. They made an environment which only includes Jupyter notebooks, got the right version of pyGPlates for their Windows or Mac.

I prepared a notebook which imports pyGPlates using the method which was previously on the website and worked best for me previously*.:
import sys
sys.path.append('/path/to/pygplates')
import pygplates

It worked for all, except for one Windows computer (with no previous Conda and Python install). We did not get it to return an error, but it starts running the cell and does not finish.

So we tried putting the notebook in the folder with pyGPlates. That got us a modulenotfounderror.

We also added to the path in the command prompt, but with no success.

Sorry for the long introduction, but my question: Can we expect a conda or pip install for pyGPlates in the near future, or is that too complicated on the development side? Or would you have any other suggestion for solving this issue?

*: Interested to know why append was replaced by insert

Hi Thomas,

Yes, the plan is to produce a pip package (wheels for Windows/Mac/Linux). We aim to have that for the pyGPlates 1.0 release (sometime next year). Then a conda package should follow on from that.

If I understand correctly it sounds pygplates was successfully imported but the notebook cell did not finish, and then when you moved the notebook to same directory as pygplates it then couldn’t find pygplates (which is odd). Maybe, in the first case where it seem to find pygplates, put a print statement after import pygplates just to make sure it’s actually importing pygplates (if successful then you’ll see the print output) - you just want to find out where it’s hanging in the cell (it could be hanging inside of import pygplates). That’ll tell you if the problem is finding pygplates or importing/running it.

Since Python searches in the order of the sys.path list, if you use append (ie, add your path to pyGPlates to the end of that list) and you have an older version of pyGPlates earlier in sys.path then that older version will get found first. For example, you might have the older version specified in the PYTHONPATH environment variable (note that sys.path gets initialized with the script directory, at sys.path[0], followed by the contents of PYTHONPATH - see here - whatever you append gets added after all that). In that case you can instead use sys.path.insert(1, '/path/to/pygplates') which inserts after the script directory but before the PYTHONPATH entries.

Regards,
John

Great news to hear that there will be packages soon!

My colleague solved the issue by changing to her own back up laptop. Not sure what the university admins do to our Windows computers.