You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This will fail because ModuleNotFoundError: No module named 'animals.dog'
If I now uninstall animals.cat: pip uninstall animals.cat and then repeat steps 5. and 6. they will succeed, I'm guessing because something has been leftover from the uninstall?
Output
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import File "<frozen importlib._bootstrap>", line 1007, in _find_and_load File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked ModuleNotFoundError: No module named 'animals.dog' ----------------------------------------
Code of Conduct
I agree to follow the PSF Code of Conduct
The text was updated successfully, but these errors were encountered:
Is there a reason you're using pkg_resources-style namespace packages? I would not recommend using those except for legacy namespaces, and even for those, I'd recommend to migrate to pkgutil-style (for Python 3.2 or earlier) or PEP 420 native namespace packages.
I suspect the issue is that the attr functionality is relying on simple package resolution and hasn't bootstrapped the namespace packages support. I suspect it will be difficult to correct the issue and for little value with a deprecated feature.
I'd recommend to simply avoid using attr until you're able to migrate away from pkg_resources-style namespace packages.
I welcome you to investigate further to trace the root cause and I'd welcome a patch if it doesn't add too much complication to the implementation.
setuptools version
setuptools == 58.5.3
Python version
Python 3.9
OS
macOS
Additional environment information
No response
Description
When I try to
pip install <namespace-package>
usingattr
to determine the value of version I get a failure message.Expected behavior
The
pip install <namespace-package>
command works successfully.How to Reproduce
I have created an example to show this behaviour:
python -m venv issue
source issue/bin/activate
cd setuptools-issue
animals.cat
package:pip install animals.cat/
animals.dog
package:pip install animals.dog/
This will fail because
ModuleNotFoundError: No module named 'animals.dog'
If I now uninstall
animals.cat
:pip uninstall animals.cat
and then repeat steps 5. and 6. they will succeed, I'm guessing because something has been leftover from the uninstall?Output
Code of Conduct
The text was updated successfully, but these errors were encountered: