PyODK : how to upgrade : 'Client' object has no attribute 'entities'

Working on our pl-pyodk function I face a problem.

I get this error when I try to create an entity :

'Client' object has no attribute 'entities'
It makes me think that I don't get a fresh version of pyODK when I run pip install pyodk

I don't know how to check the version I get and how to upgrade if necessary.

It seems to be a "simple" python version issue... I'll tell you.

Hi Mathieu!

python3 --version

Shows the python version in your system.

It has to be greater than 3.12 to use the latest pyodk 1.1.0 version, that supports entities.

If you're using python 3.10 version on your system, the latest pyodk version that it allows is 0.3.0 which doesn't support entities.

pip list

shows everything that is installed in your environment and their correspondent versions

s,

1 Like

Thanks a lot Robson !

That's what I understood from the repo README

The currently supported Python versions for pyodk are 3.10 to 3.13 (the primary development version is 3.12). If this is different from the version you use for other projects, consider using pyenv to manage multiple versions of Python.

One last step, not relative to python and I should be odk to move forward on pl-pyodk with entities :slight_smile:

1 Like

:face_with_peeking_eye: Sorry about this!

We recently relaxed the Python version requirement at @spwoodcock's suggestion and updated the readme to match what was merged but we hadn't released yet.

I just released v1.2.0 which includes support down to Python 3.10. It also now supports sending submission attachments when creating a new submission: docs.

Hopefully this gets things running smoothly for you!

3 Likes

Hi @LN,

I've upgraded my pyodk 0.3.0 to 1.2.0 on a virtualenv that had urllib3 1.26.20 installed and the client.open() statement crashed in my notebooks.

It didn't automatically upgrade urllib3 together with pyodk.

I'm not sure how dependencies are set but when I upgraded urllib3 to it's latest version (2.3.0 in my virtualenv) everything started working nicely again.

Was it my bad during the upgrade process? How should we upgrade pyodk from old versions to ensure that doesn't happen?

I'm a bit newbie to all this python packages versioning stuff and it's always a great discovery when things get back on track.

Cheers,