Broken pipe in WSL2
See original GitHub issueIssue description
Within WSL2 (Debian), when creating an environment and running pipenv shell i receive a broken pipe when it try’s to load. I dont know if this is a WSL2 thing or a pipenv thing.
Expected result
I would have expected to be put into the virtualenv
Actual result
When possible, provide the verbose output (--verbose), especially for locking and dependencies resolving issues.
$ pipenv shell --verbose
Launching subshell in virtual environment…
 . /home/jthorpe/.local/share/virtualenvs/temp-HIOIE7wf/bin/activate
--verbose
write failed 32: Broken pipe
Steps to replicate
Provide the steps to replicate (which usually at least includes the commands and the Pipfile).
[~]$ cd /tmp
[/tmp]$ mkdir temp ; cd $_
[/tmp/temp]$ echo "print('hello world')" > test.py
[/tmp/temp]$ pipenv install --three
Creating a virtualenv for this project…
Pipfile: /tmp/temp/Pipfile
Using /usr/bin/python3.7m (3.7.3) to create virtualenv…
⠴ Creating virtual environment...Using base prefix '/usr'
New python executable in /home/jthorpe/.local/share/virtualenvs/temp-HIOIE7wf/bin/python3.7m
Also creating executable in /home/jthorpe/.local/share/virtualenvs/temp-HIOIE7wf/bin/python
Installing setuptools, pkg_resources, pip, wheel...done.
Running virtualenv with interpreter /usr/bin/python3.7m
✔ Successfully created virtual environment!
Virtualenv location: /home/jthorpe/.local/share/virtualenvs/temp-HIOIE7wf
Creating a Pipfile for this project…
Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
Updated Pipfile.lock (a65489)!
Installing dependencies from Pipfile.lock (a65489)…
  🐍   ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 0/0 — 00:00:00
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.
[/tmp/temp]$ pipenv shell
Launching subshell in virtual environment…
 . /home/jthorpe/.local/share/virtualenvs/temp-HIOIE7wf/bin/activate
write failed 32: Broken pipe
[/tmp/temp]$ exit
exit
[/tmp/temp]$ pipenv shell
Launching subshell in virtual environment…
 . /home/jthorpe/.local/share/virtualenvs/temp-HIOIE7wf/bin/activate
[/tmp/temp]$ which python
/usr/bin/python
[/tmp/temp]$ exit
exit
[/tmp/temp]$ pipenv run "which python"
[/tmp/temp]$
Please run $ pipenv --support, and paste the results here. Don’t put backticks (`) around it! The output already contains Markdown formatting.
$ pipenv --support
Pipenv version: '2020.6.2'
Pipenv location: '/home/jthorpe/.local/lib/python3.7/site-packages/pipenv'
Python location: '/usr/bin/python3'
Python installations found:
3.7.3:/usr/bin/python3.73.7.3:/usr/bin/python33.7.3:/usr/bin/python3.7m2.7.16:/usr/bin/python22.7.16:/usr/bin/python2.7
PEP 508 Information:
{'implementation_name': 'cpython',
 'implementation_version': '3.7.3',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '4.19.104-microsoft-standard',
 'platform_system': 'Linux',
 'platform_version': '#1 SMP Wed Feb 19 06:37:35 UTC 2020',
 'python_full_version': '3.7.3',
 'python_version': '3.7',
 'sys_platform': 'linux'}
System environment variables:
SHELLLESSWSL_DISTRO_NAMEWT_SESSIONPIPENV_ACTIVENAMEPWDLOGNAMEPIP_PYTHON_PATHHOMELANGWSL_INTEROPLS_COLORSTERMLESSOPENUSERPIP_DISABLE_PIP_VERSION_CHECKDISPLAYSHLVLPYTHONDONTWRITEBYTECODEWSLENVPATHHOSTTYPEWT_PROFILE_IDOLDPWD_PIP_SHIMS_BASE_MODULEPYTHONFINDER_IGNORE_UNSUPPORTED
Pipenv–specific environment variables:
PIPENV_ACTIVE:1
Debug–specific environment variables:
PATH:/home/jthorpe/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Windows/System32:/mnt/c/Windows:/mnt/c/Windows/System32/wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/:/mnt/c/Windows/System32/OpenSSH/:/mnt/c/Program Files (x86)/GnuPG/bin:/mnt/c/Android:/mnt/c/Windows/System32:/mnt/c/Program Files/dotnet/:/mnt/c/Users/Joe/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/Joe/Documents/opt/emacs26/bin:/mnt/c/Users/Joe/AppData/Local/hyper/app-3.0.2/resources/bin:/mnt/c/Users/Joe/AppData/Local/Programs/Microsoft VS Code/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/jthorpe/.local/bin:/mnt/c/Windows/System32/:/mnt/c/Windows/SysWOW64/:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/jthorpe/.local/bin:/mnt/c/Windows/System32/:/mnt/c/Windows/SysWOW64/SHELL:/bin/bashLANG:en_US.UTF-8PWD:/tmp/temp
Contents of Pipfile (‘/tmp/temp/Pipfile’):
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
[packages]
[requires]
python_version = "3.7"
Contents of Pipfile.lock (‘/tmp/temp/Pipfile.lock’):
{
    "_meta": {
        "hash": {
            "sha256": "7e7ef69da7248742e869378f8421880cf8f0017f96d94d086813baa518a65489"
        },
        "pipfile-spec": 6,
        "requires": {
            "python_version": "3.7"
        },
        "sources": [
            {
                "name": "pypi",
                "url": "https://pypi.org/simple",
                "verify_ssl": true
            }
        ]
    },
    "default": {},
    "develop": {}
}
Issue Analytics
- State:
 - Created 3 years ago
 - Comments:9
 

Top Related StackOverflow Question
Not sure if there’s any interest in revisiting this, but I’ve been running into the same issue as described above. If it helps, I also get the exact same behaviour using Poetry’s
poetry shellcommand. I wonder if WSL doesn’t play nice with pexpectI’ve dropped pipenv since I commented, but here’s my Pipfile from when I last observed this issue:
I ran into the issue while running
pipenv shell. I do still run into this issue withpoetry shell, and I’ve generally adapted my workflow to compensate rather than continue to wrestle with it. If there are specific resources I can provide or troubleshooting steps I can take that would help with reproducing it, let me know.