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

Python packages might have the wrong version due not using pip #2389

Open
Flamefire opened this issue Apr 14, 2021 · 4 comments
Open

Python packages might have the wrong version due not using pip #2389

Flamefire opened this issue Apr 14, 2021 · 4 comments
Milestone

Comments

@Flamefire
Copy link
Contributor

In e.g. Python-3.7.4-GCCcore-8.3.0.eb we install pip without pip which leads to the installation of an egg-file/folder.

This doesn't play nice with pip in general. E.g. pip list lists pip as 19.2.3 (as it should be) but python -c 'import pip; print(pip.__version__) shows 19.0.3

This means that we don't get what we asked for.

In this case it is admittedly quite special because we install a base pip via ensurepip (a bundled pip in Python) and then again via setup.py but it shows that using setup.py is unreliable / doesn't work well together with pip

Hence we should strive VERY hard to avoid any use_pip: False or anything where use_pip: True is not set.

Additionally it might make sense to check for the case where python -c 'import <module>; print(<module>.__version__) prints something else than the expected version and add this as a sanity check.
Possible problems:

  • __version__ may not be defined --> I'd allow the command to fail
  • it may be faulty, i.e. claim a different version --> Bug in the package, should be fixed via patches
@boegel
Copy link
Member

boegel commented Apr 28, 2021

Wouldn't a better way of verifying which version is installed via pip list?

@Flamefire
Copy link
Contributor Author

pip list uses the packages meta-data to show versions and name. So the major problem here is that we don't know what the name of the package is. It might be the module name or something completely different (yes, there are examples of that)

And in this case this is actually the problem:

pip list lists pip as 19.2.3 (as it should be) but python -c 'import pip; print(pip.__version__) shows 19.0.3

I.e. pip finds meta data of 19.2.3 but the actually used package is version 19.0.3

@boegel
Copy link
Member

boegel commented Oct 27, 2023

@Flamefire I think we can consider this as fixed thanks to #2367 + #2377?

@Flamefire
Copy link
Contributor Author

Flamefire commented Oct 27, 2023

The issue here wasn't the 0.0 version but the difference shown via pip list vs python -c 'import foo; print(foo.__version__)

So rather easybuilders/easybuild-easyconfigs#12650 was a good step in fixing this and we should get #2127 done, at least for 5.0

@boegel boegel modified the milestones: next release (4.8.2), 4.x Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants