Skip to content

Conversation

@eddtries
Copy link

@eddtries eddtries commented Nov 1, 2023

I've submitted a patch to quickly fix the LooseVersion issues stopping undetected-chromedriver working with >= Python 3.12.0 since distutils was deprecated. It uses a third party library without many stars, so there's a risk there, and if someone wants to fix it properly by replacing LooseVersion with a custom type that'd be awesome - this is just a quick fix to get things working if needed.

@max32002
Copy link

max32002 commented Nov 2, 2023

ModuleNotFoundError: No module named 'looseversion', if python < 3.12.0

@eddtries
Copy link
Author

eddtries commented Nov 2, 2023

ModuleNotFoundError: No module named 'looseversion', if python < 3.12.0

Did you pip install -r requirements.txt first? If so, what was the output?

If this doesn't work then we'd need to follow the Python 3.12.0 migration guide which is a little more work :(

@max32002
Copy link

max32002 commented Nov 2, 2023

ModuleNotFoundError: No module named 'looseversion', if python < 3.12.0

Did you pip install -r requirements.txt first? If so, what was the output?

If this doesn't work then we'd need to follow the Python 3.12.0 migration guide which is a little more work :(

after
python -m pip install looseversion

done, thank you very much.

@boludoz
Copy link

boludoz commented Nov 9, 2023

try:
    from distutils.version import LooseVersion
except ModuleNotFoundError:
    from packaging.version import parse as LooseVersion

@belthaZornv
Copy link

Any news on merging this? or? - seems to still be an issue with 3.12.

@Lordfirespeed
Copy link

Recommend using packaging.version.Version instead, since that's part of the stdlib

@Himan10
Copy link

Himan10 commented Sep 29, 2025

Recommend using packaging.version.Version instead, since that's part of the stdlib

@Lordfirespeed, I was using the same that you recommended but lately I've been experiencing issues with some Maven/Gradle versions such as 4.1.108.Final as I believe it doesn't follow the PEP 440 guidelines. Do you have any recommendations on what else to use to parse such version. My usecase includes comparing two versions.

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

Successfully merging this pull request may close these issues.

6 participants