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 --venv' results in subprocess.CalledProcessError #3109

Closed
kylemart opened this Issue Oct 27, 2018 · 5 comments

Comments

Projects
None yet
4 participants
@kylemart

kylemart commented Oct 27, 2018

Here is a link to the original issue: Microsoft/vscode-python#2968. It should contain all of the information required for this bug report.

In short, VS Code executes pipenv --venv behind the scenes when opening a Python project containing a Pipfile. For some reason, this is resulting in an error. I cannot reproduce this issue outside of VS Code...


Environment data

  • VS Code version: 1.28.2 (7f3ce96ff4729c91352ae6def877e59c561f4850)
  • Extension version (available under the Extensions sidebar): 2018.9.1
  • OS and version: macOS 10.14
  • Python version (& distribution if applicable, e.g. Anaconda): 3.7.0
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): pipenv

Actual behavior

Upon opening a project folder with an existing virtual environment, I get the following error message:

Workspace contains pipfile but attempt to run 'pipenv --venv' failed with 'Traceback (most recent call last):
  File "/usr/local/bin/pipenv", line 7, in <module>
    from pipenv import cli
  File "/usr/local/lib/python3.7/site-packages/pipenv/__init__.py", line 23, in <module>
    from .cli import cli
  File "/usr/local/lib/python3.7/site-packages/pipenv/cli/__init__.py", line 3, in <module>
    from .command import cli
  File "/usr/local/lib/python3.7/site-packages/pipenv/cli/command.py", line 7, in <module>
    import crayons
  File "/usr/local/lib/python3.7/site-packages/pipenv/patched/crayons.py", line 49, in <module>
    is_powershell = "powershell" in shellingham.detect_shell()[0]
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/shellingham/__init__.py", line 22, in detect_shell
    shell = get_shell(pid, max_depth=max_depth)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/shellingham/posix/__init__.py", line 54, in get_shell
    mapping = _get_process_mapping()
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/shellingham/posix/__init__.py", line 15, in _get_process_mapping
    mapping = impl.get_process_mapping()
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/shellingham/posix/ps.py", line 18, in get_process_mapping
    'ps', '-ww', '-o', 'pid=', '-o', 'ppid=', '-o', 'args=',
  File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 376, in check_output
    **kwargs).stdout
  File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 468, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['ps', '-ww', '-o', 'pid=', '-o', 'ppid=', '-o', 'args=']' returned non-zero exit status 1.'. Make sure pipenv is on the PATH.

Expected behavior

No error message.

Steps to reproduce:

  1. Create directory.
  2. Run pipenv install in the directory.
  3. Open the directory in VS Code.

Please run $ pipenv --support, and paste the results here.

$ pipenv --support

Pipenv version: '2018.10.13'

Pipenv location: '/Users/kylemart/Library/Python/3.7/lib/python/site-packages/pipenv'

Python location: '/usr/local/opt/python/bin/python3.7'

Python installations found:

  • 3.7.0: /usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/bin/python3.7
  • 3.7.0: /usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/bin/python3.7m
  • 2.7.15: /usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/bin/python2.7
  • 2.7.10: /usr/bin/python
  • 2.7.10: /usr/bin/pythonw
  • 2.7.10: /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.7.0',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '18.0.0',
 'platform_system': 'Darwin',
 'platform_version': 'Darwin Kernel Version 18.0.0: Wed Aug 22 20:13:40 PDT '
                     '2018; root:xnu-4903.201.2~1/RELEASE_X86_64',
 'python_full_version': '3.7.0',
 'python_version': '3.7',
 'sys_platform': 'darwin'}

System environment variables:

  • TERM_SESSION_ID
  • SSH_AUTH_SOCK
  • Apple_PubSub_Socket_Render
  • COLORFGBG
  • ITERM_PROFILE
  • SQLITE_EXEMPT_PATH_FROM_VNODE_GUARDS
  • XPC_FLAGS
  • LANG
  • PWD
  • SHELL
  • TERM_PROGRAM_VERSION
  • TERM_PROGRAM
  • PATH
  • COLORTERM
  • TERM
  • HOME
  • TMPDIR
  • USER
  • XPC_SERVICE_NAME
  • LOGNAME
  • __CF_USER_TEXT_ENCODING
  • ITERM_SESSION_ID
  • SHLVL
  • OLDPWD
  • PROMPT_EOL_MARK
  • _
  • PYTHONDONTWRITEBYTECODE
  • PIP_SHIMS_BASE_MODULE
  • PIP_PYTHON_PATH

Pipenv–specific environment variables:

Debug–specific environment variables:

  • PATH: /Users/kylemart/Library/Python/3.7/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware Fusion.app/Contents/Public:/Library/TeX/texbin:/usr/local/share/dotnet:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Applications/Xamarin Workbooks.app/Contents/SharedSupport/path-bin
  • SHELL: /usr/local/bin/zsh
  • LANG: en_US.UTF-8
  • PWD: /Users/kylemart

@devxpy

This comment has been minimized.

Contributor

devxpy commented Oct 27, 2018

Unrelated question - what's the performance like on your machine? I opened master on vscode, and it started lagging horribly. I can't even edit a single file.

OTOH Sublime seems to work very smoothly.

@kylemart kylemart changed the title from VS Code - Workspace contains pipfile but attempt to run 'pipenv --venv' failed to subprocess.CalledProcessError: Command '['ps', '-ww', '-o', 'pid=', '-o', 'ppid=', '-o', 'args=']' Oct 28, 2018

@kylemart

This comment has been minimized.

kylemart commented Oct 28, 2018

Unrelated question - what's the performance like on your machine? I opened master on vscode, and it started lagging horribly. I can't even edit a single file.

OTOH Sublime seems to work very smoothly.

In term of performance, VS Code actually runs very smoothly!

@kylemart kylemart changed the title from subprocess.CalledProcessError: Command '['ps', '-ww', '-o', 'pid=', '-o', 'ppid=', '-o', 'args=']' to 'pipenv --venv' results in subprocess.CalledProcessError Oct 28, 2018

@techalchemy

This comment has been minimized.

Member

techalchemy commented Oct 29, 2018

Hmmm that’s a new one. Looks like a shellingham bug. /cc @uranusjr

@uranusjr

This comment has been minimized.

Member

uranusjr commented Oct 29, 2018

What happens if you run ps -ww -o pid= -o ppid= -o args= (basically the failing command itself) directly?

@uranusjr

This comment has been minimized.

Member

uranusjr commented Oct 29, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment