WSL: pipenv shell does not launch a subshell
See original GitHub issueIssue description
WSL on Windows 10 with Ubuntu 18.04 On WSL the command ‘pipenv shell’ does not launch a subshell or activate the environment. Due to #3488, I had to uninstall all Windows versions of Python to have success at creating the environment.
Expected result
Launching subshell in virtual environment…
(env-setup) mfaine@MSSLW17050462:/mnt/c/Users/mfaine/Desktop/env-setup$
Actual result
Launching subshell in virtual environment…
mfaine@MSSLW17050462:/mnt/c/Users/mfaine/Desktop/env-setup$
Typing exit here will close the terminal. It is possible to to manually activate the environment without launching a subshell with:
source $(pipenv --venv)/bin/activate
Steps to replicate
Pipfile:
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
[packages]
[requires]
python_version = "2.7"
Expected result
mfaine@MSSLW17050462:/mnt/c/Users/mfaine/Desktop/env-setup$ pipenv install
Creating a virtualenv for this project…
Pipfile: /mnt/c/Users/mfaine/Desktop/env-setup/Pipfile
Using /usr/bin/python2.7 (2.7.15rc1) to create virtualenv…
⠏ Creating virtual environment...New python executable in /home/mfaine/.local/share/virtualenvs/env-setup-tPXXVp16/bin/python2.7
Also creating executable in /home/mfaine/.local/share/virtualenvs/env-setup-tPXXVp16/bin/python
Installing setuptools, pip, wheel...
done.
Running virtualenv with interpreter /usr/bin/python2.7
✔ Successfully created virtual environment!
Virtualenv location: /home/mfaine/.local/share/virtualenvs/env-setup-tPXXVp16
Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
Updated Pipfile.lock (dfae9f)!
Installing dependencies from Pipfile.lock (dfae9f)…
🐍 ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 0/0 — 00:00:00
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.
mfaine@MSSLW17050462:/mnt/c/Users/mfaine/Desktop/env-setup$ pipenv shell
Launching subshell in virtual environment…
(env-setup) mfaine@MSSLW17050462:/mnt/c/Users/mfaine/Desktop/env-setup$
-------------------------------------------------------------------------------
$ pipenv --support
Pipenv version: '2018.11.26'
Pipenv location: '/home/mfaine/.local/lib/python3.6/site-packages/pipenv'
Python location: '/usr/bin/python3'
Python installations found:
3.6.7:/usr/bin/python33.6.7:/usr/bin/python3.6m2.7.15rc1:/usr/bin/python
PEP 508 Information:
{'implementation_name': 'cpython',
'implementation_version': '3.6.7',
'os_name': 'posix',
'platform_machine': 'x86_64',
'platform_python_implementation': 'CPython',
'platform_release': '4.4.0-43-Microsoft',
'platform_system': 'Linux',
'platform_version': '#1-Microsoft Wed Dec 31 14:42:53 PST 2014',
'python_full_version': '3.6.7',
'python_version': '3.6',
'sys_platform': 'linux'}
System environment variables:
LS_COLORSHOSTTYPELESSCLOSELANGUSERPWDHOMENAMESHELLTERMSHLVLLOGNAMEPATHLESSOPEN_PIP_DISABLE_PIP_VERSION_CHECKPYTHONDONTWRITEBYTECODEPIP_SHIMS_BASE_MODULEPIP_PYTHON_PATHPYTHONFINDER_IGNORE_UNSUPPORTED
Pipenv–specific environment variables:
Debug–specific environment variables:
PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/ProgramData/scoop/shims:/mnt/c/Windows:/mnt/c/Windows/System32:/mnt/c/Windows/System32/wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0:/mnt/c/Oracle/product/12.2.0/client_1/bin:/mnt/c/Program Files (x86)/Common Files/Oracle/Java/javapath_target_1966171:/mnt/c/Program Files/Microsoft Network Monitor 3:/mnt/c/Program Files (x86)/HID Global/ActivClient:/mnt/c/Program Files/HID Global/ActivClient:/mnt/c/Program Files/Intel/WiFi/bin:/mnt/c/Program Files/Common Files/Intel/WirelessCommon:/mnt/c/ProgramData/Oracle/Java/javapath_target_152566531:/mnt/c/Program Files/nodejs:/mnt/c/Program Files (x86)/Sennheiser/SoftphoneSDK:/mnt/c/Program Files (x86)/GnuPG/bin:/mnt/c/Program Files/PuTTY:/mnt/c/Vagrant/bin:/mnt/c/Program Files/Git/cmd:/mnt/c/Program Files (x86)/Microsoft SDKs/Azure/CLI2/wbin:/mnt/c/Program Files (x86)/Windows Kits/10/Windows Performance Toolkit:/mnt/c/Program Files (x86)/Windows Kits/10/Microsoft Application Virtualization/Sequencer:/mnt/c/Users/mfaine/scoop/shims:/mnt/c/Users/mfaine/AppData/Local/Microsoft/WindowsApps:/mnt/c/Program Files/Intel/WiFi/bin:/mnt/c/Program Files/Common Files/Intel/WirelessCommon:/mnt/c/Users/mfaine/AppData/Roaming/npm:/mnt/c/Users/mfaine/AppData/Local/Programs/Microsoft VS Code Insiders/bin:/mnt/c/Program Files/Oracle/VirtualBox:/home/mfaine/.local/binSHELL:/bin/bashLANG:en_US.UTF-8PWD:/mnt/c/Users/mfaine/Desktop/env-setup
Contents of Pipfile (‘/mnt/c/Users/mfaine/Desktop/env-setup/Pipfile’):
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
[packages]
[requires]
python_version = "2.7"
Contents of Pipfile.lock (‘/mnt/c/Users/mfaine/Desktop/env-setup/Pipfile.lock’):
{
"_meta": {
"hash": {
"sha256": "ae4bdd7d4157baab65ae9d0e8389a6011e6b640995372c45ec81fa5d1ddfae9f"
},
"pipfile-spec": 6,
"requires": {
"python_version": "2.7"
},
"sources": [
{
"name": "pypi",
"url": "https://pypi.org/simple",
"verify_ssl": true
}
]
},
"default": {},
"develop": {}
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (2 by maintainers)

Top Related StackOverflow Question
pipenv shellhas always worked as it should for me on WSL, with or without python installed in Windows, on three different computers.@bromps I ‘solved’ it by recreating the environment with the WSL’s interpreter as was suggested, as I’m already using
pipenv2020.11.4.