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

Pipenv does not install all packages into virtual environment #4301

Closed
frenzymadness opened this issue Jun 1, 2020 · 2 comments
Closed

Pipenv does not install all packages into virtual environment #4301

frenzymadness opened this issue Jun 1, 2020 · 2 comments
Labels
Type: Duplicate This issue is a duplicate of an already-existing issue.

Comments

@frenzymadness
Copy link
Contributor

Issue description

Imagine you have separated virtual environment just for pipenv and you want to use it to install your dependencies into another virtual environment. --no-site-packages does not help.

# Create two virtual environments
$ python3.8 -m venv pipenv_venv
$ python3.8 -m venv app_venv

# Activate the first one and install pipenv into it
$ source pipenv_venv/bin/activate
(pipenv_venv)$ pip install pipenv
…
(pipenv_venv)$ pip list
Package          Version   
---------------- ----------
appdirs          1.4.4     
certifi          2020.4.5.1
distlib          0.3.0     
filelock         3.0.12    
pip              19.3.1    
pipenv           2020.5.28 
setuptools       41.6.0    
six              1.15.0    
virtualenv       20.0.21   
virtualenv-clone 0.5.4     
(pipenv_venv)$ deactivate 

# Activate the second one and try to install app dependencies
# using pipenv from the first virtual environment
$ source app_venv/bin/activate
(app_venv)$ cat Pipfile 
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
six = "*"
certifi = "*"
chardet = "*"
(app_venv)$ pipenv_venv/bin/pipenv install
Courtesy Notice: Pipenv found itself running within a virtual environment, so it will automatically use that environment, instead of creating its own for any project. You can set PIPENV_IGNORE_VIRTUALENVS=1 to force pipenv to ignore that environment and create its own instead. You can set PIPENV_VERBOSITY=-1 to suppress this warning.
Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
Building requirements...
Resolving dependencies...
✔ Success! 
Updated Pipfile.lock (8cd69a)!
Installing dependencies from Pipfile.lock (8cd69a)…
  🐍   ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 1/1 — 00:00:00

# certifi and six are missing
(app_venv)$ pip list
Package    Version
---------- -------
chardet    3.0.4  
pip        19.3.1 
setuptools 41.6.0

Expected result

The app_venv containing all packages mentioned in the Pipfile.

Actual result

pipenv ignores packages available in pipenv_venv.

Steps to replicate

See the console log above.


$ pipenv --support

Pipenv version: '2020.5.28'

Pipenv location: '/tmp/pipenv_venv/lib64/python3.8/site-packages/pipenv'

Python location: '/tmp/pipenv_venv/bin/python3.8'

Python installations found:

  • 3.9.0: /usr/bin/python3.9
  • 3.8.3: /tmp/pipenv_venv/bin/python3
  • 3.8.3: /tmp/pipenv_venv/bin/python3.8
  • 3.8.3: /tmp/pipenv_venv/bin/python3
  • 3.8.3: /tmp/pipenv_venv/bin/python3.8
  • 3.8.3: /usr/bin/python3
  • 3.8.3: /usr/bin/python3.8
  • 3.7.7: /usr/bin/python3.7
  • 3.7.7: /usr/bin/python3.7m
  • 3.6.10: /usr/bin/python3.6m
  • 3.6.10: /usr/bin/python3.6
  • 3.6.9: /usr/bin/pypy3.6
  • 3.6.9: /usr/bin/pypy3
  • 3.5.9: /usr/bin/python3.5m
  • 3.5.9: /usr/bin/python3.5
  • 3.4.10: /usr/bin/python3.4m
  • 3.4.10: /usr/bin/python3.4
  • 2.7.18: /usr/bin/python2
  • 2.7.18: /usr/bin/python2.7
  • 2.7.13: /usr/bin/pypy2.7
  • 2.7.13: /usr/bin/pypy2
  • 2.6.9: /usr/bin/python2.6

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.8.3',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '5.6.14-300.fc32.x86_64',
 'platform_system': 'Linux',
 'platform_version': '#1 SMP Wed May 20 20:47:32 UTC 2020',
 'python_full_version': '3.8.3',
 'python_version': '3.8',
 'sys_platform': 'linux'}

System environment variables:

  • SHELL
  • LSCOLORS
  • SESSION_MANAGER
  • COLORTERM
  • LESS
  • HISTCONTROL
  • XDG_MENU_PREFIX
  • HISTSIZE
  • HOSTNAME
  • FPATH
  • RPM_PACKAGER
  • SSH_AUTH_SOCK
  • XMODIFIERS
  • DESKTOP_SESSION
  • SSH_AGENT_PID
  • PWD
  • LOGNAME
  • XDG_SESSION_DESKTOP
  • XDG_SESSION_TYPE
  • MODULESHOME
  • MANPATH
  • GIT_COMMITTER_NAME
  • XAUTHORITY
  • GJS_DEBUG_TOPICS
  • WINDOWPATH
  • GDM_LANG
  • VIRTUALENVWRAPPER_SCRIPT
  • HOME
  • USERNAME
  • LANG
  • LS_COLORS
  • _VIRTUALENVWRAPPER_API
  • XDG_CURRENT_DESKTOP
  • VIRTUAL_ENV
  • VTE_VERSION
  • VIRTUALENVWRAPPER_WORKON_CD
  • VIRTUAL_ENV_DISABLE_PROMPT
  • GNOME_TERMINAL_SCREEN
  • INVOCATION_ID
  • MANAGERPID
  • GIT_AUTHOR_EMAIL
  • GJS_DEBUG_OUTPUT
  • VAGRANT_DEFAULT_PROVIDER
  • WORKON_HOME
  • MODULEPATH_modshare
  • GIT_COMMITTER_EMAIL
  • XDG_SESSION_CLASS
  • TERM
  • ZSH
  • LESSOPEN
  • USER
  • GNOME_TERMINAL_SERVICE
  • MODULES_RUN_QUARANTINE
  • LOADEDMODULES
  • VIRTUALENVWRAPPER_PROJECT_FILENAME
  • DISPLAY
  • SHLVL
  • PAGER
  • QT_IM_MODULE
  • LC_CTYPE
  • XDG_RUNTIME_DIR
  • KDEDIRS
  • JOURNAL_STREAM
  • XDG_DATA_DIRS
  • GIT_AUTHOR_NAME
  • PATH
  • MODULEPATH
  • VIRTUALENVWRAPPER_HOOK_DIR
  • GDMSESSION
  • DBUS_SESSION_BUS_ADDRESS
  • MAIL
  • OLDPWD
  • MODULES_CMD
  • BASH_FUNC_switchml%%
  • BASH_FUNC_module%%
  • BASH_FUNC_scl%%
  • BASH_FUNC__module_raw%%
  • _
  • 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: /tmp/pipenv_venv/bin:/home/lbalhar/Tools/anaconda3/bin:/home/lbalhar/.local/bin:/home/lbalhar/bin:/home/lbalhar/.local/bin/:/home/lbalhar/bin:/usr/local/bin:/usr/share/Modules/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/home/lbalhar/bin
  • SHELL: /bin/bash
  • LANG: en_US.UTF-8
  • PWD: /tmp
  • VIRTUAL_ENV: /tmp/pipenv_venv

Contents of Pipfile ('/tmp/Pipfile'):

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

[packages]
six = "*"
certifi = "*"
chardet = "*"

Contents of Pipfile.lock ('/tmp/Pipfile.lock'):

{
    "_meta": {
        "hash": {
            "sha256": "153937e7bdfc35560b914fbb2534ea2f6eb75ae18fed38100bffb230928cd69a"
        },
        "pipfile-spec": 6,
        "requires": {},
        "sources": [
            {
                "name": "pypi",
                "url": "https://pypi.org/simple",
                "verify_ssl": true
            }
        ]
    },
    "default": {
        "certifi": {
            "hashes": [
                "sha256:1d987a998c75633c40847cc966fcf5904906c920a7f17ef374f5aa4282abd304",
                "sha256:51fcb31174be6e6664c5f69e3e1691a2d72a1a12e90f872cbdb1567eb47b6519"
            ],
            "index": "pypi",
            "version": "==2020.4.5.1"
        },
        "chardet": {
            "hashes": [
                "sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae",
                "sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691"
            ],
            "index": "pypi",
            "version": "==3.0.4"
        },
        "six": {
            "hashes": [
                "sha256:30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259",
                "sha256:8b74bedcbbbaca38ff6d7491d76f2b06b3592611af620f8426e82dddb04a5ced"
            ],
            "index": "pypi",
            "version": "==1.15.0"
        }
    },
    "develop": {}
}
@torsava
Copy link
Contributor

torsava commented Jun 1, 2020

I can confirm the reproducer. It works with the previous version (2018.11.26) and fails with the new one (2020.5.28).

I have tried to coax the correct behaviour from the new version by using the flag --no-site-packages, but it does not help.

@frostming
Copy link
Contributor

frostming commented Jun 1, 2020

Duplicate with #4276 , keep an eye on https://github.com/pypa/pipenv/milestone/8 for the release progress

@frostming frostming added the Type: Duplicate This issue is a duplicate of an already-existing issue. label Jun 1, 2020
@triage-new-issues triage-new-issues bot removed the triage label Jun 1, 2020
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