question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'zsh: killed python' while executing from virtualenv on macOS Big Sur for Python 2.7

See original GitHub issue

zsh: killed python while executing from virtualenv on macOS Big Sur (platform: arm64) for Python 2.7 It is working fine for Python 3.8

Expected result

Python Shell should launch from virtual env shell. On using pipenv sync should install dependencies.

Actual result

zsh: killed python. Python shell is not launched.

Steps to replicate

  1. pipenv install --python 2.7
  2. pipenv shell
  3. python
Using /usr/bin/python2.7 (2.7.16) to create virtualenv...
⠴ Creating virtual environment...created virtual environment CPython2.7.16.final.0-64 in 216ms
  creator CPython2macOsFramework(dest=/Users/ab/.local/share/virtualenvs/demo2-HNdtbnRg, clear=False, global=False)
  seeder FromAppData(download=False, pip=bundle, wheel=bundle, setuptools=bundle, via=copy, app_data_dir=/Users/ab/Library/Application Support/virtualenv)
    added seed packages: pip==20.2.4, setuptools==44.1.1, wheel==0.35.1
  activators PythonActivator,CShellActivator,FishActivator,PowerShellActivator,BashActivator

✔ Successfully created virtual environment! 
Failed to load paths: 
Output: 
Virtualenv location: /Users/ab/.local/share/virtualenvs/demo2-HNdtbnRg
Installing dependencies from Pipfile.lock (3cbc06)...
  🐍   ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 0/0 — 00:00:00
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.
 demo2 % pipenv shell
Launching subshell in virtual environment...
 . /Users/ab/.local/share/virtualenvs/demo2-HNdtbnRg/bin/activate                         
demo2 %  . /Users/ab/.local/share/virtualenvs/demo2-HNdtbnRg/bin/activate
demo2 % python 
zsh: killed     python
demo2 % which python
/Users/ab/.local/share/virtualenvs/demo2-HNdtbnRg/bin/python

This works perfectly fine with if I use pipenv install --python 3.8 See details of platform and Python version below (skipped sys env variables)

$ pipenv --support

Pipenv version: '2020.8.13'

Pipenv location: '/Users/ab/Library/Python/2.7/lib/python/site-packages/pipenv'

Python location: '/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python'

Python installations found:

  • 3.8.2: /usr/bin/python3
  • 2.7.16: /usr/bin/python2.7
  • 2.7.16: /usr/bin/python2

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '0',
 'os_name': 'posix',
 'platform_machine': 'arm64',
 'platform_python_implementation': 'CPython',
 'platform_release': '20.0.0',
 'platform_system': 'Darwin',
 'platform_version': 'Darwin Kernel Version 20.0.0: Fri Aug 14 00:25:08 PDT 2020; root:xnu-7195.40.44.151.1~4/RELEASE_ARM64_T8020',
 'python_full_version': '2.7.16',
 'python_version': '2.7',
 'sys_platform': 'darwin'}

Pipenv–specific environment variables:

Debug–specific environment variables:

  • PATH: /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Users/ab/Library/Python/2.7/bin
  • SHELL: /bin/zsh
  • LANG: en_US.UTF-8

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:6
  • Comments:36 (2 by maintainers)

github_iconTop GitHub Comments

43reactions
lykhatskyicommented, Feb 23, 2021

solution:

cd ~/.virtualenvs/<your venv name here>/bin
mkdir bk; cp python bk; mv -f bk/python .;rmdir bk
codesign -s - --preserve-metadata=identifier,entitlements,flags,runtime -f python
4reactions
ADVALAKIcommented, Jul 1, 2021

If you are on Apple M1, mac sure open terminal with Rosetta enabled. it will works fine.

Read more comments on GitHub >

github_iconTop Results From Across the Web

killed python' while executing python from Pipenv virtualenv ...
'zsh: killed python' while executing python from Pipenv virtualenv on macOS Big Sur for Python 2.7 · Big Sur version is 11.0 Beta...
Read more >
'zsh: killed python' while executing from virtualenv on macOS ...
zsh : killed python while executing from virtualenv on macOS Big Sur (platform: arm64) for Python 2.7. It is working fine for Python...
Read more >
Pip Is Getting Killed In A Specifc Python Env - ADocLib
pipenv creates a virtualenv named PROJECTDIR<someid>. 'zsh: killed python' while executing from virtualenv on macOS Big Sur for Python 2.7 hot 14.
Read more >
Apple removes Python 2.7 in macOS 12.3 beta - Hacker News
I'm a big fan of Python, but I hope they remove ALL Python from the OS itself. ... venv and installing your dependencies...
Read more >
DSS Startup failed on MacOS 11 Big Sur - Dataiku Community
I've found workaround: 1. Reinstall DSS (may be it works without reinstall but I did it in my case) 2. You will get...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found