pyenv / pyenv-virtualenv

a pyenv plugin to manage virtualenv (a.k.a. python-virtualenv)
MIT License
6.37k stars 403 forks source link

Segmentation fault when using any pip command in 3.6.15 #410

Closed abhinavsp0730 closed 3 years ago

abhinavsp0730 commented 3 years ago

while using any pip command I'm getting

/home/neurlap/.pyenv/plugins/pyenv-pip-rehash/libexec/pip: line 20: 24753 Segmentation fault      (core dumped) "$PYENV_COMMAND_PATH" "$@"

@native-api any help?

native-api commented 3 years ago

I've no idea what that "pyenv-pip-rehash" plugin is. https://github.com/pyenv/pyenv-pip-rehash#readme says it's no longer needed.

abhinavsp0730 commented 3 years ago

It says we don't need to install this plugin anymore. It comes with pyenv-virtualenv

evrenesat commented 3 years ago

I'm getting the same error, but with the included pip-rehash: /home/username/.pyenv/pyenv.d/exec/pip-rehash/pip: line 20: 43331 Segmentation fault (core dumped) "$PYENV_COMMAND_PATH" "$@"

Somehow I managed to fix it by not providing a name for the virtualenv I'm creating. So this ends up with pip/python mismatch and seg.fault:

pyenv virtualenv -f 3.6.15 env_name

But this one works:

pyenv virtualenv -f 3.6.15

Not sure if -f helps or not, I stopped experimenting after solving my problem.

Edit: I was wrong, when I don't provide a name, it incorrectly creates the environment using Python 3.10 then the pip matches with the python.

click to see the debug output, in case if it helps ``` $ pyenv versions system 3.10.0 * 3.10.0/envs/3.6.15 (set by /home/evren/eiq/backend/.python-version) 3.6.15 $ PYENV_DEBUG=1 pip3.6 + program=pip3.6 + export PYENV_ROOT=/home/evren/.pyenv + PYENV_ROOT=/home/evren/.pyenv + exec /home/evren/.pyenv/libexec/pyenv exec pip3.6 +(/home/evren/.pyenv/libexec/pyenv:23): enable -f /home/evren/.pyenv/libexec/../libexec/pyenv-realpath.dylib realpath +(/home/evren/.pyenv/libexec/pyenv:30): '[' -z '' ']' ++(/home/evren/.pyenv/libexec/pyenv:32): type -P greadlink readlink ++(/home/evren/.pyenv/libexec/pyenv:32): head -1 +(/home/evren/.pyenv/libexec/pyenv:32): READLINK=/usr/bin/readlink +(/home/evren/.pyenv/libexec/pyenv:33): '[' -n /usr/bin/readlink ']' +(/home/evren/.pyenv/libexec/pyenv:58): '[' -z /home/evren/.pyenv ']' +(/home/evren/.pyenv/libexec/pyenv:61): PYENV_ROOT=/home/evren/.pyenv +(/home/evren/.pyenv/libexec/pyenv:63): export PYENV_ROOT +(/home/evren/.pyenv/libexec/pyenv:65): '[' -z '' ']' +(/home/evren/.pyenv/libexec/pyenv:66): PYENV_DIR=/home/evren/eiq/backend +(/home/evren/.pyenv/libexec/pyenv:69): '[' '!' -d /home/evren/eiq/backend ']' +(/home/evren/.pyenv/libexec/pyenv:69): '[' '!' -e /home/evren/eiq/backend ']' ++(/home/evren/.pyenv/libexec/pyenv:73): cd /home/evren/eiq/backend ++(/home/evren/.pyenv/libexec/pyenv:73): echo /home/evren/eiq/backend +(/home/evren/.pyenv/libexec/pyenv:73): PYENV_DIR=/home/evren/eiq/backend +(/home/evren/.pyenv/libexec/pyenv:74): export PYENV_DIR +(/home/evren/.pyenv/libexec/pyenv:77): shopt -s nullglob ++(/home/evren/.pyenv/libexec/pyenv:79): abs_dirname /home/evren/.pyenv/libexec/pyenv ++(/home/evren/.pyenv/libexec/pyenv:40): abs_dirname(): local path=/home/evren/.pyenv/libexec/pyenv ++(/home/evren/.pyenv/libexec/pyenv:44): abs_dirname(): '[' -n /home/evren/.pyenv/libexec/pyenv ']' ++(/home/evren/.pyenv/libexec/pyenv:45): abs_dirname(): cd_path=/home/evren/.pyenv/libexec ++(/home/evren/.pyenv/libexec/pyenv:46): abs_dirname(): [[ /home/evren/.pyenv/libexec != \/\h\o\m\e\/\e\v\r\e\n\/\.\p\y\e\n\v\/\l\i\b\e\x\e\c\/\p\y\e\n\v ]] ++(/home/evren/.pyenv/libexec/pyenv:47): abs_dirname(): cd /home/evren/.pyenv/libexec ++(/home/evren/.pyenv/libexec/pyenv:49): abs_dirname(): name=pyenv +++(/home/evren/.pyenv/libexec/pyenv:50): abs_dirname(): resolve_link pyenv +++(/home/evren/.pyenv/libexec/pyenv:36): resolve_link(): /usr/bin/readlink pyenv +++(/home/evren/.pyenv/libexec/pyenv:50): abs_dirname(): true ++(/home/evren/.pyenv/libexec/pyenv:50): abs_dirname(): path= ++(/home/evren/.pyenv/libexec/pyenv:44): abs_dirname(): '[' -n '' ']' ++(/home/evren/.pyenv/libexec/pyenv:53): abs_dirname(): echo /home/evren/.pyenv/libexec +(/home/evren/.pyenv/libexec/pyenv:79): bin_path=/home/evren/.pyenv/libexec +(/home/evren/.pyenv/libexec/pyenv:80): for plugin_bin in "${bin_path%/*}"/plugins/*/bin +(/home/evren/.pyenv/libexec/pyenv:81): PATH=/home/evren/.pyenv/plugins/pyenv-virtualenv/bin:/home/evren/.pyenv/plugins/pyenv-virtualenv/shims:/home/evren/.pyenv/shims:/home/evren/.pyenv/bin:/home/evren/.local/bin:/home/evren/.pyenv/plugins/pyenv-virtualenv/shims:/home/evren/.pyenv/plugins/pyenv-virtualenv/shims:/home/evren/.pyenv/shims:/home/evren/.pyenv/bin:/home/evren/.local/bin:/home/evren/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin +(/home/evren/.pyenv/libexec/pyenv:80): for plugin_bin in "${bin_path%/*}"/plugins/*/bin +(/home/evren/.pyenv/libexec/pyenv:81): PATH=/home/evren/.pyenv/plugins/python-build/bin:/home/evren/.pyenv/plugins/pyenv-virtualenv/bin:/home/evren/.pyenv/plugins/pyenv-virtualenv/shims:/home/evren/.pyenv/shims:/home/evren/.pyenv/bin:/home/evren/.local/bin:/home/evren/.pyenv/plugins/pyenv-virtualenv/shims:/home/evren/.pyenv/plugins/pyenv-virtualenv/shims:/home/evren/.pyenv/shims:/home/evren/.pyenv/bin:/home/evren/.local/bin:/home/evren/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin +(/home/evren/.pyenv/libexec/pyenv:85): '[' /home/evren/.pyenv '!=' /home/evren/.pyenv ']' +(/home/evren/.pyenv/libexec/pyenv:90): export PATH=/home/evren/.pyenv/libexec:/home/evren/.pyenv/plugins/python-build/bin:/home/evren/.pyenv/plugins/pyenv-virtualenv/bin:/home/evren/.pyenv/plugins/pyenv-virtualenv/shims:/home/evren/.pyenv/shims:/home/evren/.pyenv/bin:/home/evren/.local/bin:/home/evren/.pyenv/plugins/pyenv-virtualenv/shims:/home/evren/.pyenv/plugins/pyenv-virtualenv/shims:/home/evren/.pyenv/shims:/home/evren/.pyenv/bin:/home/evren/.local/bin:/home/evren/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin +(/home/evren/.pyenv/libexec/pyenv:90): PATH=/home/evren/.pyenv/libexec:/home/evren/.pyenv/plugins/python-build/bin:/home/evren/.pyenv/plugins/pyenv-virtualenv/bin:/home/evren/.pyenv/plugins/pyenv-virtualenv/shims:/home/evren/.pyenv/shims:/home/evren/.pyenv/bin:/home/evren/.local/bin:/home/evren/.pyenv/plugins/pyenv-virtualenv/shims:/home/evren/.pyenv/plugins/pyenv-virtualenv/shims:/home/evren/.pyenv/shims:/home/evren/.pyenv/bin:/home/evren/.local/bin:/home/evren/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin +(/home/evren/.pyenv/libexec/pyenv:92): PYENV_HOOK_PATH=:/home/evren/.pyenv/pyenv.d +(/home/evren/.pyenv/libexec/pyenv:93): '[' /home/evren/.pyenv '!=' /home/evren/.pyenv ']' +(/home/evren/.pyenv/libexec/pyenv:97): PYENV_HOOK_PATH=:/home/evren/.pyenv/pyenv.d:/usr/local/etc/pyenv.d:/etc/pyenv.d:/usr/lib/pyenv/hooks +(/home/evren/.pyenv/libexec/pyenv:98): for plugin_hook in "${PYENV_ROOT}/plugins/"*/etc/pyenv.d +(/home/evren/.pyenv/libexec/pyenv:99): PYENV_HOOK_PATH=:/home/evren/.pyenv/pyenv.d:/usr/local/etc/pyenv.d:/etc/pyenv.d:/usr/lib/pyenv/hooks:/home/evren/.pyenv/plugins/pyenv-virtualenv/etc/pyenv.d +(/home/evren/.pyenv/libexec/pyenv:101): PYENV_HOOK_PATH=/home/evren/.pyenv/pyenv.d:/usr/local/etc/pyenv.d:/etc/pyenv.d:/usr/lib/pyenv/hooks:/home/evren/.pyenv/plugins/pyenv-virtualenv/etc/pyenv.d +(/home/evren/.pyenv/libexec/pyenv:102): export PYENV_HOOK_PATH +(/home/evren/.pyenv/libexec/pyenv:104): shopt -u nullglob +(/home/evren/.pyenv/libexec/pyenv:107): command=exec +(/home/evren/.pyenv/libexec/pyenv:108): case "$command" in ++(/home/evren/.pyenv/libexec/pyenv:121): command -v pyenv-exec +(/home/evren/.pyenv/libexec/pyenv:121): command_path=/home/evren/.pyenv/libexec/pyenv-exec +(/home/evren/.pyenv/libexec/pyenv:122): '[' -z /home/evren/.pyenv/libexec/pyenv-exec ']' +(/home/evren/.pyenv/libexec/pyenv:130): shift 1 +(/home/evren/.pyenv/libexec/pyenv:131): '[' pip3.6 = --help ']' +(/home/evren/.pyenv/libexec/pyenv:138): exec /home/evren/.pyenv/libexec/pyenv-exec pip3.6 +(/home/evren/.pyenv/libexec/pyenv-exec:20): '[' pip3.6 = --complete ']' ++(/home/evren/.pyenv/libexec/pyenv-exec:24): pyenv-version-name +(/home/evren/.pyenv/libexec/pyenv-version-name:6): '[' -z '' ']' ++(/home/evren/.pyenv/libexec/pyenv-version-name:7): pyenv-version-file +(/home/evren/.pyenv/libexec/pyenv-version-file:7): target_dir= +(/home/evren/.pyenv/libexec/pyenv-version-file:22): '[' -n '' ']' +(/home/evren/.pyenv/libexec/pyenv-version-file:25): find_local_version_file /home/evren/eiq/backend +(/home/evren/.pyenv/libexec/pyenv-version-file:10): find_local_version_file(): local root=/home/evren/eiq/backend +(/home/evren/.pyenv/libexec/pyenv-version-file:11): find_local_version_file(): [[ /home/evren/eiq/backend =~ ^//[^/]*$ ]] +(/home/evren/.pyenv/libexec/pyenv-version-file:12): find_local_version_file(): '[' -f /home/evren/eiq/backend/.python-version ']' +(/home/evren/.pyenv/libexec/pyenv-version-file:13): find_local_version_file(): echo /home/evren/eiq/backend/.python-version +(/home/evren/.pyenv/libexec/pyenv-version-file:14): find_local_version_file(): return 0 +(/home/evren/.pyenv/libexec/pyenv-version-name:7): PYENV_VERSION_FILE=/home/evren/eiq/backend/.python-version ++(/home/evren/.pyenv/libexec/pyenv-version-name:8): pyenv-version-file-read /home/evren/eiq/backend/.python-version +(/home/evren/.pyenv/libexec/pyenv-version-file-read:6): VERSION_FILE=/home/evren/eiq/backend/.python-version +(/home/evren/.pyenv/libexec/pyenv-version-file-read:8): '[' -e /home/evren/eiq/backend/.python-version ']' +(/home/evren/.pyenv/libexec/pyenv-version-file-read:11): IFS=' ' +(/home/evren/.pyenv/libexec/pyenv-version-file-read:12): words=($(cut -b 1-1024 "$VERSION_FILE" | sed -n 's/^[[:space:]]*\([^[:space:]#][^[:space:]]*\).*/\1/p')) ++(/home/evren/.pyenv/libexec/pyenv-version-file-read:12): cut -b 1-1024 /home/evren/eiq/backend/.python-version ++(/home/evren/.pyenv/libexec/pyenv-version-file-read:12): sed -n 's/^[[:space:]]*\([^[:space:]#][^[:space:]]*\).*/\1/p' +(/home/evren/.pyenv/libexec/pyenv-version-file-read:13): versions=("${words[@]}") +(/home/evren/.pyenv/libexec/pyenv-version-file-read:15): '[' -n eiq ']' +(/home/evren/.pyenv/libexec/pyenv-version-file-read:16): IFS=: +(/home/evren/.pyenv/libexec/pyenv-version-file-read:17): echo eiq +(/home/evren/.pyenv/libexec/pyenv-version-file-read:18): exit +(/home/evren/.pyenv/libexec/pyenv-version-name:8): PYENV_VERSION=eiq +(/home/evren/.pyenv/libexec/pyenv-version-name:11): OLDIFS=' ' +(/home/evren/.pyenv/libexec/pyenv-version-name:12): IFS=' ' +(/home/evren/.pyenv/libexec/pyenv-version-name:12): scripts=(`pyenv-hooks version-name`) ++(/home/evren/.pyenv/libexec/pyenv-version-name:12): pyenv-hooks version-name +(/home/evren/.pyenv/libexec/pyenv-hooks:9): '[' version-name = --complete ']' +(/home/evren/.pyenv/libexec/pyenv-hooks:18): PYENV_COMMAND=version-name +(/home/evren/.pyenv/libexec/pyenv-hooks:19): '[' -z version-name ']' +(/home/evren/.pyenv/libexec/pyenv-hooks:24): enable -f /home/evren/.pyenv/libexec/pyenv-realpath.dylib realpath +(/home/evren/.pyenv/libexec/pyenv-hooks:25): '[' -n '' ']' ++(/home/evren/.pyenv/libexec/pyenv-hooks:29): type -P greadlink readlink ++(/home/evren/.pyenv/libexec/pyenv-hooks:29): head -1 +(/home/evren/.pyenv/libexec/pyenv-hooks:29): READLINK=/usr/bin/readlink +(/home/evren/.pyenv/libexec/pyenv-hooks:30): '[' -z /usr/bin/readlink ']' +(/home/evren/.pyenv/libexec/pyenv-hooks:55): IFS=: +(/home/evren/.pyenv/libexec/pyenv-hooks:55): hook_paths=($PYENV_HOOK_PATH) +(/home/evren/.pyenv/libexec/pyenv-hooks:57): shopt -s nullglob +(/home/evren/.pyenv/libexec/pyenv-hooks:58): for path in "${hook_paths[@]}" +(/home/evren/.pyenv/libexec/pyenv-hooks:58): for path in "${hook_paths[@]}" +(/home/evren/.pyenv/libexec/pyenv-hooks:58): for path in "${hook_paths[@]}" +(/home/evren/.pyenv/libexec/pyenv-hooks:58): for path in "${hook_paths[@]}" +(/home/evren/.pyenv/libexec/pyenv-hooks:58): for path in "${hook_paths[@]}" +(/home/evren/.pyenv/libexec/pyenv-hooks:63): shopt -u nullglob +(/home/evren/.pyenv/libexec/pyenv-version-name:13): IFS=' ' +(/home/evren/.pyenv/libexec/pyenv-version-name:18): '[' -z eiq ']' +(/home/evren/.pyenv/libexec/pyenv-version-name:18): '[' eiq = system ']' +(/home/evren/.pyenv/libexec/pyenv-version-name:28): versions=() +(/home/evren/.pyenv/libexec/pyenv-version-name:29): OLDIFS=' ' +(/home/evren/.pyenv/libexec/pyenv-version-name:30): IFS=: +(/home/evren/.pyenv/libexec/pyenv-version-name:31): any_not_installed=0 +(/home/evren/.pyenv/libexec/pyenv-version-name:32): for version in ${PYENV_VERSION} +(/home/evren/.pyenv/libexec/pyenv-version-name:33): version_exists eiq +(/home/evren/.pyenv/libexec/pyenv-version-name:24): version_exists(): local version=eiq +(/home/evren/.pyenv/libexec/pyenv-version-name:25): version_exists(): '[' -d /home/evren/.pyenv/versions/eiq ']' +(/home/evren/.pyenv/libexec/pyenv-version-name:34): versions=("${versions[@]}" "${version}") +(/home/evren/.pyenv/libexec/pyenv-version-name:43): IFS=' ' +(/home/evren/.pyenv/libexec/pyenv-version-name:45): OLDIFS=' ' +(/home/evren/.pyenv/libexec/pyenv-version-name:46): IFS=: +(/home/evren/.pyenv/libexec/pyenv-version-name:47): echo eiq +(/home/evren/.pyenv/libexec/pyenv-version-name:49): IFS=' ' +(/home/evren/.pyenv/libexec/pyenv-version-name:51): '[' 0 = 1 ']' +(/home/evren/.pyenv/libexec/pyenv-exec:24): PYENV_VERSION=eiq +(/home/evren/.pyenv/libexec/pyenv-exec:25): PYENV_COMMAND=pip3.6 +(/home/evren/.pyenv/libexec/pyenv-exec:27): '[' -z pip3.6 ']' +(/home/evren/.pyenv/libexec/pyenv-exec:32): export PYENV_VERSION ++(/home/evren/.pyenv/libexec/pyenv-exec:33): pyenv-which pip3.6 +(/home/evren/.pyenv/libexec/pyenv-which:17): '[' pip3.6 = --complete ']' +(/home/evren/.pyenv/libexec/pyenv-which:21): '[' '' = --nosystem ']' +(/home/evren/.pyenv/libexec/pyenv-which:24): system=system +(/home/evren/.pyenv/libexec/pyenv-which:39): PYENV_COMMAND=pip3.6 +(/home/evren/.pyenv/libexec/pyenv-which:41): '[' -z pip3.6 ']' +(/home/evren/.pyenv/libexec/pyenv-which:46): OLDIFS=' ' +(/home/evren/.pyenv/libexec/pyenv-which:47): IFS=: +(/home/evren/.pyenv/libexec/pyenv-which:47): versions=(${PYENV_VERSION:-$(pyenv-version-name)}) +(/home/evren/.pyenv/libexec/pyenv-which:48): IFS=' ' +(/home/evren/.pyenv/libexec/pyenv-which:50): for version in "${versions[@]}" "$system" +(/home/evren/.pyenv/libexec/pyenv-which:51): '[' eiq = system ']' +(/home/evren/.pyenv/libexec/pyenv-which:55): PYENV_COMMAND_PATH=/home/evren/.pyenv/versions/eiq/bin/pip3.6 +(/home/evren/.pyenv/libexec/pyenv-which:57): '[' -x /home/evren/.pyenv/versions/eiq/bin/pip3.6 ']' +(/home/evren/.pyenv/libexec/pyenv-which:58): break +(/home/evren/.pyenv/libexec/pyenv-which:62): OLDIFS=' ' +(/home/evren/.pyenv/libexec/pyenv-which:63): IFS=' ' +(/home/evren/.pyenv/libexec/pyenv-which:63): scripts=(`pyenv-hooks which`) ++(/home/evren/.pyenv/libexec/pyenv-which:63): pyenv-hooks which +(/home/evren/.pyenv/libexec/pyenv-hooks:9): '[' which = --complete ']' +(/home/evren/.pyenv/libexec/pyenv-hooks:18): PYENV_COMMAND=which +(/home/evren/.pyenv/libexec/pyenv-hooks:19): '[' -z which ']' +(/home/evren/.pyenv/libexec/pyenv-hooks:24): enable -f /home/evren/.pyenv/libexec/pyenv-realpath.dylib realpath +(/home/evren/.pyenv/libexec/pyenv-hooks:25): '[' -n '' ']' ++(/home/evren/.pyenv/libexec/pyenv-hooks:29): type -P greadlink readlink ++(/home/evren/.pyenv/libexec/pyenv-hooks:29): head -1 +(/home/evren/.pyenv/libexec/pyenv-hooks:29): READLINK=/usr/bin/readlink +(/home/evren/.pyenv/libexec/pyenv-hooks:30): '[' -z /usr/bin/readlink ']' +(/home/evren/.pyenv/libexec/pyenv-hooks:55): IFS=: +(/home/evren/.pyenv/libexec/pyenv-hooks:55): hook_paths=($PYENV_HOOK_PATH) +(/home/evren/.pyenv/libexec/pyenv-hooks:57): shopt -s nullglob +(/home/evren/.pyenv/libexec/pyenv-hooks:58): for path in "${hook_paths[@]}" +(/home/evren/.pyenv/libexec/pyenv-hooks:58): for path in "${hook_paths[@]}" +(/home/evren/.pyenv/libexec/pyenv-hooks:58): for path in "${hook_paths[@]}" +(/home/evren/.pyenv/libexec/pyenv-hooks:58): for path in "${hook_paths[@]}" +(/home/evren/.pyenv/libexec/pyenv-hooks:58): for path in "${hook_paths[@]}" +(/home/evren/.pyenv/libexec/pyenv-hooks:59): for script in "$path/$PYENV_COMMAND"/*.bash +(/home/evren/.pyenv/libexec/pyenv-hooks:60): realpath /home/evren/.pyenv/plugins/pyenv-virtualenv/etc/pyenv.d/which/conda.bash +(/home/evren/.pyenv/libexec/pyenv-hooks:40): realpath(): local path=/home/evren/.pyenv/plugins/pyenv-virtualenv/etc/pyenv.d/which/conda.bash +(/home/evren/.pyenv/libexec/pyenv-hooks:41): realpath(): local name +(/home/evren/.pyenv/libexec/pyenv-hooks:44): realpath(): '[' -n /home/evren/.pyenv/plugins/pyenv-virtualenv/etc/pyenv.d/which/conda.bash ']' +(/home/evren/.pyenv/libexec/pyenv-hooks:45): realpath(): name=conda.bash +(/home/evren/.pyenv/libexec/pyenv-hooks:46): realpath(): '[' conda.bash = /home/evren/.pyenv/plugins/pyenv-virtualenv/etc/pyenv.d/which/conda.bash ']' +(/home/evren/.pyenv/libexec/pyenv-hooks:46): realpath(): cd /home/evren/.pyenv/plugins/pyenv-virtualenv/etc/pyenv.d/which ++(/home/evren/.pyenv/libexec/pyenv-hooks:47): realpath(): resolve_link conda.bash ++(/home/evren/.pyenv/libexec/pyenv-hooks:36): resolve_link(): /usr/bin/readlink conda.bash ++(/home/evren/.pyenv/libexec/pyenv-hooks:47): realpath(): true +(/home/evren/.pyenv/libexec/pyenv-hooks:47): realpath(): path= +(/home/evren/.pyenv/libexec/pyenv-hooks:44): realpath(): '[' -n '' ']' +(/home/evren/.pyenv/libexec/pyenv-hooks:50): realpath(): echo /home/evren/.pyenv/plugins/pyenv-virtualenv/etc/pyenv.d/which/conda.bash +(/home/evren/.pyenv/libexec/pyenv-hooks:59): for script in "$path/$PYENV_COMMAND"/*.bash +(/home/evren/.pyenv/libexec/pyenv-hooks:60): realpath /home/evren/.pyenv/plugins/pyenv-virtualenv/etc/pyenv.d/which/python-config.bash +(/home/evren/.pyenv/libexec/pyenv-hooks:40): realpath(): local path=/home/evren/.pyenv/plugins/pyenv-virtualenv/etc/pyenv.d/which/python-config.bash +(/home/evren/.pyenv/libexec/pyenv-hooks:41): realpath(): local name +(/home/evren/.pyenv/libexec/pyenv-hooks:44): realpath(): '[' -n /home/evren/.pyenv/plugins/pyenv-virtualenv/etc/pyenv.d/which/python-config.bash ']' +(/home/evren/.pyenv/libexec/pyenv-hooks:45): realpath(): name=python-config.bash +(/home/evren/.pyenv/libexec/pyenv-hooks:46): realpath(): '[' python-config.bash = /home/evren/.pyenv/plugins/pyenv-virtualenv/etc/pyenv.d/which/python-config.bash ']' +(/home/evren/.pyenv/libexec/pyenv-hooks:46): realpath(): cd /home/evren/.pyenv/plugins/pyenv-virtualenv/etc/pyenv.d/which ++(/home/evren/.pyenv/libexec/pyenv-hooks:47): realpath(): resolve_link python-config.bash ++(/home/evren/.pyenv/libexec/pyenv-hooks:36): resolve_link(): /usr/bin/readlink python-config.bash ++(/home/evren/.pyenv/libexec/pyenv-hooks:47): realpath(): true +(/home/evren/.pyenv/libexec/pyenv-hooks:47): realpath(): path= +(/home/evren/.pyenv/libexec/pyenv-hooks:44): realpath(): '[' -n '' ']' +(/home/evren/.pyenv/libexec/pyenv-hooks:50): realpath(): echo /home/evren/.pyenv/plugins/pyenv-virtualenv/etc/pyenv.d/which/python-config.bash +(/home/evren/.pyenv/libexec/pyenv-hooks:59): for script in "$path/$PYENV_COMMAND"/*.bash +(/home/evren/.pyenv/libexec/pyenv-hooks:60): realpath /home/evren/.pyenv/plugins/pyenv-virtualenv/etc/pyenv.d/which/system-site-packages.bash +(/home/evren/.pyenv/libexec/pyenv-hooks:40): realpath(): local path=/home/evren/.pyenv/plugins/pyenv-virtualenv/etc/pyenv.d/which/system-site-packages.bash +(/home/evren/.pyenv/libexec/pyenv-hooks:41): realpath(): local name +(/home/evren/.pyenv/libexec/pyenv-hooks:44): realpath(): '[' -n /home/evren/.pyenv/plugins/pyenv-virtualenv/etc/pyenv.d/which/system-site-packages.bash ']' +(/home/evren/.pyenv/libexec/pyenv-hooks:45): realpath(): name=system-site-packages.bash +(/home/evren/.pyenv/libexec/pyenv-hooks:46): realpath(): '[' system-site-packages.bash = /home/evren/.pyenv/plugins/pyenv-virtualenv/etc/pyenv.d/which/system-site-packages.bash ']' +(/home/evren/.pyenv/libexec/pyenv-hooks:46): realpath(): cd /home/evren/.pyenv/plugins/pyenv-virtualenv/etc/pyenv.d/which ++(/home/evren/.pyenv/libexec/pyenv-hooks:47): realpath(): resolve_link system-site-packages.bash ++(/home/evren/.pyenv/libexec/pyenv-hooks:36): resolve_link(): /usr/bin/readlink system-site-packages.bash ++(/home/evren/.pyenv/libexec/pyenv-hooks:47): realpath(): true +(/home/evren/.pyenv/libexec/pyenv-hooks:47): realpath(): path= +(/home/evren/.pyenv/libexec/pyenv-hooks:44): realpath(): '[' -n '' ']' +(/home/evren/.pyenv/libexec/pyenv-hooks:50): realpath(): echo /home/evren/.pyenv/plugins/pyenv-virtualenv/etc/pyenv.d/which/system-site-packages.bash +(/home/evren/.pyenv/libexec/pyenv-hooks:63): shopt -u nullglob +(/home/evren/.pyenv/libexec/pyenv-which:64): IFS=' ' +(/home/evren/.pyenv/libexec/pyenv-which:65): for script in "${scripts[@]}" +(/home/evren/.pyenv/libexec/pyenv-which:66): source /home/evren/.pyenv/plugins/pyenv-virtualenv/etc/pyenv.d/which/conda.bash ++(/home/evren/.pyenv/plugins/pyenv-virtualenv/etc/pyenv.d/which/conda.bash:4): '[' '!' -x /home/evren/.pyenv/versions/eiq/bin/pip3.6 ']' +(/home/evren/.pyenv/libexec/pyenv-which:65): for script in "${scripts[@]}" +(/home/evren/.pyenv/libexec/pyenv-which:66): source /home/evren/.pyenv/plugins/pyenv-virtualenv/etc/pyenv.d/which/python-config.bash ++(/home/evren/.pyenv/plugins/pyenv-virtualenv/etc/pyenv.d/which/python-config.bash:6): '[' '!' -x /home/evren/.pyenv/versions/eiq/bin/pip3.6 ']' +(/home/evren/.pyenv/libexec/pyenv-which:65): for script in "${scripts[@]}" +(/home/evren/.pyenv/libexec/pyenv-which:66): source /home/evren/.pyenv/plugins/pyenv-virtualenv/etc/pyenv.d/which/system-site-packages.bash ++(/home/evren/.pyenv/plugins/pyenv-virtualenv/etc/pyenv.d/which/system-site-packages.bash:6): '[' '!' -x /home/evren/.pyenv/versions/eiq/bin/pip3.6 ']' +(/home/evren/.pyenv/libexec/pyenv-which:69): '[' -x /home/evren/.pyenv/versions/eiq/bin/pip3.6 ']' +(/home/evren/.pyenv/libexec/pyenv-which:70): echo /home/evren/.pyenv/versions/eiq/bin/pip3.6 +(/home/evren/.pyenv/libexec/pyenv-exec:33): PYENV_COMMAND_PATH=/home/evren/.pyenv/versions/eiq/bin/pip3.6 +(/home/evren/.pyenv/libexec/pyenv-exec:34): PYENV_BIN_PATH=/home/evren/.pyenv/versions/eiq/bin +(/home/evren/.pyenv/libexec/pyenv-exec:36): OLDIFS=' ' +(/home/evren/.pyenv/libexec/pyenv-exec:37): IFS=' ' +(/home/evren/.pyenv/libexec/pyenv-exec:37): scripts=(`pyenv-hooks exec`) ++(/home/evren/.pyenv/libexec/pyenv-exec:37): pyenv-hooks exec +(/home/evren/.pyenv/libexec/pyenv-hooks:9): '[' exec = --complete ']' +(/home/evren/.pyenv/libexec/pyenv-hooks:18): PYENV_COMMAND=exec +(/home/evren/.pyenv/libexec/pyenv-hooks:19): '[' -z exec ']' +(/home/evren/.pyenv/libexec/pyenv-hooks:24): enable -f /home/evren/.pyenv/libexec/pyenv-realpath.dylib realpath +(/home/evren/.pyenv/libexec/pyenv-hooks:25): '[' -n '' ']' ++(/home/evren/.pyenv/libexec/pyenv-hooks:29): type -P greadlink readlink ++(/home/evren/.pyenv/libexec/pyenv-hooks:29): head -1 +(/home/evren/.pyenv/libexec/pyenv-hooks:29): READLINK=/usr/bin/readlink +(/home/evren/.pyenv/libexec/pyenv-hooks:30): '[' -z /usr/bin/readlink ']' +(/home/evren/.pyenv/libexec/pyenv-hooks:55): IFS=: +(/home/evren/.pyenv/libexec/pyenv-hooks:55): hook_paths=($PYENV_HOOK_PATH) +(/home/evren/.pyenv/libexec/pyenv-hooks:57): shopt -s nullglob +(/home/evren/.pyenv/libexec/pyenv-hooks:58): for path in "${hook_paths[@]}" +(/home/evren/.pyenv/libexec/pyenv-hooks:59): for script in "$path/$PYENV_COMMAND"/*.bash +(/home/evren/.pyenv/libexec/pyenv-hooks:60): realpath /home/evren/.pyenv/pyenv.d/exec/pip-rehash.bash +(/home/evren/.pyenv/libexec/pyenv-hooks:40): realpath(): local path=/home/evren/.pyenv/pyenv.d/exec/pip-rehash.bash +(/home/evren/.pyenv/libexec/pyenv-hooks:41): realpath(): local name +(/home/evren/.pyenv/libexec/pyenv-hooks:44): realpath(): '[' -n /home/evren/.pyenv/pyenv.d/exec/pip-rehash.bash ']' +(/home/evren/.pyenv/libexec/pyenv-hooks:45): realpath(): name=pip-rehash.bash +(/home/evren/.pyenv/libexec/pyenv-hooks:46): realpath(): '[' pip-rehash.bash = /home/evren/.pyenv/pyenv.d/exec/pip-rehash.bash ']' +(/home/evren/.pyenv/libexec/pyenv-hooks:46): realpath(): cd /home/evren/.pyenv/pyenv.d/exec ++(/home/evren/.pyenv/libexec/pyenv-hooks:47): realpath(): resolve_link pip-rehash.bash ++(/home/evren/.pyenv/libexec/pyenv-hooks:36): resolve_link(): /usr/bin/readlink pip-rehash.bash ++(/home/evren/.pyenv/libexec/pyenv-hooks:47): realpath(): true +(/home/evren/.pyenv/libexec/pyenv-hooks:47): realpath(): path= +(/home/evren/.pyenv/libexec/pyenv-hooks:44): realpath(): '[' -n '' ']' +(/home/evren/.pyenv/libexec/pyenv-hooks:50): realpath(): echo /home/evren/.pyenv/pyenv.d/exec/pip-rehash.bash +(/home/evren/.pyenv/libexec/pyenv-hooks:58): for path in "${hook_paths[@]}" +(/home/evren/.pyenv/libexec/pyenv-hooks:58): for path in "${hook_paths[@]}" +(/home/evren/.pyenv/libexec/pyenv-hooks:58): for path in "${hook_paths[@]}" +(/home/evren/.pyenv/libexec/pyenv-hooks:58): for path in "${hook_paths[@]}" +(/home/evren/.pyenv/libexec/pyenv-hooks:63): shopt -u nullglob +(/home/evren/.pyenv/libexec/pyenv-exec:38): IFS=' ' +(/home/evren/.pyenv/libexec/pyenv-exec:39): for script in "${scripts[@]}" +(/home/evren/.pyenv/libexec/pyenv-exec:40): source /home/evren/.pyenv/pyenv.d/exec/pip-rehash.bash ++(/home/evren/.pyenv/pyenv.d/exec/pip-rehash.bash:1): PYENV_PIP_REHASH_ROOT=/home/evren/.pyenv/pyenv.d/exec/pip-rehash ++(/home/evren/.pyenv/pyenv.d/exec/pip-rehash.bash:2): PYENV_REHASH_COMMAND=pip3.6 ++(/home/evren/.pyenv/pyenv.d/exec/pip-rehash.bash:5): [[ pip3.6 =~ ^(pip|easy_install)[23](\.d)?$ ]] ++(/home/evren/.pyenv/pyenv.d/exec/pip-rehash.bash:9): '[' -x /home/evren/.pyenv/pyenv.d/exec/pip-rehash/pip3.6 ']' +(/home/evren/.pyenv/libexec/pyenv-exec:43): shift 1 +(/home/evren/.pyenv/libexec/pyenv-exec:44): '[' /versions/eiq/bin '!=' /home/evren/.pyenv/versions/eiq/bin ']' +(/home/evren/.pyenv/libexec/pyenv-exec:46): export PATH=/home/evren/.pyenv/versions/eiq/bin:/home/evren/.pyenv/libexec:/home/evren/.pyenv/plugins/python-build/bin:/home/evren/.pyenv/plugins/pyenv-virtualenv/bin:/home/evren/.pyenv/plugins/pyenv-virtualenv/shims:/home/evren/.pyenv/shims:/home/evren/.pyenv/bin:/home/evren/.local/bin:/home/evren/.pyenv/plugins/pyenv-virtualenv/shims:/home/evren/.pyenv/plugins/pyenv-virtualenv/shims:/home/evren/.pyenv/shims:/home/evren/.pyenv/bin:/home/evren/.local/bin:/home/evren/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin +(/home/evren/.pyenv/libexec/pyenv-exec:46): PATH=/home/evren/.pyenv/versions/eiq/bin:/home/evren/.pyenv/libexec:/home/evren/.pyenv/plugins/python-build/bin:/home/evren/.pyenv/plugins/pyenv-virtualenv/bin:/home/evren/.pyenv/plugins/pyenv-virtualenv/shims:/home/evren/.pyenv/shims:/home/evren/.pyenv/bin:/home/evren/.local/bin:/home/evren/.pyenv/plugins/pyenv-virtualenv/shims:/home/evren/.pyenv/plugins/pyenv-virtualenv/shims:/home/evren/.pyenv/shims:/home/evren/.pyenv/bin:/home/evren/.local/bin:/home/evren/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin +(/home/evren/.pyenv/libexec/pyenv-exec:48): exec /home/evren/.pyenv/versions/eiq/bin/pip3.6 Segmentation fault (core dumped) ```
native-api commented 3 years ago

@evrenesat From your dump, I can only see that /home/evren/.pyenv/versions/eiq/bin/pip3.6 segfaults. I believe only analyzing the core (that is going to need debugging info for relevant modules) or running the underlying Python with diagnostics can give any more information. E.g. it's possible that a binary-incompatible dynamic lib is being loaded.

evrenesat commented 3 years ago

The issue only happens on Ubuntu 21.10. After I spend a day, I gave up and installed 20.04 then everything worked perfectly. For another reason I reinstalled 21.10 again, segmentation faults came back. Each time it was a clean install.

abhinavsp0730 commented 3 years ago

It's happening on manjaro.

On Sat, Oct 23, 2021, 5:55 PM Evren Esat Özkan @.***> wrote:

The issue only happens on Ubuntu 21.10. After I spend a day, I have gave up and installed 20.04 then everything worked perfectly. For another reason I reinstalled 21.10 again, segmentation faults came back. Each time it was a clean install.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pyenv/pyenv-virtualenv/issues/410#issuecomment-950144898, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKM6BK7KP3OMKI52SEW77I3UIKSSNANCNFSM5FHLKTVQ .

native-api commented 3 years ago

The issue only happens on Ubuntu 21.10.

Does it also happen in a 21.10 docker container? Can you provide reproduction steps from a clean state?

edward-springload commented 3 years ago

I have this on Fedora 35 Beta with Python 3.6.15

edward-springload commented 3 years ago

If you create the venv without a name it works fine as the previous comment said: pyenv virtualenv -f 3.6.15

evrenesat commented 3 years ago

In Ubuntu 21.10, I downloaded Python 3.6.15 from python.org, manually compiled and installed. It was enough to run "import ctypes" in python shell to crash it with seg. fault. That's also why pip was crashing. So, it doesn't seem to be related with pyenv.

Tried same steps in a Docker container on a Ubuntu 20.04 host but it didn't crash.

felix-commits commented 2 years ago

I have found a working temporary fix from this french site to fix the issue you can comment this line in the file /home/johackim/.pyenv/versions/3.7.0/bin/pip3.7

# sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
nassif-francisco commented 2 years ago

Tried with venv, virtualenv, pyenv-virtualenv in my Ubuntu 21.10, and always the same seg fault error at the end of some installation process. I agree with @evrenesat. Installing an older Ubuntu.

pythonwood commented 2 years ago

stil happen in ubuntu 22.04 (default python3.10) and pyenv 2.2.5 and latest pyenv-virtualenv !

first time every thing ok.

pyenv virtualenv -f 3.6.9 pyenv-3.6.9  
pyenv activate pyenv-3.6.9 
pip install mysqlclient==2.0.3

out and go into again jsut justdump

pyenv virtualenv -f 3.6.9 pyenv-3.6.9  
pyenv activate pyenv-3.6.9 
pip list

/home/wilson/local/pyenv/pyenv.d/exec/pip-rehash/pip:line 20: 2975264 coredump .....xxx. "$PYENV_COMMAND_PATH" "$@"

cainat commented 2 years ago

Needed to upgrade python version to 3.8.13 to surpass this error. I guess it might be related to pip version used in python 3.6.x (pip-21.3.1). When changed to python 3.8.13 (and pip-22.0.4) the issues after installing any modules was solved.

I'm using Pop OS! 22.04 LTS

frhack commented 2 years ago

There is a solution (tested on ubuntu 22.04):

cat alignment.patch

--- Include/objimpl.h
+++ Include/objimpl.h
@@ -250,7 +250,7 @@
         union _gc_head *gc_prev;
         Py_ssize_t gc_refs;
     } gc;
-    double dummy;  /* force worst-case alignment */
+    long double dummy;  /* force worst-case alignment */
 } PyGC_Head;

 extern PyGC_Head *_PyGC_generation0;
--- Objects/obmalloc.c
+++ Objects/obmalloc.c
@@ -643,8 +643,8 @@
  *
  * You shouldn't change this unless you know what you are doing.
  */
-#define ALIGNMENT               8               /* must be 2^N */
-#define ALIGNMENT_SHIFT         3
+#define ALIGNMENT               16               /* must be 2^N */
+#define ALIGNMENT_SHIFT         4

 /* Return the number of bytes in size class I, as a uint. */
 #define INDEX2SIZE(I) (((uint)(I) + 1) << ALIGNMENT_SHIFT)

pyenv install --patch 3.6.8 < alignment.patch

Error 139 When Installing Python 3.6 on Fedora 34

ptutak-ias commented 2 years ago

in Ubuntu 22. i had to install gcc-10 then CC=gcc-10 pyenv install 3.6.13

https://giters.com/pyenv/pyenv/issues/1889

This worked for me aswell.

Niklas-Zeidler commented 2 years ago

Worked for me using pyenv, WSL debian testing branch as well.

kolypto commented 2 years ago

Solution:

$ sudo apt install clang -y
$ CC=clang pyenv install 3.6.15
darren-sudonum commented 1 year ago

Ubuntu 22.04 pyenv 3.6.15 (global) So I tried a number of things that didn't work, then simply: $ sudo apt-get install --reinstall pip

kishore-s-15 commented 1 year ago

I'm getting the same error, but with the included pip-rehash: /home/username/.pyenv/pyenv.d/exec/pip-rehash/pip: line 20: 43331 Segmentation fault (core dumped) "$PYENV_COMMAND_PATH" "$@"

~Somehow I managed to fix it~ by not providing a name for the virtualenv I'm creating. So this ends up with pip/python mismatch and seg.fault:

pyenv virtualenv -f 3.6.15 env_name

But this one works:

pyenv virtualenv -f 3.6.15

Not sure if -f helps or not, I stopped experimenting after solving my problem.

Edit: I was wrong, when I don't provide a name, it incorrectly creates the environment using Python 3.10 then the pip matches with the python.

click to see the debug output, in case if it helps

The reason for installing Pyenv in the first place is to have multiple python versions and virtualenv, so that we can switch between them robustly.

This solution does not create a new virtualenv but instead creates another python instance. If we then install the dependencies on that, we would pollute the global env so that we cannot use this instance across multiple different projects.

The above solution by @kolypto to use clang instead of gcc for compiling & installing different python versions works and looks like the best solution for me.

native-api commented 1 year ago

https://github.com/pyenv/pyenv/pull/2630 has likely fixed this for 3.5.10 and 3.6.15. It's an upstream problem that was fixed in 3.7+. Since the former are EOL, they didn't backport that patch further.

iamtalhaasghar commented 1 year ago

Solution:

$ sudo apt install clang -y
$ CC=clang pyenv install 3.6.15

in case you are using fedora:

sudo dnf install clang
CC=clang pyenv install 3.6.13

source: https://giters.com/pyenv/pyenv/issues/1889

ERP-FTW commented 1 year ago

Solution:

$ sudo apt install clang -y
$ CC=clang pyenv install 3.6.15

in case you are using fedora:

sudo dnf install clang
CC=clang pyenv install 3.6.13

source: https://giters.com/pyenv/pyenv/issues/1889

lifesaver