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

Package resolution fails if the package name contains a dot #6206

Open
oz123 opened this issue Jul 18, 2024 · 3 comments
Open

Package resolution fails if the package name contains a dot #6206

oz123 opened this issue Jul 18, 2024 · 3 comments
Assignees
Labels
Type: Documentation 📖 This issue relates to documentation of pipenv.

Comments

@oz123
Copy link
Contributor

oz123 commented Jul 18, 2024

Issue description

I am trying to install mach.py with pipenv but it fails:

Expected result

The package mach.py should not raise an exception.

Actual result

$pipenv install mach.py
Installing mach.py...
Resolving mach.py...
Added mach.py to Pipfile's [packages] ...
✔ Installation Succeeded
Pipfile.lock (eae6ec) out of date: run `pipfile lock` to update to (7a1a8e)...
Running $ pipenv lock then $ pipenv sync.
Locking [packages] dependencies...
Building requirements...
Resolving dependencies...
✘ Locking Failed!
⠧ Locking packages...False
ERROR:pip.subprocessor:python setup.py egg_info exited with 1
[ResolutionFailure]:   File "/usr/lib/python3.12/site-packages/pipenv/resolver.py", line 651, in _main
[ResolutionFailure]:       resolve_packages(
[ResolutionFailure]:   File "/usr/lib/python3.12/site-packages/pipenv/resolver.py", line 618, in resolve_packages
[ResolutionFailure]:       results, resolver = resolve(
[ResolutionFailure]:       ^^^^^^^^
[ResolutionFailure]:   File "/usr/lib/python3.12/site-packages/pipenv/resolver.py", line 598, in resolve
[ResolutionFailure]:       return resolve_deps(
[ResolutionFailure]:       ^^^^^^^^^^^^^
[ResolutionFailure]:   File "/usr/lib/python3.12/site-packages/pipenv/utils/resolver.py", line 932, in resolve_deps
[ResolutionFailure]:       results, hashes, internal_resolver = actually_resolve_deps(
[ResolutionFailure]:       ^^^^^^^^^^^^^^^^^^^^^^
[ResolutionFailure]:   File "/usr/lib/python3.12/site-packages/pipenv/utils/resolver.py", line 700, in actually_resolve_deps
[ResolutionFailure]:       resolver.resolve()
[ResolutionFailure]:   File "/usr/lib/python3.12/site-packages/pipenv/utils/resolver.py", line 457, in resolve
[ResolutionFailure]:       raise ResolutionFailure(message=str(e))
[pipenv.exceptions.ResolutionFailure]: Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
  You can use $ pipenv run pip install <requirement_name> to bypass this mechanism, then run $ pipenv graph to inspect the versions actually installed in the virtualenv.
  Hint: try $ pipenv lock --pre if it is a pre-release dependency.
ERROR: metadata generation failed

Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.12/pipenv", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/usr/lib/python3.12/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pipenv/cli/options.py", line 58, in main
    return super().main(*args, **kwargs, windows_expand_args=False)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/click/decorators.py", line 92, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pipenv/cli/command.py", line 209, in install
    do_install(
  File "/usr/lib/python3.12/site-packages/pipenv/routines/install.py", line 234, in do_install
    raise e
  File "/usr/lib/python3.12/site-packages/pipenv/routines/install.py", line 209, in do_install
    do_init(
  File "/usr/lib/python3.12/site-packages/pipenv/routines/install.py", line 635, in do_init
    do_update(
  File "/usr/lib/python3.12/site-packages/pipenv/routines/update.py", line 61, in do_update
    do_lock(
  File "/usr/lib/python3.12/site-packages/pipenv/routines/lock.py", line 66, in do_lock
    venv_resolve_deps(
  File "/usr/lib/python3.12/site-packages/pipenv/utils/resolver.py", line 873, in venv_resolve_deps
    c = resolve(cmd, st, project=project)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pipenv/utils/resolver.py", line 737, in resolve
    raise RuntimeError("Failed to lock Pipfile.lock!")
RuntimeError: Failed to lock Pipfile.lock!

$ pipenv --support

Pipenv version: '2024.0.1'

Pipenv location: '/usr/lib/python3.12/site-packages/pipenv'

Python location: '/usr/bin/python3.12'

OS Name: 'posix'

User pip version: '24.0'

user Python installations found:

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.12.3',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '6.9.2-gentoo-nvidia-bachefs-r3',
 'platform_system': 'Linux',
 'platform_version': '#1 SMP PREEMPT_DYNAMIC Thu May 30 21:03:18 CEST 2024',
 'python_full_version': '3.12.3',
 'python_version': '3.12',
 'sys_platform': 'linux'}

If you're on macOS, run the following:

$ pipenv --support | pbcopy

If you're on Windows, run the following:

> pipenv --support | clip

If you're on Linux, run the following:

$ pipenv --support | xclip
@oz123 oz123 self-assigned this Jul 21, 2024
@matteius
Copy link
Member

Works if you put quotes around package name.

matte@LAPTOP-N5VSGIBD MINGW64 ~/Projects/pipenv-triage/issue-6206
$ pipenv  install "mach.py"
Creating a virtualenv for this project
Pipfile: C:\Users\matte\Projects\pipenv-triage\issue-6206\Pipfile
Using default python from C:\Users\matte\AppData\Local\Programs\Python\Python311\python.exe3.11.2 to create virtualenv...
[=== ] Creating virtual environment...created virtual environment CPython3.11.2.final.0-64 in 4810ms
  creator CPython3Windows(dest=C:\c\users\matte\.virtualenvs\issue-6206-mx6QrnoR, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy,
app_data_dir=C:\Users\matte\AppData\Local\pypa\virtualenv)
                         pip[ ===]== Creating virtual environment...24.0, setuptools==70.0.0, wheel==0.43.0
  activators BashActivator,BatchActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator

Successfully created virtual environment!
Virtualenv location: C:\c\Users\matte\.virtualenvs\issue-6206-mx6QrnoR
Creating a Pipfile for this project...
Installing mach.py...
Resolving mach.py...
Added mach.py to Pipfile's [packages] ...
Installation Succeeded
Pipfile.lock not found, creating...
Locking [packages] dependencies...
Building requirements...
Resolving dependencies...
Success!
Locking [dev-packages] dependencies...
Updated Pipfile.lock (ab150dbf003deb8b02a8be19a9ee420c8bd61bb3bb168dea8f8c357d67528ea2)!
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.
Installing dependencies from Pipfile.lock (528ea2)...

matte@LAPTOP-N5VSGIBD MINGW64 ~/Projects/pipenv-triage/issue-6206
$ cat Pipfile
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
"mach.py" = "*"

[dev-packages]

[requires]
python_version = "3.11"

matte@LAPTOP-N5VSGIBD MINGW64 ~/Projects/pipenv-triage/issue-6206
$ cat Pipfile.lock
{
    "_meta": {
        "hash": {
            "sha256": "ab150dbf003deb8b02a8be19a9ee420c8bd61bb3bb168dea8f8c357d67528ea2"
        },
        "pipfile-spec": 6,
        "requires": {
            "python_version": "3.11"
        },
        "sources": [
            {
                "name": "pypi",
                "url": "https://pypi.org/simple",
                "verify_ssl": true
            }
        ]
    },
    "default": {
        "mach.py": {
            "hashes": [
                "sha256:a06b596331d5a9d23a9430dc52449b5699ed55559407e9467696bad492bf19f6"
            ],
            "version": "==0.4.4"
        }
    },
    "develop": {}
}

@oz123
Copy link
Contributor Author

oz123 commented Jul 27, 2024

Does fixing this really requires code intervention or just documentation?

@matteius
Copy link
Member

I am not sure we can fix it with code, because the shell command is what gets confused by the dot. Unless you know of a way ...

@matteius matteius added the Type: Documentation 📖 This issue relates to documentation of pipenv. label Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Documentation 📖 This issue relates to documentation of pipenv.
Projects
None yet
Development

No branches or pull requests

2 participants