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

Broken pipe in WSL2 #4396

Closed
jthorpe6 opened this issue Jul 17, 2020 · 9 comments
Closed

Broken pipe in WSL2 #4396

jthorpe6 opened this issue Jul 17, 2020 · 9 comments
Labels
OS: Windows This issue affects the Windows Operating System. triage

Comments

@jthorpe6
Copy link

Issue 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.7
  • 3.7.3: /usr/bin/python3
  • 3.7.3: /usr/bin/python3.7m
  • 2.7.16: /usr/bin/python2
  • 2.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:

  • SHELL
  • LESS
  • WSL_DISTRO_NAME
  • WT_SESSION
  • PIPENV_ACTIVE
  • NAME
  • PWD
  • LOGNAME
  • PIP_PYTHON_PATH
  • HOME
  • LANG
  • WSL_INTEROP
  • LS_COLORS
  • TERM
  • LESSOPEN
  • USER
  • PIP_DISABLE_PIP_VERSION_CHECK
  • DISPLAY
  • SHLVL
  • PYTHONDONTWRITEBYTECODE
  • WSLENV
  • PATH
  • HOSTTYPE
  • WT_PROFILE_ID
  • OLDPWD
  • _
  • PIP_SHIMS_BASE_MODULE
  • PYTHONFINDER_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/bash
  • LANG: en_US.UTF-8
  • PWD: /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": {}
}
@michjnich
Copy link

I just tried to replicate this on my WSL2 Debian with Python 3.8.5 and had no issues doing so:

Linux DESKTOP-OFFICE 4.19.104-microsoft-standard #1 SMP Wed Feb 19 06:37:35 UTC 2020 x86_64 GNU/Linux

@jthorpe6
Copy link
Author

jthorpe6 commented Aug 3, 2020

Thank you, did you install python 3.8.5 from source? as i cant seem to install it from apt

$ sudo apt install python3.8
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package python3.8
E: Couldn't find any package by glob 'python3.8'
E: Couldn't find any package by regex 'python3.8'

But python 3.7 is there

$ sudo apt install python3.7
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3.7 is already the newest version (3.7.3-2+deb10u2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

@michjnich
Copy link

Ignore the message I just deleted. This was Debian not Ubuntu :) - I think I built from source according to this: https://linuxize.com/post/how-to-install-python-3-8-on-debian-10/ (though with 3.8.5 not 3.8.2).

@michjnich
Copy link

For info, here's my pipenv --support output.

mike@DESKTOP-OFFICE:~/workspaces/temp/pipenv$ pipenv shell
Launching subshell in virtual environment…
 . /home/mike/.local/share/virtualenvs/pipenv-3mqHYeJE/bin/activate
       _,met$$$$$gg.          mike@DESKTOP-OFFICE
    ,g$$$$$$$$$$$$$$$P.       -------------------
  ,g$$P"     """Y$$.".        OS: Debian GNU/Linux 10 (buster) on Windows 10 x86_64
 ,$$P'              `$$$.     Kernel: 4.19.104-microsoft-standard
',$$P       ,ggs.     `$$b:   Uptime: 1 hour, 14 mins
`d$$'     ,$P"'   .    $$$    Packages: 602 (dpkg)
 $$P      d$'     ,    $$P    Shell: bash 5.0.3
 $$:      $$.   -    ,d$$'    Terminal: pipenv
 $$;      Y$b._   _,d$P'      CPU: Intel i7-7700 (8) @ 3.599GHz
 Y$$.    `.`"Y$$$$P"'         Memory: 2040MiB / 19175MiB
 `$$b      "-.__
  `Y$$
   `Y$$.
     `$$b.
       `Y$$b.
          `"Y$b._
              `"""

mike@DESKTOP-OFFICE:~$  . /home/mike/.local/share/virtualenvs/pipenv-3mqHYeJE/bin/activate
(pipenv) mike@DESKTOP-OFFICE:~$ pipenv --support
<details><summary>$ pipenv --support</summary>

Pipenv version: `'2020.6.2'`

Pipenv location: `'/home/mike/.local/lib/python3.8/site-packages/pipenv'`

Python location: `'/usr/local/bin/python3.8'`

Python installations found:

  - `3.8.5`: `/home/mike/.local/share/virtualenvs/pipenv-3mqHYeJE/bin/python3.8`
  - `3.8.5`: `/home/mike/.local/share/virtualenvs/pipenv-3mqHYeJE/bin/python3`
  - `3.8.5`: `/home/mike/.local/share/virtualenvs/pipenv-3mqHYeJE/bin/python3.8`
  - `3.8.5`: `/home/mike/.local/share/virtualenvs/pipenv-3mqHYeJE/bin/python3`
  - `3.8.5`: `/usr/local/bin/python3.8`

PEP 508 Information:

{'implementation_name': 'cpython',
'implementation_version': '3.8.5',
'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.8.5',
'python_version': '3.8',
'sys_platform': 'linux'}


System environment variables:

  - `SHELL`
  - `WSL_DISTRO_NAME`
  - `WT_SESSION`
  - `PIPENV_ACTIVE`
  - `NAME`
  - `PWD`
  - `LOGNAME`
  - `PIP_PYTHON_PATH`
  - `HOME`
  - `LANG`
  - `WSL_INTEROP`
  - `LS_COLORS`
  - `VIRTUAL_ENV`
  - `TERM`
  - `USER`
  - `PIP_DISABLE_PIP_VERSION_CHECK`
  - `SHLVL`
  - `PYTHONDONTWRITEBYTECODE`
  - `PS1`
  - `WSLENV`
  - `PATH`
  - `HOSTTYPE`
  - `WT_PROFILE_ID`
  - `OLDPWD`
  - `_`
  - `PIP_SHIMS_BASE_MODULE`
  - `PYTHONFINDER_IGNORE_UNSUPPORTED`

Pipenv–specific environment variables:

 - `PIPENV_ACTIVE`: `1`

Debug–specific environment variables:

  - `PATH`: `/home/mike/.local/share/virtualenvs/pipenv-3mqHYeJE/bin:/home/mike/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/d/Python/Python38/Scripts/:/mnt/d/Python/Python38/:/mnt/c/Python/Python38/Scripts/:/mnt/c/Python/Python38/:/mnt/c/Program Files (x86)/Common Files/Oracle/Java/javapath:/mnt/c/Program Files/Java/jdk-10.0.1/bin:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/d/Program Files/PuTTY/:/mnt/d/Program Files/Geth:/mnt/c/Program Files (x86)/Windows Kits/8.1/Windows Performance Toolkit/:/mnt/c/Program Files/Calibre2/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/Android:/mnt/c/Program Files/SourceGear/Common/DiffMerge/:/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/Program Files/NVIDIA Corporation/NVIDIA NvDLISR:/mnt/d/Program Files/Apache/apache-maven-3.6.0/bin:/mnt/d/Program Files/Microsoft VS Code/bin:/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/d/Program Files/nodejs/:/mnt/d/Program Files/Git/cmd:/mnt/c/Program Files/dotnet/:/mnt/c/Program Files/Docker/Docker/resources/bin:/mnt/c/ProgramData/DockerDesktop/version-bin:/mnt/c/Program Files (x86)/Elm/0.19.1/bin:/mnt/c/Users/mjnic/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/mjnic/AppData/Local/GitHubDesktop/bin:/mnt/c/Users/mjnic/AppData/Local/atom/bin:/mnt/d/Cryptocurrency/Wallets:/mnt/c/Users/mjnic/AppData/Local/GitHubDesktop/app-1.0.1/resources/app/git/cmd:/mnt/c/Users/mjnic/AppData/Local/Microsoft/WindowsApps:/mnt/d/Anaconda/Library/bin:/mnt/d/Program Files/cmder:/mnt/d/Program Files/cmder/bin:/mnt/d/Program Files (x86)/Nmap:/mnt/c/Users/mjnic/AppData/Roaming/npm:/mnt/d/src/flutter/bin`
  - `SHELL`: `/bin/bash`
  - `LANG`: `en_US.UTF-8`
  - `PWD`: `/home/mike`
  - `VIRTUAL_ENV`: `/home/mike/.local/share/virtualenvs/pipenv-3mqHYeJE`


---------------------------

</details>

@matteius
Copy link
Member

@jthorpe6 Has this been resolved?

@matteius matteius added the OS: Windows This issue affects the Windows Operating System. label Mar 17, 2022
@jthorpe6
Copy link
Author

Hey, I'm unable to test this, as I don't use WSL anymore. I'm happy for it to be closed.

@ividito
Copy link

ividito commented Apr 21, 2022

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 shell command. I wonder if WSL doesn't play nice with pexpect

@matteius matteius reopened this Apr 21, 2022
@matteius
Copy link
Member

matteius commented Jul 5, 2022

@ividito What commands were you running/what Pipfile or other useful context? I have a friend at work that runs pipenv in WSL and I haven't heard of any complaints from him, so I would like to ask for more details to be able to reproduce it.

@ividito
Copy link

ividito commented Jul 7, 2022

@ividito What commands were you running/what Pipfile or other useful context? I have a friend at work that runs pipenv in WSL and I haven't heard of any complaints from him, so I would like to ask for more details to be able to reproduce it.

I've dropped pipenv since I commented, but here's my Pipfile from when I last observed this issue:

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

[dev-packages]

[packages]

[requires]
python_version = "3.7"

I ran into the issue while running pipenv shell . I do still run into this issue with poetry 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.

@matteius matteius closed this as not planned Won't fix, can't repro, duplicate, stale Mar 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS: Windows This issue affects the Windows Operating System. triage
Projects
None yet
Development

No branches or pull requests

4 participants