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

Better error message when a package is not found #6326

Open
mokazemi opened this issue Dec 14, 2024 · 1 comment · May be fixed by #6335
Open

Better error message when a package is not found #6326

mokazemi opened this issue Dec 14, 2024 · 1 comment · May be fixed by #6335
Assignees

Comments

@mokazemi
Copy link

Is your feature request related to a problem? Please describe.

When you try to install a package that is not available (in the pypi or locally), pipenv gives a ambiguous error.
For example, here the real name of the package is python-dotenv but I accidentally tried to install it with pipenv install dotenv:

$ pipenv install dotenv
Loading .env environment variables...
Installing dotenv...
✔ Installation Succeeded
Installing dependencies from Pipfile.lock (ea4037)...
All dependencies are now up-to-date!
Upgrading dotenv in  dependencies.
Building requirements...
Resolving dependencies...
✘ Locking Failed!
⠦ Locking packages...False
<console width=182 ColorSystem.TRUECOLOR>
Traceback (most recent call last):
  File "/usr/bin/pipenv", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/usr/lib/python3.12/site-packages/pipenv/vendor/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pipenv/cli/options.py", line 52, in main
    return super().main(*args, **kwargs, windows_expand_args=False)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pipenv/vendor/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pipenv/vendor/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pipenv/vendor/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pipenv/vendor/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pipenv/vendor/click/decorators.py", line 92, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pipenv/vendor/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pipenv/cli/command.py", line 207, in install
    do_install(
  File "/usr/lib/python3.12/site-packages/pipenv/routines/install.py", line 310, in do_install
    new_packages, _ = handle_new_packages(
                      ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pipenv/routines/install.py", line 114, in handle_new_packages
    do_update(
  File "/usr/lib/python3.12/site-packages/pipenv/routines/update.py", line 75, in do_update
    upgrade(
  File "/usr/lib/python3.12/site-packages/pipenv/routines/update.py", line 364, in upgrade
    upgrade_lock_data = venv_resolve_deps(
                        ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pipenv/utils/resolver.py", line 907, in venv_resolve_deps
    c = resolve(cmd, st, project=project)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pipenv/utils/resolver.py", line 771, in resolve
    raise RuntimeError("Failed to lock Pipfile.lock!")
RuntimeError: Failed to lock Pipfile.lock!

Describe the solution you'd like

It should clearly gives error that "Didn't find the package".

Additional context


$ pipenv --support

Pipenv version: '2024.4.0'

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

Python location: '/usr/bin/python'

OS Name: 'posix'

User pip version: '24.3.1'

user Python installations found:

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.12.7',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '6.12.4-arch1-1',
 'platform_system': 'Linux',
 'platform_version': '#1 SMP PREEMPT_DYNAMIC Mon, 09 Dec 2024 14:31:57 +0000',
 'python_full_version': '3.12.7',
 'python_version': '3.12',
 'sys_platform': 'linux'}

System environment variables:

  • SHELL
  • SESSION_MANAGER
  • COLORTERM
  • XDG_CONFIG_DIRS
  • FUNCNEST
  • POSTGRES_HOST
  • XDG_SESSION_PATH
  • XDG_MENU_PREFIX
  • TERM_PROGRAM_VERSION
  • PIPENV_ACTIVE
  • ICEAUTHORITY
  • POSTGRES_PASSWORD
  • LC_ADDRESS
  • LC_NAME
  • DEV_MODE
  • MEMORY_PRESSURE_WRITE
  • DESKTOP_SESSION
  • LC_MONETARY
  • GTK_RC_FILES
  • NO_AT_BRIDGE
  • EDITOR
  • XDG_SEAT
  • PWD
  • LOGNAME
  • XDG_SESSION_DESKTOP
  • XDG_SESSION_TYPE
  • SYSTEMD_EXEC_PID
  • XAUTHORITY
  • VSCODE_GIT_ASKPASS_NODE
  • MOTD_SHOWN
  • GTK2_RC_FILES
  • PIP_PYTHON_PATH
  • HOME
  • LANG
  • LC_PAPER
  • XDG_CURRENT_DESKTOP
  • VIRTUAL_ENV
  • MEMORY_PRESSURE_WATCH
  • WAYLAND_DISPLAY
  • SECRET_KEY
  • GIT_ASKPASS
  • XDG_SEAT_PATH
  • INVOCATION_ID
  • DJANGO_ALLOWED_HOSTS
  • MANAGERPID
  • CHROME_DESKTOP
  • KDE_SESSION_UID
  • QV4_GC_TIMELIMIT
  • VSCODE_GIT_ASKPASS_EXTRA_ARGS
  • XKB_DEFAULT_LAYOUT
  • USE_POSTGRES
  • XDG_SESSION_CLASS
  • LC_IDENTIFICATION
  • TERM
  • USER
  • PIP_DISABLE_PIP_VERSION_CHECK
  • VSCODE_GIT_IPC_HANDLE
  • POSTGRES_PORT
  • QT_WAYLAND_RECONNECT
  • KDE_SESSION_VERSION
  • PAM_KWALLET5_LOGIN
  • DISPLAY
  • SHLVL
  • POSTGRES_USER
  • MOZ_ENABLE_WAYLAND
  • LC_TELEPHONE
  • LC_MEASUREMENT
  • XDG_VTNR
  • XDG_SESSION_ID
  • VIRTUAL_ENV_PROMPT
  • PYTHONDONTWRITEBYTECODE
  • XDG_RUNTIME_DIR
  • PS1
  • DEBUGINFOD_URLS
  • LC_TIME
  • VSCODE_GIT_ASKPASS_MAIN
  • QT_AUTO_SCREEN_SCALE_FACTOR
  • JOURNAL_STREAM
  • XDG_DATA_DIRS
  • KDE_FULL_SESSION
  • GDK_BACKEND
  • BROWSER
  • PATH
  • ORIGINAL_XDG_CURRENT_DESKTOP
  • DBUS_SESSION_BUS_ADDRESS
  • KDE_APPLICATIONS_AS_SCOPE
  • MAIL
  • POSTGRES_DB
  • LC_NUMERIC
  • TERM_PROGRAM
  • _
  • PYTHONFINDER_IGNORE_UNSUPPORTED

Pipenv–specific environment variables:

  • PIPENV_ACTIVE: 1

Debug–specific environment variables:

  • PATH: /home/mohammad/.local/share/virtualenvs/Beenaab_project-J2PSbtNd/bin:/home/mohammad/.cargo/bin:/home/mohammad/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/var/lib/flatpak/exports/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
  • SHELL: /bin/bash
  • EDITOR: nano
  • LANG: en_US.UTF-8
  • PWD: /home/mohammad/Documents/Work/Beenaab/Beenaab_project
  • VIRTUAL_ENV: /home/mohammad/.local/share/virtualenvs/Beenaab_project-J2PSbtNd

Contents of Pipfile ('/home/mohammad/Documents/Work/Beenaab/Beenaab_project/Pipfile'):

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
django = "*"
django-ajax-datatable = "*"
django-extensions = "*"
django-filter = "*"
django-jalali-date = "*"
django-widget-tweaks = "*"
utm = "*"
pysocks = "*"
whitenoise = "*"
psycopg = "*"
dj-database-url = "*"
python-dotenv = "*"

[dev-packages]

[requires]
python_version = "3.12"

Contents of Pipfile.lock ('/home/mohammad/Documents/Work/Beenaab/Beenaab_project/Pipfile.lock'):

{
    "_meta": {
        "hash": {
            "sha256": "b7b1049d17fa82cf16344a1c5766f56454a437dd9ce2e3f62695ee6275ea4037"
        },
        "pipfile-spec": 6,
        "requires": {
            "python_version": "3.12"
        },
        "sources": [
            {
                "name": "pypi",
                "url": "https://pypi.org/simple",
                "verify_ssl": true
            }
        ]
    },
    "default": {
        "asgiref": {
            "hashes": [
                "sha256:3e1e3ecc849832fe52ccf2cb6686b7a55f82bb1d6aee72a58826471390335e47",
                "sha256:c343bd80a0bec947a9860adb4c432ffa7db769836c64238fc34bdc3fec84d590"
            ],
            "markers": "python_version >= '3.8'",
            "version": "==3.8.1"
        },
        "dj-database-url": {
            "hashes": [
                "sha256:ae52e8e634186b57e5a45e445da5dc407a819c2ceed8a53d1fac004cc5288787",
                "sha256:bb0d414ba0ac5cd62773ec7f86f8cc378a9dbb00a80884c2fc08cc570452521e"
            ],
            "index": "pypi",
            "version": "==2.3.0"
        },
        "django": {
            "hashes": [
                "sha256:236e023f021f5ce7dee5779de7b286565fdea5f4ab86bae5338e3f7b69896cf0",
                "sha256:de450c09e91879fa5a307f696e57c851955c910a438a35e6b4c895e86bedc82a"
            ],
            "index": "pypi",
            "markers": "python_version >= '3.10'",
            "version": "==5.1.4"
        },
        "django-ajax-datatable": {
            "hashes": [
                "sha256:99233042e6c7d03ed730ea13b4dba1c3e8a66dd1f57022a07b29acb8812ad6f1"
            ],
            "index": "pypi",
            "version": "==4.5.0"
        },
        "django-extensions": {
            "hashes": [
                "sha256:44d27919d04e23b3f40231c4ab7af4e61ce832ef46d610cc650d53e68328410a",
                "sha256:9600b7562f79a92cbf1fde6403c04fee314608fefbb595502e34383ae8203401"
            ],
            "index": "pypi",
            "markers": "python_version >= '3.6'",
            "version": "==3.2.3"
        },
        "django-filter": {
            "hashes": [
                "sha256:c4852822928ce17fb699bcfccd644b3574f1a2d80aeb2b4ff4f16b02dd49dc64",
                "sha256:d8ccaf6732afd21ca0542f6733b11591030fa98669f8d15599b358e24a2cd9c3"
            ],
            "index": "pypi",
            "markers": "python_version >= '3.8'",
            "version": "==24.3"
        },
        "django-jalali-date": {
            "hashes": [
                "sha256:7b0639e3594f34bc4458f5d371e3c072fda06bccacc5f68c751df3ce3d111ed3",
                "sha256:9610c0f24c6ce49b5f0d47863c7be1b7bfa12935664ca89a420690fd641a1f3a"
            ],
            "index": "pypi",
            "markers": "python_version >= '3'",
            "version": "==1.1.3"
        },
        "django-widget-tweaks": {
            "hashes": [
                "sha256:1c2180681ebb994e922c754804c7ffebbe1245014777ac47897a81f57cc629c7",
                "sha256:a41b7b2f05bd44d673d11ebd6c09a96f1d013ee98121cb98c384fe84e33b881e"
            ],
            "index": "pypi",
            "markers": "python_version >= '3.8'",
            "version": "==1.5.0"
        },
        "jalali-core": {
            "hashes": [
                "sha256:84e6f5090eadfb35234f24fad084be831d00da3c0b238ee001e8a1fd49bf7924",
                "sha256:f4287c70c630323dcf0a3ab26df905ba4d451e230ac1f65b3bb2f77797894a2b"
            ],
            "markers": "python_version >= '3.8'",
            "version": "==1.0.0"
        },
        "jdatetime": {
            "hashes": [
                "sha256:2cc603d913c0d8e328928454d3d295261cb037e9950227f67c9629ab4710fdf9",
                "sha256:37e23c710d7e9bde7c37d0cc3ff9e273323889790e902a1ef3ad99148f094fb9"
            ],
            "markers": "python_version >= '3.8'",
            "version": "==5.0.0"
        },
        "psycopg": {
            "hashes": [
                "sha256:644d3973fe26908c73d4be746074f6e5224b03c1101d302d9a53bf565ad64907",
                "sha256:a5764f67c27bec8bfac85764d23c534af2c27b893550377e37ce59c12aac47a2"
            ],
            "index": "pypi",
            "markers": "python_version >= '3.8'",
            "version": "==3.2.3"
        },
        "pysocks": {
            "hashes": [
                "sha256:08e69f092cc6dbe92a0fdd16eeb9b9ffbc13cadfe5ca4c7bd92ffb078b293299",
                "sha256:2725bd0a9925919b9b51739eea5f9e2bae91e83288108a9ad338b2e3a4435ee5",
                "sha256:3f8804571ebe159c380ac6de37643bb4685970655d3bba243530d6558b799aa0"
            ],
            "index": "pypi",
            "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'",
            "version": "==1.7.1"
        },
        "python-dotenv": {
            "hashes": [
                "sha256:e324ee90a023d808f1959c46bcbc04446a10ced277783dc6ee09987c37ec10ca",
                "sha256:f7b63ef50f1b690dddf550d03497b66d609393b40b564ed0d674909a68ebf16a"
            ],
            "index": "pypi",
            "markers": "python_version >= '3.8'",
            "version": "==1.0.1"
        },
        "sqlparse": {
            "hashes": [
                "sha256:09f67787f56a0b16ecdbde1bfc7f5d9c3371ca683cfeaa8e6ff60b4807ec9272",
                "sha256:cf2196ed3418f3ba5de6af7e82c694a9fbdbfecccdfc72e281548517081f16ca"
            ],
            "markers": "python_version >= '3.8'",
            "version": "==0.5.3"
        },
        "typing-extensions": {
            "hashes": [
                "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d",
                "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"
            ],
            "markers": "python_version >= '3.8'",
            "version": "==4.12.2"
        },
        "utm": {
            "hashes": [
                "sha256:3c9a3650e98bb6eecec535418d0dfd4db8f88c8ceaca112a0ff0787e116566e2"
            ],
            "index": "pypi",
            "version": "==0.7.0"
        },
        "whitenoise": {
            "hashes": [
                "sha256:486bd7267a375fa9650b136daaec156ac572971acc8bf99add90817a530dd1d4",
                "sha256:df12dce147a043d1956d81d288c6f0044147c6d2ab9726e5772ac50fb45d2280"
            ],
            "index": "pypi",
            "markers": "python_version >= '3.9'",
            "version": "==6.8.2"
        }
    },
    "develop": {}
}
@oz123
Copy link
Contributor

oz123 commented Dec 16, 2024

I agree. I've been seeing the issue lately too.

@oz123 oz123 self-assigned this Jan 9, 2025
@oz123 oz123 linked a pull request Jan 9, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants