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

Can't find local .whl file on Debian #1130

Closed
1 task done
cye18 opened this issue Jun 10, 2022 · 4 comments · Fixed by #1096
Closed
1 task done

Can't find local .whl file on Debian #1130

cye18 opened this issue Jun 10, 2022 · 4 comments · Fixed by #1096
Labels
🐛 bug Something isn't working
Milestone

Comments

@cye18
Copy link
Contributor

cye18 commented Jun 10, 2022

  • I have searched the issue tracker and believe that this is not a duplicate.

Make sure you run commands with -v flag before pasting the output.

Steps to reproduce

  • In an empty directory on Debian OS
  • pdm init, pdm add local_file.whl
  • Create a new directory, copy pyproject.toml, pdm.lock, and local_file.whl to it
  • pdm sync in the new folder

Actual behavior

The same thing works well on Ubuntu, but not for Debian

$ pdm sync -v
Traceback (most recent call last):
  File "/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/__init__.py", line 3101, in __init__
  File "/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/_vendor/packaging/requirements.py", line 101, in __init__
pkg_resources.extern.packaging.requirements.InvalidRequirement: Invalid URL given

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/username/.local/lib/python3.9/site-packages/pdm/models/requirements.py", line 489, in parse_requirement
    package_req = PackageRequirement(line)  # type: ignore
  File "/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/__init__.py", line 3103, in __init__
pkg_resources.RequirementParseError: Invalid URL given

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/username/.local/bin/pdm", line 8, in <module>
    sys.exit(main())
  File "/home/username/.local/lib/python3.9/site-packages/pdm/core.py", line 232, in main
    return Core().main(args)
  File "/home/username/.local/lib/python3.9/site-packages/pdm/core.py", line 167, in main
    raise cast(Exception, err).with_traceback(traceback)
  File "/home/username/.local/lib/python3.9/site-packages/pdm/core.py", line 162, in main
    f(options.project, options)
  File "/home/username/.local/lib/python3.9/site-packages/pdm/cli/commands/sync.py", line 33, in handle
    actions.do_sync(
  File "/home/username/.local/lib/python3.9/site-packages/pdm/cli/actions.py", line 192, in do_sync
    requirements.extend(project.get_dependencies(group).values())
  File "/home/username/.local/lib/python3.9/site-packages/pdm/project/core.py", line 293, in get_dependencies
    req = parse_requirement(line)
  File "/home/username/.local/lib/python3.9/site-packages/pdm/models/requirements.py", line 494, in parse_requirement
    r = FileRequirement.create(**m.groupdict())
  File "/home/username/.local/lib/python3.9/site-packages/pdm/models/requirements.py", line 294, in create
    return super().create(**kwargs)  # type: ignore
  File "/home/username/.local/lib/python3.9/site-packages/pdm/models/requirements.py", line 160, in create
    return cls(**kwargs)
  File "<string>", line 12, in __init__
  File "/home/username/.local/lib/python3.9/site-packages/pdm/models/requirements.py", line 280, in __post_init__
    raise RequirementError(f"The local path {self.path} does not exist.")
pdm.exceptions.RequirementError: The local path local_file does not exist.

Expected behavior

Find the local file and install it.

Environment Information

$ pdm info && pdm info --env
PDM version:        1.15.2
Python Interpreter: /usr/bin/python3.9 (3.9)
Project Root:       /home/username/project
Project Packages:   /home/username/project/__pypackages__/3.9
{
  "implementation_name": "cpython",
  "implementation_version": "3.9.2",
  "os_name": "posix",
  "platform_machine": "x86_64",
  "platform_release": "5.10.0-14-cloud-amd64",
  "platform_system": "Linux",
  "platform_version": "#1 SMP Debian 5.10.113-1 (2022-04-29)",
  "python_full_version": "3.9.2",
  "platform_python_implementation": "CPython",
  "python_version": "3.9",
  "sys_platform": "linux"
}
@cye18 cye18 added the 🐛 bug Something isn't working label Jun 10, 2022
@frostming
Copy link
Collaborator

On debian, the sys.path is polluted by those wheel paths due to pip. Would you please try the dev branch which has some refactor to address that?

@cye18
Copy link
Contributor Author

cye18 commented Jun 10, 2022

It's tested that PDM 1.15.2.dev10+g1c376a8c fixed the issue on Debian.

Thanks a lot.

@frostming
Copy link
Collaborator

It's tested that PDM 1.15.2.dev10+g1c376a8c fixed the issue on Debian.

Thanks a lot.

Yeah, we are not going to fix it on 1.x. Please wait for the 2.0 release, you can get the progress here

@frostming frostming added this to the Release 2.0 milestone Jun 11, 2022
@frostming frostming linked a pull request Jun 17, 2022 that will close this issue
2 tasks
@frostming
Copy link
Collaborator

Closed by #1096, please test it on 2.0.0a1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants