-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Importing DistributionNotFound in a python 3.9 script causes AttributeError #2548
Comments
I'm unable to elicit the behavior you describe with the repro. What other factors are present in your environment that might be contributing to the failure:
|
Ah! Apologies, it was my fault - I put a Cheers. |
@OJFord Hello, I face the same issue here, how do you fix it?
Thanks in advance! |
@yyunhh Thank for your contribution! Unfortunately, suggested by you approach didn't work for me. However, using the latest Python version, which was available to me (Python 3.8.10) solved this particular problem. |
This resolves remotestorage#1262. Per this comment pypa/setuptools#2548 (comment) and the Python docs https://docs.python.org/3/library/sys.html#sys.path, `sys.path` should only contain strings and not `Path` objects. Since we do not have dependencies frozen, a recent update to Sphinx broke the documentation build.
Environment
Description
from pkg_resources import DistributionNotFound
in a script causes andAttributeError
, but works fine in an interpreter, (I assume it just doesn't hit this code path where it tries to find the module name) in both cases using the same python v3.9.1.For context,
pikepdf
does this on import, so neither it nor anything which imports it (e.g.ocrmypdf
) can be imported in a script or module.Expected behavior
No error, imports.
How to Reproduce
Create a file:
and execute it.
Output
The text was updated successfully, but these errors were encountered: