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

Attribute Error in environment.py #5950

Closed
fmssn opened this issue Sep 27, 2023 · 3 comments
Closed

Attribute Error in environment.py #5950

fmssn opened this issue Sep 27, 2023 · 3 comments
Labels

Comments

@fmssn
Copy link
Contributor

fmssn commented Sep 27, 2023

Issue description

On specific python installations for specific packages, installation fails. The especially occured when installing prefect from Pipfile when using the Docker image prefecthq/prefect:2.13-python3.11. However this was also the case for other 3.11 installations.

Expected result

Installing normally.

Actual result

root@06bb7bbc7617:/workspaces/prefect/prefect# pipenv install --system
Installing dependencies from Pipfile.lock (4f58fc)...
Traceback (most recent call last):
  File "/usr/local/bin/pipenv", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/usr/local/lib/python3.11/site-packages/pipenv/vendor/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pipenv/cli/options.py", line 58, in main
    return super().main(*args, **kwargs, windows_expand_args=False)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pipenv/vendor/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pipenv/vendor/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pipenv/vendor/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pipenv/vendor/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pipenv/vendor/click/decorators.py", line 84, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pipenv/vendor/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pipenv/cli/command.py", line 209, in install
    do_install(
  File "/usr/local/lib/python3.11/site-packages/pipenv/routines/install.py", line 164, in do_install
    do_init(
  File "/usr/local/lib/python3.11/site-packages/pipenv/routines/install.py", line 680, in do_init
    do_install_dependencies(
  File "/usr/local/lib/python3.11/site-packages/pipenv/routines/install.py", line 438, in do_install_dependencies
    batch_install(
  File "/usr/local/lib/python3.11/site-packages/pipenv/routines/install.py", line 503, in batch_install
    deps_to_install = [
                      ^
  File "/usr/local/lib/python3.11/site-packages/pipenv/routines/install.py", line 506, in <listcomp>
    if not project.environment.is_satisfied(dep)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pipenv/environment.py", line 793, in is_satisfied
    vcs_type == req.link.scheme
                ^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'scheme'

Steps to replicate

Run pipenv lock and pipenv install --system in dev container prefecthq/prefect:2.13-python3.11, but issue also persists when using image mcr.microsoft.com/devcontainers/python:1-3.11-bullseye or locally

Pipfile

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

[packages]
prefect = "*"

[dev-packages]
pytest = "*"

Provide the steps to replicate (which usually at least includes the commands and the Pipfile).


$ pipenv --support

Pipenv version: '2023.9.8'

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

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

OS Name: 'posix'

User pip version: '23.2.1'

user Python installations found:

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.11.5',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '5.15.90.1-microsoft-standard-WSL2',
 'platform_system': 'Linux',
 'platform_version': '#1 SMP Fri Jan 27 02:56:13 UTC 2023',
 'python_full_version': '3.11.5',
 'python_version': '3.11',
 'sys_platform': 'linux'}

System environment variables:

  • SHELL
  • COLORTERM
  • TERM_PROGRAM_VERSION
  • HOSTNAME
  • PYTHON_VERSION
  • SSH_AUTH_SOCK
  • REMOTE_CONTAINERS_IPC
  • PWD
  • PYTHON_SETUPTOOLS_VERSION
  • VSCODE_GIT_ASKPASS_NODE
  • HOME
  • LANG
  • REMOTE_CONTAINERS
  • WAYLAND_DISPLAY
  • GPG_KEY
  • GIT_ASKPASS
  • VSCODE_GIT_ASKPASS_EXTRA_ARGS
  • TERM
  • REMOTE_CONTAINERS_SOCKETS
  • VSCODE_GIT_IPC_HANDLE
  • DISPLAY
  • SHLVL
  • PYTHON_PIP_VERSION
  • XDG_RUNTIME_DIR
  • PYTHON_GET_PIP_SHA256
  • LC_ALL
  • VSCODE_GIT_ASKPASS_MAIN
  • PYTHON_GET_PIP_URL
  • BROWSER
  • PATH
  • REMOTE_CONTAINERS_DISPLAY_SOCK
  • TERM_PROGRAM
  • VSCODE_IPC_HOOK_CLI
  • _
  • OLDPWD
  • PIP_DISABLE_PIP_VERSION_CHECK
  • PYTHONDONTWRITEBYTECODE
  • PYTHONFINDER_IGNORE_UNSUPPORTED

Pipenv–specific environment variables:

Debug–specific environment variables:

  • PATH: /vscode/vscode-server/bin/linux-x64/abd2f3db4bdb28f9e95536dfa84d8479f1eb312d/bin/remote-cli:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
  • SHELL: /bin/bash
  • LANG: C.UTF-8
  • PWD: /workspaces/prefect/prefect

Contents of Pipfile ('/workspaces/prefect/prefect/Pipfile'):

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

[packages]
prefect = "*"

[dev-packages]
pytest = "*"
@fmssn fmssn mentioned this issue Sep 27, 2023
2 tasks
@ryanthompson591
Copy link

I am also experiencing this problem.

Work Around I found

I have worked around this by using an earlier version of pipenv

RUN pip install pipenv==2023.7.23

My steps to replicate:

Pipfile

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

[packages]
apache-beam = {version = "==2.48.0", extras = ["gcp"]}

Dockerfile

FROM apache/beam_python3.8_sdk:2.48.0
WORKDIR /src
RUN pip install pipenv
COPY ./Pipfile /src/Pipfile
RUN pipenv lock
RUN pipenv install --system --deploy --ignore-pipfile --categories="packages,report_deid" --verbose

Then run:
docker build . -t test_image

Error Stack:

[ 6/16] RUN pipenv install --system --deploy --ignore-pipfile --categories="packages":
0.765 Installing dependencies from Pipfile.lock (d186c3)...
0.940 Traceback (most recent call last):
0.940   File "/usr/local/bin/pipenv", line 8, in <module>
0.940     sys.exit(cli())
0.940   File "/usr/local/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 1130, in __call__
0.940     return self.main(*args, **kwargs)
0.940   File "/usr/local/lib/python3.8/site-packages/pipenv/cli/options.py", line 58, in main
0.940     return super().main(*args, **kwargs, windows_expand_args=False)
0.940   File "/usr/local/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 1055, in main
0.940     rv = self.invoke(ctx)
0.940   File "/usr/local/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 1657, in invoke
0.940     return _process_result(sub_ctx.command.invoke(sub_ctx))
0.940   File "/usr/local/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 1404, in invoke
0.940     return ctx.invoke(self.callback, **ctx.params)
0.940   File "/usr/local/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 760, in invoke
0.940     return __callback(*args, **kwargs)
0.940   File "/usr/local/lib/python3.8/site-packages/pipenv/vendor/click/decorators.py", line 84, in new_func
0.940     return ctx.invoke(f, obj, *args, **kwargs)
0.940   File "/usr/local/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 760, in invoke
0.940     return __callback(*args, **kwargs)
0.940   File "/usr/local/lib/python3.8/site-packages/pipenv/cli/command.py", line 209, in install
0.940     do_install(
0.940   File "/usr/local/lib/python3.8/site-packages/pipenv/routines/install.py", line 164, in do_install
0.940     do_init(
0.940   File "/usr/local/lib/python3.8/site-packages/pipenv/routines/install.py", line 680, in do_init
0.940     do_install_dependencies(
0.940   File "/usr/local/lib/python3.8/site-packages/pipenv/routines/install.py", line 438, in do_install_dependencies
0.940     batch_install(
0.940   File "/usr/local/lib/python3.8/site-packages/pipenv/routines/install.py", line 503, in batch_install
0.940     deps_to_install = [
0.940   File "/usr/local/lib/python3.8/site-packages/pipenv/routines/install.py", line 506, in <listcomp>
0.940     if not project.environment.is_satisfied(dep)
0.940   File "/usr/local/lib/python3.8/site-packages/pipenv/environment.py", line 793, in is_satisfied
0.940     vcs_type == req.link.scheme
0.940 AttributeError: 'NoneType' object has no attribute 'scheme'

@matteius
Copy link
Member

Could this be checked against the main branch? I am not experiencing the issue. It may just be that we need to cut a new release ...

@fmssn
Copy link
Contributor Author

fmssn commented Sep 30, 2023

PR got merged. #5951

@fmssn fmssn closed this as completed Sep 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants