Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_projects is failing with "['project_code'] not in index" #16

Open
lisapro opened this issue Sep 3, 2024 · 9 comments
Open

get_projects is failing with "['project_code'] not in index" #16

lisapro opened this issue Sep 3, 2024 · 9 comments
Assignees

Comments

@lisapro
Copy link
Member

lisapro commented Sep 3, 2024

Importmal app is using Aquamonitor-Python for getting the data https://github.com/NIVANorge/importmal_app/tree/master
I use it though Jupyter Hub

Now it fails on get_projects function, I see that there were recent changes in it. Could you please take a look?

@roarbra
Copy link
Member

roarbra commented Sep 4, 2024

We have to update the images used by Jupyterhub, so that they references aquamonitor-python 0.3.3.
https://github.com/NIVANorge/niva_jupyter_hub/issues/30

@lisapro
Copy link
Member Author

lisapro commented Sep 4, 2024

I have temporarily downloaded older version on jupyter hub with !pip install --user --force-reinstall git+https://github.com/NIVANorge/Aquamonitor-Python.git@6cf4abf since the updated versions cause incompatibility. There are still some messages, but the functions seem to work, I will check more

@lisapro
Copy link
Member Author

lisapro commented Sep 4, 2024

no, I was wrong, it did not work, because the next commit (that has the error in the func) has the same version, I guess this is the resason why git still installs it. I can make a branch, downgrade libraries and install from the branch, is it ok for you?

@roarbra
Copy link
Member

roarbra commented Sep 4, 2024

I don't see why you should downgrade. The 0.3.3 version works.

@lisapro
Copy link
Member Author

lisapro commented Sep 4, 2024

becuase current versions of libraries joblib>=1.4
pandas>=2.2
requests>=2.32
yaspin>=3.0 cause incompatibilites in the Hub. And I need this to be up an runnning correctly by Friday morning. So the temporary solution is to downgrade those libraries to avoid incompatibilities.

@JamesSample
Copy link
Contributor

Is it necessary for AM-Python to have such strict dependencies, @roarbra ? E.g. here I see we now require requests>=2.32 and yaspin>=3.0. Does the library actually rely on new features introduced in those versions, or would it actually work OK with older versions (requests>=2.24 and yaspin>=2.5.0)?

Having strict dependency pinning is fine if necessary, but otherwise it makes dependency resolution on the Hub harder, as outlined here.

@lisapro On your Hub, try

pip install --user --no-deps git+https://github.com/NIVANorge/Aquamonitor-Python.git

I've just tested on my Hub and it successfully installs aquamonitor-0.3.3 and the example notebook still runs OK afterwards. Hopefully it'll work for you too as a temporary fix?

@lisapro
Copy link
Member Author

lisapro commented Sep 4, 2024

@JamesSample the --no-deps option fixed it, yes!

@roarbra
Copy link
Member

roarbra commented Sep 4, 2024

No, not at all. I'm just pushing these versions to be up to date, and avoid warnings about vulnerabilities.
I will stop doing that.

@JamesSample
Copy link
Contributor

I guess vulnerabilities are a good reason to keep updating the pinning. Maybe we can try to find a balance somewhere in the middle?

You can also keep doing exactly as you are, because

pip install --user --no-deps git+https://github.com/NIVANorge/Aquamonitor-Python.git

should work, unless one day AM-Python really does rely on new features only available in the updated requirements.txt. If this happens, the command above won't fix AM-Python, but it won't break the environment either. Then I just have to spend some time investigating dependencies (which I do anyway during the periodic updates).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants