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

Regression in 2020.11.15 failing to install editable package in deploy + user mode with non root user #4583

Closed
FloChehab opened this issue Jan 7, 2021 · 3 comments
Labels
Type: Duplicate This issue is a duplicate of an already-existing issue.

Comments

@FloChehab
Copy link

FloChehab commented Jan 7, 2021

Hello,

Issue description

I have an annoying issue with pipenv version 2020.11.15 (not present in 2020.11.4).
The setup is the following: I have an app with dependencies declared in setup.py that is installed in an "editable" fashion (kind of what is described in #4542 but simultaneously with PIP_USER=1 and --deploy and a non-root user).

The install fails with weird pip errors.

Among of which:

    raise InstallationError(exc_msg)
pip._internal.exceptions.InstallationError: Command errored out with exit status 1: /usr/local/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/some_user/app/setup.py'"'"'; __file__='"'"'/home/some_user/app/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps --user --prefix= Check the logs for full command output.

(but the command in question works fine when run outside of pipven and when investigating the logs of pip, it was talking about trying to uninstall files from /usr/local/lib/python3.8/site-packages/ which it cannot do as it is not a root user...).

Unfortunately, I couldn't understand what is going on with the comparison of the verbose output between the last two pipenv versions.

Expected result

The installation works just like with pipenv 2020.11.4.

Actual result

The installation fails.

Here are pipenv & pip logs:

pipenv_logs_pipenv_2020.11.15.txt
pip_logs_pipenv_2020.11.15.txt

Vs

pip_logs_pipenv_2020.11.4.txt

Steps to replicate

Here is a simple full-docker setup to replicate (hard to do otherwise):

example_docker_setup.zip

Unzip and run:

docker build --rm --no-cache .

You can edit the dockerfile to compare different pipenv versions.

Thanks for your help.


$ pipenv --support (from inside the docker image)

Pipenv version: '2020.11.15'

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

Python location: '/usr/local/bin/python'

Python installations found:

  • 3.8.6: /usr/local/bin/python3.8
  • 3.8.6: /usr/local/bin/python3

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.8.6',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '5.4.0-59-generic',
 'platform_system': 'Linux',
 'platform_version': '#65-Ubuntu SMP Thu Dec 10 12:01:51 UTC 2020',
 'python_full_version': '3.8.6',
 'python_version': '3.8',
 'sys_platform': 'linux'}

System environment variables:

  • PIP_LOG
  • USER
  • HOSTNAME
  • PYTHON_PIP_VERSION
  • HOME
  • GPG_KEY
  • USER_UID
  • PIP_USER
  • PYTHON_GET_PIP_URL
  • PATH
  • PIP_NO_CACHE_DIR
  • LANG
  • PIPENV_SYSTEM
  • PYTHON_VERSION
  • WORKDIR_PATH
  • PWD
  • PYTHON_GET_PIP_SHA256
  • USER_GID
  • PIP_DISABLE_PIP_VERSION_CHECK
  • PYTHONDONTWRITEBYTECODE
  • PIP_SHIMS_BASE_MODULE
  • PIP_PYTHON_PATH
  • PYTHONFINDER_IGNORE_UNSUPPORTED

Pipenv–specific environment variables:

  • PIPENV_SYSTEM: 1

Debug–specific environment variables:

  • PATH: /home/some_user/.local/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
  • LANG: C.UTF-8
  • PWD: /home/some_user/app

Contents of Pipfile ('/home/some_user/app/Pipfile'):

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

[dev-packages]

[packages]
bug = {path = ".", editable = true}

[requires]
python_version = "3.8"

Contents of Pipfile.lock ('/home/some_user/app/Pipfile.lock'):

{
    "_meta": {
        "hash": {
            "sha256": "85cfd057bb59713d5b0a79c7a5a98eb1824b14b03ad805c1ba6dcf5bcfbfced7"
        },
        "pipfile-spec": 6,
        "requires": {
            "python_version": "3.8"
        },
        "sources": [
            {
                "name": "pypi",
                "url": "https://pypi.org/simple",
                "verify_ssl": true
            }
        ]
    },
    "default": {
        "bug": {
            "editable": true,
            "path": "."
        }
    },
    "develop": {}
}
@n1ngu
Copy link

n1ngu commented Feb 2, 2021

Very much related to #4551 ?

@matteius
Copy link
Member

I am inclined to think it could be related to #4551 but then I also tried your example Pipfile and setup.py using pipenv==2021.11.23 and got a different result, it wasn't a flat out failure. Could you recheck on latest pipenv @FloChehab ?

mdavis@matt-VirtualBox:~/shared-projects/pipenv-4583$ pipenv install --deploy --verbose

Using python: 3.8

Path to python: /home/mdavis/.pyenv/versions/3.8.12/bin/python3.8

Creating a virtualenv for this project...

Pipfile: /home/mdavis/shared-projects/pipenv-4583/Pipfile

Using /home/mdavis/.pyenv/versions/3.8.12/bin/python3.8 (3.8.12) to create virtualenv...

⠸ Creating virtual environment...created virtual environment CPython3.8.12.final.0-64 in 160ms

  creator CPython3Posix(dest=/home/mdavis/.virtualenvs/pipenv-4583-7bhEV5yN, clear=False, no_vcs_ignore=False, global=False)

  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/mdavis/.local/share/virtualenv)

    added seed packages: pip==21.3.1, setuptools==58.3.0, wheel==0.37.0

  activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator



✔ Successfully created virtual environment! 

Virtualenv location: /home/mdavis/.virtualenvs/pipenv-4583-7bhEV5yN

Installing dependencies from Pipfile.lock (bfced7)...

Writing supplied requirement line to temporary file: '-e .'

Installing 'bug'

$ /home/mdavis/.virtualenvs/pipenv-4583-7bhEV5yN/bin/python -m pip install --verbose --upgrade --no-deps --exists-action=i -r /tmp/pipenv-yllclo44-requirements/pipenv-xog4kc7d-requirement.txt -i https://pypi.org/simple

Using source directory: '/home/mdavis/.virtualenvs/pipenv-4583-7bhEV5yN/src'

Using pip 21.3.1 from /home/mdavis/.virtualenvs/pipenv-4583-7bhEV5yN/lib/python3.8/site-packages/pip (python 3.8)

Obtaining file:///home/mdavis/shared-projects/pipenv-4583 (from -r /tmp/pipenv-yllclo44-requirements/pipenv-xog4kc7d-requirement.txt (line 1))

  Installing build dependencies: started

  Installing build dependencies: finished with status 'done'

  Checking if build backend supports build_editable: started

  Checking if build backend supports build_editable: finished with status 'done'

An error occurred while installing -e .! Will try again.

  🐍   ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 1/1 — 00:00:03

Installing initially failed dependencies...

Writing supplied requirement line to temporary file: '-e .'

Installing 'bug'

$ /home/mdavis/.virtualenvs/pipenv-4583-7bhEV5yN/bin/python -m pip install --verbose --upgrade --no-use-pep517 --no-deps --exists-action=i -r /tmp/pipenv-yllclo44-requirements/pipenv-ctz2pe2k-requirement.txt -i https://pypi.org/simple

Using source directory: '/home/mdavis/.virtualenvs/pipenv-4583-7bhEV5yN/src'

Using pip 21.3.1 from /home/mdavis/.virtualenvs/pipenv-4583-7bhEV5yN/lib/python3.8/site-packages/pip (python 3.8)

Obtaining file:///home/mdavis/shared-projects/pipenv-4583 (from -r /tmp/pipenv-yllclo44-requirements/pipenv-ctz2pe2k-requirement.txt (line 1))

Writing supplied requirement line to temporary file: '-e .'

Installing 'bug'

$ /home/mdavis/.virtualenvs/pipenv-4583-7bhEV5yN/bin/python -m pip install --verbose --upgrade --no-use-pep517 --no-deps --exists-action=i -r /tmp/pipenv-yllclo44-requirements/pipenv-ypfelxjw-requirement.txt -i https://pypi.org/simple

Using source directory: '/home/mdavis/.virtualenvs/pipenv-4583-7bhEV5yN/src'

Using pip 21.3.1 from /home/mdavis/.virtualenvs/pipenv-4583-7bhEV5yN/lib/python3.8/site-packages/pip (python 3.8)

Obtaining file:///home/mdavis/shared-projects/pipenv-4583 (from -r /tmp/pipenv-yllclo44-requirements/pipenv-ypfelxjw-requirement.txt (line 1))

  ☤  ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 2/2 — 00:00:01

@matteius matteius added the Type: Duplicate This issue is a duplicate of an already-existing issue. label Dec 24, 2021
@matteius
Copy link
Member

Closing this one as a duplicate of #4551 -- suggesting everyone get to latest pipenv and pip and re-check their projects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Duplicate This issue is a duplicate of an already-existing issue.
Projects
None yet
Development

No branches or pull requests

3 participants