Skip to content

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

@milahu

Description

@milahu

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}")

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions