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

FileNotFoundError: [Errno 2] No such file or directory: '/home/user/.local/lib/python3.11/site-packages' #101

Open
milahu opened this issue Apr 16, 2024 · 1 comment
Labels

Comments

@milahu
Copy link

milahu commented Apr 16, 2024

for sitepackages in site.getsitepackages() + [site.getusersitepackages()]:
if dist_name.lower() not in [item.lower() for item in os.listdir(sitepackages)]:

fix:

            if not os.path.exists(sitepackages):
                continue

edit: no, that only hides the issue, when zugbruecke is not installed to
/home/user/.local/lib/python3.11/site-packages

ValueError: ('dist-info for package could not be found', 'zugbruecke')

instead, zugbruecke should use
__file__ to find zugbruecke-0.2.1.dist-info
wenv.__file__ to find wenv-0.5.1.dist-info
etc

    def _setup_package(self, name: str, version: str):
        # ...
        if name == "zugbruecke":
            unix_dist_path = os.path.realpath(os.path.dirname(__file__) + "../../../" + dist_name)
        elif name == "wenv":
            import wenv
            unix_dist_path = os.path.realpath(os.path.dirname(wenv.__file__) + "/../" + dist_name)
        else:
            raise Exception(f"FIXME find dist path of package {name}")
@s-m-e s-m-e added the bug label Apr 16, 2024
@s-m-e
Copy link
Member

s-m-e commented Apr 16, 2024

A variation of this bug blobbed up before a few years ago - though I found it hard to add a proper test for it. PR highly welcome.

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

No branches or pull requests

2 participants