question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pipenv cant run pur inside environment with pipfile

See original GitHub issue

Issue description

Cant run dev packages that are installed via pipfile.

Expected result

pipenv run pur should run pur inside the pipenv

Actual result

❯ pipenv run pur Traceback (most recent call last): File “/usr/local/Cellar/pipenv/2020.11.15/libexec/bin/pipenv”, line 8, in <module> sys.exit(cli()) File “/usr/local/Cellar/pipenv/2020.11.15/libexec/lib/python3.9/site-packages/pipenv/vendor/click/core.py”, line 829, in call return self.main(*args, **kwargs) File “/usr/local/Cellar/pipenv/2020.11.15/libexec/lib/python3.9/site-packages/pipenv/vendor/click/core.py”, line 782, in main rv = self.invoke(ctx) File “/usr/local/Cellar/pipenv/2020.11.15/libexec/lib/python3.9/site-packages/pipenv/vendor/click/core.py”, line 1259, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File “/usr/local/Cellar/pipenv/2020.11.15/libexec/lib/python3.9/site-packages/pipenv/vendor/click/core.py”, line 1066, in invoke return ctx.invoke(self.callback, **ctx.params) File “/usr/local/Cellar/pipenv/2020.11.15/libexec/lib/python3.9/site-packages/pipenv/vendor/click/core.py”, line 610, in invoke return callback(*args, **kwargs) File “/usr/local/Cellar/pipenv/2020.11.15/libexec/lib/python3.9/site-packages/pipenv/vendor/click/decorators.py”, line 73, in new_func return ctx.invoke(f, obj, *args, **kwargs) File “/usr/local/Cellar/pipenv/2020.11.15/libexec/lib/python3.9/site-packages/pipenv/vendor/click/core.py”, line 610, in invoke return callback(*args, **kwargs) File “/usr/local/Cellar/pipenv/2020.11.15/libexec/lib/python3.9/site-packages/pipenv/cli/command.py”, line 449, in run do_run( File “/usr/local/Cellar/pipenv/2020.11.15/libexec/lib/python3.9/site-packages/pipenv/core.py”, line 2547, in do_run run_fn(*run_args, **run_kwargs) File “/usr/local/Cellar/pipenv/2020.11.15/libexec/lib/python3.9/site-packages/pipenv/core.py”, line 2499, in do_run_posix os.execl( File “/usr/local/Cellar/python@3.9/3.9.2/Frameworks/Python.framework/Versions/3.9/lib/python3.9/os.py”, line 542, in execl execv(file, args) FileNotFoundError: [Errno 2] No such file or directory

Steps to replicate

Create a new folder. Create the Pipfile:


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

[packages]

[dev-packages]
pur = "==5.3.0"

[requires]
python_version = "3.9"

[pipenv]
allow_prereleases = true

Run pipenv install

Run pipenv run pur

Pipenv version: '2020.11.15'

Pipenv location: '/usr/local/Cellar/pipenv/2020.11.15/libexec/lib/python3.9/site-packages/pipenv'

Python location: '/usr/local/Cellar/pipenv/2020.11.15/libexec/bin/python'

Python installations found:

  • 3.9.0: /Users/lans/.pyenv/versions/3.9.0/bin/python3
  • 3.8.2: /usr/bin/python3
  • 3.7.10: /Users/lans/.pyenv/versions/3.7.10/bin/python3
  • 2.7.16: /usr/bin/python2
  • 2.7.16: /usr/bin/python2.7

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.9.2',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '20.3.0',
 'platform_system': 'Darwin',
 'platform_version': 'Darwin Kernel Version 20.3.0: Thu Jan 21 00:07:06 PST '
                     '2021; root:xnu-7195.81.3~1/RELEASE_X86_64',
 'python_full_version': '3.9.2',
 'python_version': '3.9',
 'sys_platform': 'darwin'}

System environment variables:

  • PATH
  • AUTOJUMP_ERROR_PATH
  • TERM_PROGRAM
  • _P9K_TTY
  • PHPPATH
  • AUTOJUMP_SOURCED
  • ANDROID_HOME
  • TERM
  • SHELL
  • DOTFILESPATH
  • TMPDIR
  • TERM_PROGRAM_VERSION
  • GOLANGPATH
  • TERM_SESSION_ID
  • ZSH
  • LC_ALL
  • USER
  • GCLOUD_ACCOUNT
  • COMMAND_MODE
  • SITESPATH
  • ENV
  • SSH_AUTH_SOCK
  • __CF_USER_TEXT_ENCODING
  • PAGER
  • LSCOLORS
  • _
  • LaunchInstanceID
  • __CFBundleIdentifier
  • PWD
  • P9K_SSH
  • P9K_TTY
  • LANG
  • ITERM_PROFILE
  • CLOUDSDK_PYTHON
  • XPC_FLAGS
  • BITBUCKET_USERNAME
  • XPC_SERVICE_NAME
  • JAVASCRIPTPATH
  • SHLVL
  • HOME
  • COLORFGBG
  • DEVOPSPATH
  • DEVELOPMENTPATH
  • LC_TERMINAL_VERSION
  • ITERM_SESSION_ID
  • PYTHONPATH
  • LOGNAME
  • LESS
  • APPPATH
  • LC_CTYPE
  • GOPATH
  • EXEC_ENV
  • LC_TERMINAL
  • SECURITYSESSIONID
  • COLORTERM
  • PIP_DISABLE_PIP_VERSION_CHECK
  • PYTHONDONTWRITEBYTECODE
  • PIP_SHIMS_BASE_MODULE
  • PIP_PYTHON_PATH
  • PYTHONFINDER_IGNORE_UNSUPPORTED

Pipenv–specific environment variables:

Debug–specific environment variables:

  • PATH: /usr/local/Cellar/pipenv/2020.11.15/libexec/tools:/Users/lans/bin:/usr/local/bin:/Users/lans/Developer/flutter/bin/:/Users/lans/bin:/usr/local/bin:/Users/lans/bin:/usr/local/bin:/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Users/lans/Library/Application:/Users/lans/Library/Android/sdk/tools:/Users/lans/Library/Android/sdk/platform-tools:/Users/lans/go/bin
  • SHELL: /bin/zsh
  • LANG: en_US.UTF-8
  • PWD: /Users/lans/temp/test_pipenv

Contents of Pipfile (‘/Users/lans/temp/test_pipenv/Pipfile’):

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

[packages]

[dev-packages]
pur = "==5.3.0"

[requires]
python_version = "3.9"

[pipenv]
allow_prereleases = true

Contents of Pipfile.lock (‘/Users/lans/temp/test_pipenv/Pipfile.lock’):

{
    "_meta": {
        "hash": {
            "sha256": "1a185aad8dcd289d58d0f4133328bde41319aaf7bfed4e449f5268dc1f44c9d4"
        },
        "pipfile-spec": 6,
        "requires": {
            "python_version": "3.9"
        },
        "sources": [
            {
                "name": "pypi",
                "url": "https://pypi.org/simple",
                "verify_ssl": true
            }
        ]
    },
    "default": {},
    "develop": {
        "click": {
            "hashes": [
                "sha256:d2b5255c7c6349bc1bd1e59e08cd12acbbd63ce649f2588755783aa94dfb6b1a",
                "sha256:dacca89f4bfadd5de3d7489b7c8a566eee0d3676333fbb50030263894c38c0dc"
            ],
            "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'",
            "version": "==7.1.2"
        },
        "pur": {
            "hashes": [
                "sha256:8587c548469bcd8f47e1f7bd1cae3c11d9cd9c2e4219c86d08499b8efdfe1e05"
            ],
            "index": "pypi",
            "version": "==5.3.0"
        }
    }
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
jrottenbergcommented, Mar 9, 2021

You have pur as dev-packages, so it won’t be installed with a simple pipenv install && pipenv run

Try pipenv install --dev , then pipenv run pur

Using :

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

[packages]
pur = "*"

[dev-packages]

[requires]
python_version = "3.9"

Got :

$ pipenv run  pur --version
pur, version 5.3.0
1reaction
andreaslanscommented, Mar 9, 2021

Thank you @jrottenberg, you saved my day! ❤️

Read more comments on GitHub >

github_iconTop Results From Across the Web

Advanced Usage of Pipenv - Read the Docs
Dependencies of wheels provided in a Pipfile will not be captured by $ pipenv ... Pipenv will expand environment variables (if defined) in...
Read more >
How to install dependencies from a copied pipfile inside a ...
The proper answer to this question is that pipenv install or pipenv install --dev (if there are dev dependencies) should be ran.
Read more >
pipenv Documentation - Read the Docs
Pipenv is a tool that aims to bring the best of all packaging worlds (bundler, composer, npm, cargo, yarn, etc.) to the. Python...
Read more >
Advanced Usage of Pipenv — pipenv 11.7.2 documentation
Dependencies of wheels provided in a Pipfile will not be captured by ... cat .env HELLO=WORLD⏎ $ pipenv run python Loading .env environment...
Read more >
Configure a Pipenv environment | PyCharm Documentation
Install Pipenv · Run the following command: $ py -m site --user-site. A sample output can be: · Replace site-packages with Scripts in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found