pyenv / pyenv-installer

This tool is used to install `pyenv` and friends.
MIT License
3.96k stars 428 forks source link

Failure to install under Windows Subsystem Linux (WSL 2) and Debian 11 #116

Closed Naphier closed 3 years ago

Naphier commented 3 years ago

Trying to install into Windows WSL 2 Debian v11 (Bullseye) on a new dev machine where I'm trying to keep a lot in WSL. It fails with

WARNING: seems you still have not added 'pyenv' to the load path.

Then a stack trace:

set: usage: set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]
/home/napland/.pyenv/bin/pyenv: line 3: $'\r': command not found
/home/napland/.pyenv/bin/pyenv: line 15: syntax error near unexpected token `$'{\r''
'home/napland/.pyenv/bin/pyenv: line 15: `abort() {
: invalid optionyenv/bin/pyenv: line 2: set: -
set: usage: set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]
/home/napland/.pyenv/bin/pyenv: line 3: $'\r': command not found
/home/napland/.pyenv/bin/pyenv: line 15: syntax error near unexpected token `$'{\r''
'home/napland/.pyenv/bin/pyenv: line 15: `abort() {

Seems something's afoot. Any ideas? Thanks


Here's the full log with my installation method.

napland@BigDaddy:/mnt/d/Repos$ sudo apt-get update; sudo apt-get install make build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev

Get:1 http://security.debian.org/debian-security bullseye-security InRelease [44.1 kB]
Get:2 http://ftp.debian.org/debian bullseye-backports InRelease [39.3 kB]
Hit:3 http://deb.debian.org/debian bullseye InRelease
Get:4 http://deb.debian.org/debian bullseye-updates InRelease [36.8 kB]
Get:5 http://security.debian.org/debian-security bullseye-security/main amd64 Packages [29.4 kB]
Get:6 http://security.debian.org/debian-security bullseye-security/main Translation-en [15.7 kB]
Fetched 165 kB in 3s (57.5 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
build-essential is already the newest version (12.9).
libbz2-dev is already the newest version (1.0.8-4).
curl is already the newest version (7.74.0-1.3+b1).
libffi-dev is already the newest version (3.3-6).
llvm is already the newest version (1:11.0-51+nmu5).
make is already the newest version (4.3-4.1).
libncursesw5-dev is already the newest version (6.2+20201114-2).
libreadline-dev is already the newest version (8.1-1).
libsqlite3-dev is already the newest version (3.34.1-3).
tk-dev is already the newest version (8.6.11+1).
wget is already the newest version (1.21-1+b1).
liblzma-dev is already the newest version (5.2.5-2).
xz-utils is already the newest version (5.2.5-2).
zlib1g-dev is already the newest version (1:1.2.11.dfsg-2).
libssl-dev is already the newest version (1.1.1k-1+deb11u1).
The following additional packages will be installed:
  icu-devtools libevent-2.1-7 libgcrypt20-dev libgmp-dev libgmpxx4ldbl libgnutls-dane0
  libgnutls-openssl27 libgnutls28-dev libgnutlsxx28 libgpg-error-dev libicu-dev libidn2-dev libnspr4
  libnspr4-dev libnss3 libnss3-dev libp11-kit-dev libtasn1-6-dev libtasn1-doc libunbound8 libxmlsec1
  libxmlsec1-gcrypt libxmlsec1-gnutls libxmlsec1-nss libxmlsec1-openssl libxslt1-dev libxslt1.1
  nettle-dev
Suggested packages:
  libgcrypt20-doc gmp-doc libgmp10-doc libmpfr-dev dns-root-data gnutls-bin gnutls-doc icu-doc
The following NEW packages will be installed:
  icu-devtools libevent-2.1-7 libgcrypt20-dev libgmp-dev libgmpxx4ldbl libgnutls-dane0
  libgnutls-openssl27 libgnutls28-dev libgnutlsxx28 libgpg-error-dev libicu-dev libidn2-dev libnspr4
  libnspr4-dev libnss3 libnss3-dev libp11-kit-dev libtasn1-6-dev libtasn1-doc libunbound8 libxml2-dev
  libxmlsec1 libxmlsec1-dev libxmlsec1-gcrypt libxmlsec1-gnutls libxmlsec1-nss libxmlsec1-openssl
  libxslt1-dev libxslt1.1 nettle-dev
0 upgraded, 30 newly installed, 0 to remove and 0 not upgraded.
Need to get 20.4 MB of archives.
After this operation, 80.9 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://deb.debian.org/debian bullseye/main amd64 icu-devtools amd64 67.1-7 [201 kB]
Get:2 http://deb.debian.org/debian bullseye/main amd64 libevent-2.1-7 amd64 2.1.12-stable-1 [188 kB]
Get:3 http://deb.debian.org/debian bullseye/main amd64 libgpg-error-dev amd64 1.38-2 [133 kB]
Get:4 http://deb.debian.org/debian bullseye/main amd64 libgcrypt20-dev amd64 1.8.7-6 [615 kB]
Get:5 http://deb.debian.org/debian bullseye/main amd64 libgmpxx4ldbl amd64 2:6.2.1+dfsg-1 [337 kB]
Get:6 http://deb.debian.org/debian bullseye/main amd64 libgmp-dev amd64 2:6.2.1+dfsg-1 [643 kB]
Get:7 http://deb.debian.org/debian bullseye/main amd64 libunbound8 amd64 1.13.1-1 [504 kB]
Get:8 http://deb.debian.org/debian bullseye/main amd64 libgnutls-dane0 amd64 3.7.1-5 [394 kB]
Get:9 http://deb.debian.org/debian bullseye/main amd64 libgnutls-openssl27 amd64 3.7.1-5 [395 kB]
Get:10 http://deb.debian.org/debian bullseye/main amd64 libgnutlsxx28 amd64 3.7.1-5 [14.6 kB]
Get:11 http://deb.debian.org/debian bullseye/main amd64 libidn2-dev amd64 2.3.0-5 [87.7 kB]
Get:12 http://deb.debian.org/debian bullseye/main amd64 libp11-kit-dev amd64 0.23.22-1 [214 kB]
Get:13 http://deb.debian.org/debian bullseye/main amd64 libtasn1-6-dev amd64 4.16.0-2 [104 kB]
Get:14 http://deb.debian.org/debian bullseye/main amd64 nettle-dev amd64 3.7.3-1 [1,263 kB]
Get:15 http://deb.debian.org/debian bullseye/main amd64 libgnutls28-dev amd64 3.7.1-5 [1,302 kB]
Get:16 http://deb.debian.org/debian bullseye/main amd64 libicu-dev amd64 67.1-7 [9,597 kB]
Get:17 http://deb.debian.org/debian bullseye/main amd64 libnspr4 amd64 2:4.29-1 [112 kB]
Get:18 http://deb.debian.org/debian bullseye/main amd64 libnspr4-dev amd64 2:4.29-1 [211 kB]
Get:19 http://deb.debian.org/debian bullseye/main amd64 libnss3 amd64 2:3.61-1 [1,304 kB]
Get:20 http://deb.debian.org/debian bullseye/main amd64 libnss3-dev amd64 2:3.61-1 [253 kB]
Get:21 http://deb.debian.org/debian bullseye/main amd64 libtasn1-doc all 4.16.0-2 [321 kB]
Get:22 http://deb.debian.org/debian bullseye/main amd64 libxml2-dev amd64 2.9.10+dfsg-6.7 [791 kB]
Get:23 http://deb.debian.org/debian bullseye/main amd64 libxslt1.1 amd64 1.1.34-4 [239 kB]
Get:24 http://deb.debian.org/debian bullseye/main amd64 libxmlsec1 amd64 1.2.31-1 [149 kB]
Get:25 http://deb.debian.org/debian bullseye/main amd64 libxmlsec1-gcrypt amd64 1.2.31-1 [64.7 kB]
Get:26 http://deb.debian.org/debian bullseye/main amd64 libxmlsec1-gnutls amd64 1.2.31-1 [56.7 kB]
Get:27 http://deb.debian.org/debian bullseye/main amd64 libxmlsec1-nss amd64 1.2.31-1 [85.6 kB]
Get:28 http://deb.debian.org/debian bullseye/main amd64 libxmlsec1-openssl amd64 1.2.31-1 [100.0 kB]
Get:29 http://deb.debian.org/debian bullseye/main amd64 libxslt1-dev amd64 1.1.34-4 [329 kB]
Get:30 http://deb.debian.org/debian bullseye/main amd64 libxmlsec1-dev amd64 1.2.31-1 [407 kB]
Fetched 20.4 MB in 1s (25.4 MB/s)
Selecting previously unselected package icu-devtools.
(Reading database ... 39904 files and directories currently installed.)
Preparing to unpack .../00-icu-devtools_67.1-7_amd64.deb ...
Unpacking icu-devtools (67.1-7) ...
Selecting previously unselected package libevent-2.1-7:amd64.
Preparing to unpack .../01-libevent-2.1-7_2.1.12-stable-1_amd64.deb ...
Unpacking libevent-2.1-7:amd64 (2.1.12-stable-1) ...
Selecting previously unselected package libgpg-error-dev.
Preparing to unpack .../02-libgpg-error-dev_1.38-2_amd64.deb ...
Unpacking libgpg-error-dev (1.38-2) ...
Selecting previously unselected package libgcrypt20-dev.
Preparing to unpack .../03-libgcrypt20-dev_1.8.7-6_amd64.deb ...
Unpacking libgcrypt20-dev (1.8.7-6) ...
Selecting previously unselected package libgmpxx4ldbl:amd64.
Preparing to unpack .../04-libgmpxx4ldbl_2%3a6.2.1+dfsg-1_amd64.deb ...
Unpacking libgmpxx4ldbl:amd64 (2:6.2.1+dfsg-1) ...
Selecting previously unselected package libgmp-dev:amd64.
Preparing to unpack .../05-libgmp-dev_2%3a6.2.1+dfsg-1_amd64.deb ...
Unpacking libgmp-dev:amd64 (2:6.2.1+dfsg-1) ...
Selecting previously unselected package libunbound8:amd64.
Preparing to unpack .../06-libunbound8_1.13.1-1_amd64.deb ...
Unpacking libunbound8:amd64 (1.13.1-1) ...
Selecting previously unselected package libgnutls-dane0:amd64.
Preparing to unpack .../07-libgnutls-dane0_3.7.1-5_amd64.deb ...
Unpacking libgnutls-dane0:amd64 (3.7.1-5) ...
Selecting previously unselected package libgnutls-openssl27:amd64.
Preparing to unpack .../08-libgnutls-openssl27_3.7.1-5_amd64.deb ...
Unpacking libgnutls-openssl27:amd64 (3.7.1-5) ...
Selecting previously unselected package libgnutlsxx28:amd64.
Preparing to unpack .../09-libgnutlsxx28_3.7.1-5_amd64.deb ...
Unpacking libgnutlsxx28:amd64 (3.7.1-5) ...
Selecting previously unselected package libidn2-dev:amd64.
Preparing to unpack .../10-libidn2-dev_2.3.0-5_amd64.deb ...
Unpacking libidn2-dev:amd64 (2.3.0-5) ...
Selecting previously unselected package libp11-kit-dev:amd64.
Preparing to unpack .../11-libp11-kit-dev_0.23.22-1_amd64.deb ...
Unpacking libp11-kit-dev:amd64 (0.23.22-1) ...
Selecting previously unselected package libtasn1-6-dev:amd64.
Preparing to unpack .../12-libtasn1-6-dev_4.16.0-2_amd64.deb ...
Unpacking libtasn1-6-dev:amd64 (4.16.0-2) ...
Selecting previously unselected package nettle-dev:amd64.
Preparing to unpack .../13-nettle-dev_3.7.3-1_amd64.deb ...
Unpacking nettle-dev:amd64 (3.7.3-1) ...
Selecting previously unselected package libgnutls28-dev:amd64.
Preparing to unpack .../14-libgnutls28-dev_3.7.1-5_amd64.deb ...
Unpacking libgnutls28-dev:amd64 (3.7.1-5) ...
Selecting previously unselected package libicu-dev:amd64.
Preparing to unpack .../15-libicu-dev_67.1-7_amd64.deb ...
Unpacking libicu-dev:amd64 (67.1-7) ...
Selecting previously unselected package libnspr4:amd64.
Preparing to unpack .../16-libnspr4_2%3a4.29-1_amd64.deb ...
Unpacking libnspr4:amd64 (2:4.29-1) ...
Selecting previously unselected package libnspr4-dev.
Preparing to unpack .../17-libnspr4-dev_2%3a4.29-1_amd64.deb ...
Unpacking libnspr4-dev (2:4.29-1) ...
Selecting previously unselected package libnss3:amd64.
Preparing to unpack .../18-libnss3_2%3a3.61-1_amd64.deb ...
Unpacking libnss3:amd64 (2:3.61-1) ...
Selecting previously unselected package libnss3-dev:amd64.
Preparing to unpack .../19-libnss3-dev_2%3a3.61-1_amd64.deb ...
Unpacking libnss3-dev:amd64 (2:3.61-1) ...
Selecting previously unselected package libtasn1-doc.
Preparing to unpack .../20-libtasn1-doc_4.16.0-2_all.deb ...
Unpacking libtasn1-doc (4.16.0-2) ...
Selecting previously unselected package libxml2-dev:amd64.
Preparing to unpack .../21-libxml2-dev_2.9.10+dfsg-6.7_amd64.deb ...
Unpacking libxml2-dev:amd64 (2.9.10+dfsg-6.7) ...
Selecting previously unselected package libxslt1.1:amd64.
Preparing to unpack .../22-libxslt1.1_1.1.34-4_amd64.deb ...
Unpacking libxslt1.1:amd64 (1.1.34-4) ...
Selecting previously unselected package libxmlsec1:amd64.
Preparing to unpack .../23-libxmlsec1_1.2.31-1_amd64.deb ...
Unpacking libxmlsec1:amd64 (1.2.31-1) ...
Selecting previously unselected package libxmlsec1-gcrypt:amd64.
Preparing to unpack .../24-libxmlsec1-gcrypt_1.2.31-1_amd64.deb ...
Unpacking libxmlsec1-gcrypt:amd64 (1.2.31-1) ...
Selecting previously unselected package libxmlsec1-gnutls:amd64.
Preparing to unpack .../25-libxmlsec1-gnutls_1.2.31-1_amd64.deb ...
Unpacking libxmlsec1-gnutls:amd64 (1.2.31-1) ...
Selecting previously unselected package libxmlsec1-nss:amd64.
Preparing to unpack .../26-libxmlsec1-nss_1.2.31-1_amd64.deb ...
Unpacking libxmlsec1-nss:amd64 (1.2.31-1) ...
Selecting previously unselected package libxmlsec1-openssl:amd64.
Preparing to unpack .../27-libxmlsec1-openssl_1.2.31-1_amd64.deb ...
Unpacking libxmlsec1-openssl:amd64 (1.2.31-1) ...
Selecting previously unselected package libxslt1-dev:amd64.
Preparing to unpack .../28-libxslt1-dev_1.1.34-4_amd64.deb ...
Unpacking libxslt1-dev:amd64 (1.1.34-4) ...
Selecting previously unselected package libxmlsec1-dev.
Preparing to unpack .../29-libxmlsec1-dev_1.2.31-1_amd64.deb ...
Unpacking libxmlsec1-dev (1.2.31-1) ...
Setting up libgnutls-openssl27:amd64 (3.7.1-5) ...
Setting up libtasn1-doc (4.16.0-2) ...
Setting up libgmpxx4ldbl:amd64 (2:6.2.1+dfsg-1) ...
Setting up libgpg-error-dev (1.38-2) ...
Setting up libnspr4:amd64 (2:4.29-1) ...
Setting up libevent-2.1-7:amd64 (2.1.12-stable-1) ...
Setting up icu-devtools (67.1-7) ...
Setting up libgnutlsxx28:amd64 (3.7.1-5) ...
Setting up libidn2-dev:amd64 (2.3.0-5) ...
Setting up libxslt1.1:amd64 (1.1.34-4) ...
Setting up libxmlsec1:amd64 (1.2.31-1) ...
Setting up libtasn1-6-dev:amd64 (4.16.0-2) ...
Setting up libicu-dev:amd64 (67.1-7) ...
Setting up libp11-kit-dev:amd64 (0.23.22-1) ...
Setting up libnspr4-dev (2:4.29-1) ...
Setting up libgmp-dev:amd64 (2:6.2.1+dfsg-1) ...
Setting up nettle-dev:amd64 (3.7.3-1) ...
Setting up libxmlsec1-openssl:amd64 (1.2.31-1) ...
Setting up libnss3:amd64 (2:3.61-1) ...
Setting up libxml2-dev:amd64 (2.9.10+dfsg-6.7) ...
Setting up libunbound8:amd64 (1.13.1-1) ...
Setting up libgcrypt20-dev (1.8.7-6) ...
Setting up libxmlsec1-gcrypt:amd64 (1.2.31-1) ...
Setting up libxmlsec1-nss:amd64 (1.2.31-1) ...
Setting up libnss3-dev:amd64 (2:3.61-1) ...
Setting up libxmlsec1-gnutls:amd64 (1.2.31-1) ...
Setting up libgnutls-dane0:amd64 (3.7.1-5) ...
Setting up libxslt1-dev:amd64 (1.1.34-4) ...
Setting up libgnutls28-dev:amd64 (3.7.1-5) ...
Setting up libxmlsec1-dev (1.2.31-1) ...
Processing triggers for libc-bin (2.31-13) ...

napland@BigDaddy:/mnt/d/Repos$ sudo curl https://pyenv.run | bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   270  100   270    0     0    825      0 --:--:-- --:--:-- --:--:--   825
Cloning into '/home/napland/.pyenv'...
remote: Enumerating objects: 777, done.
remote: Counting objects: 100% (777/777), done.
remote: Compressing objects: 100% (402/402), done.
remote: Total 777 (delta 426), reused 495 (delta 278), pack-reused 0
Receiving objects: 100% (777/777), 413.52 KiB | 3.69 MiB/s, done.
Resolving deltas: 100% (426/426), done.
Cloning into '/home/napland/.pyenv/plugins/pyenv-doctor'...
remote: Enumerating objects: 11, done.
remote: Counting objects: 100% (11/11), done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 11 (delta 1), reused 5 (delta 0), pack-reused 0
Receiving objects: 100% (11/11), 38.64 KiB | 1.10 MiB/s, done.
Resolving deltas: 100% (1/1), done.
Cloning into '/home/napland/.pyenv/plugins/pyenv-installer'...
remote: Enumerating objects: 16, done.
remote: Counting objects: 100% (16/16), done.
remote: Compressing objects: 100% (13/13), done.
remote: Total 16 (delta 1), reused 7 (delta 0), pack-reused 0
Receiving objects: 100% (16/16), 5.75 KiB | 5.75 MiB/s, done.
Resolving deltas: 100% (1/1), done.
Cloning into '/home/napland/.pyenv/plugins/pyenv-update'...
remote: Enumerating objects: 10, done.
remote: Counting objects: 100% (10/10), done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 10 (delta 1), reused 5 (delta 0), pack-reused 0
Receiving objects: 100% (10/10), done.
Resolving deltas: 100% (1/1), done.
Cloning into '/home/napland/.pyenv/plugins/pyenv-virtualenv'...
remote: Enumerating objects: 57, done.
remote: Counting objects: 100% (57/57), done.
remote: Compressing objects: 100% (51/51), done.
remote: Total 57 (delta 11), reused 22 (delta 0), pack-reused 0
Receiving objects: 100% (57/57), 35.39 KiB | 1.47 MiB/s, done.
Resolving deltas: 100% (11/11), done.
Cloning into '/home/napland/.pyenv/plugins/pyenv-which-ext'...
remote: Enumerating objects: 10, done.
remote: Counting objects: 100% (10/10), done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 10 (delta 1), reused 6 (delta 0), pack-reused 0
Receiving objects: 100% (10/10), done.
Resolving deltas: 100% (1/1), done.

WARNING: seems you still have not added 'pyenv' to the load path.

: invalid optionyenv/bin/pyenv: line 2: set: -
set: usage: set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]
/home/napland/.pyenv/bin/pyenv: line 3: $'\r': command not found
/home/napland/.pyenv/bin/pyenv: line 15: syntax error near unexpected token `$'{\r''
'home/napland/.pyenv/bin/pyenv: line 15: `abort() {
: invalid optionyenv/bin/pyenv: line 2: set: -
set: usage: set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]
/home/napland/.pyenv/bin/pyenv: line 3: $'\r': command not found
/home/napland/.pyenv/bin/pyenv: line 15: syntax error near unexpected token `$'{\r''
'home/napland/.pyenv/bin/pyenv: line 15: `abort() {
napland@BigDaddy:/mnt/d/Repos$
caveman-dick commented 3 years ago

Similar happens for me with Ubuntu 20.04 under wsl, the tail of the output is:

Cloning into '/home/richard/.pyenv/plugins/pyenv-which-ext'...
remote: Enumerating objects: 10, done.
remote: Counting objects: 100% (10/10), done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 10 (delta 1), reused 6 (delta 0), pack-reused 0
Unpacking objects: 100% (10/10), 2.92 KiB | 995.00 KiB/s, done.

WARNING: seems you still have not added 'pyenv' to the load path.

/usr/bin/env: ‘bash\r’: No such file or directory
/usr/bin/env: ‘bash\r’: No such file or directory
caveman-dick commented 3 years ago

Ok this is due to line endings. I switched off autocrlf and it worked:

git config --global core.autocrlf false
Naphier commented 3 years ago

Workaround works. Thanks!