Comments (45)
Same issue today. Installed with script on ubuntu 20.04, restarted shell and still
$pyenv
Command 'pyenv' not found
fixed by manually adding to ~/.bashrc
the lines:
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init --path)"
eval "$(pyenv virtualenv-init -)"
and then restarting the shell with exec $SHELL
.
from pyenv-installer.
when installer script runs, it shows the following output.
WARNING: seems you still have not added 'pyenv' to the load path.
# (The below instructions are intended for common
# shell setups. See the README for more guidance
# if they don't apply and/or don't work for you.)
# Add pyenv executable to PATH and
# enable shims by adding the following
# to ~/.profile:
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init --path)"
# If your ~/.profile sources ~/.bashrc,
# the lines need to be inserted before the part
# that does that. See the README for another option.
# If you have ~/.bash_profile, make sure that it
# also executes the above lines -- e.g. by
# copying them there or by sourcing ~/.profile
# Load pyenv into the shell by adding
# the following to ~/.bashrc:
eval "$(pyenv init -)"
# Make sure to restart your entire logon session
# for changes to profile files to take effect.
# Load pyenv-virtualenv automatically by adding
# the following to ~/.bashrc:
eval "$(pyenv virtualenv-init -)"
from pyenv-installer.
according to uninstall instructions https://github.com/pyenv/pyenv-installer/blob/master/README.rst#uninstall
the installer should automatically modify the .bashrc
and it is not.
from pyenv-installer.
b. Surely is something this installer script can/should do automatically?
Came here to suggest that the install script should setup the entire environment so you can start using pyenv immediately.
from pyenv-installer.
Is there a good reason why the installer doesn't automatically update the path in e.g. ~/.bashrc
or ~/.zshrc
?
If so, perhaps it could at least echo some instructions to stdout that would give users a clue how to proceed. I wanted to add pyenv
to some of our team workflows but for now I'll leave it out because other team members will get confused and angry with me when they get stuck. 😅
from pyenv-installer.
Still broken in 2022 <3
from pyenv-installer.
changing my ~/.bashrc to this fixed the issue
# So pyenv gets recognized
export PATH="$PATH:$HOME/.pyenv/bin"
eval "$(pyenv init --path)"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
from pyenv-installer.
Can we get a re-open on this?
Per @sabotagebeats' comment you can get pyenv
to work by manually appending to ~/.bashrc
, but:
a. That is not mentioned in the docs (see below), and moreover:
b. Surely is something this installer script can/should do automatically?
Example of following the docs:
$ docker run -it mcr.microsoft.com/vscode/devcontainers/base:0-focal bash
root ➜ / $ curl https://pyenv.run | bash
[...]
Unpacking objects: 100% (10/10), 2.92 KiB | 597.00 KiB/s, done.
WARNING: seems you still have not added 'pyenv' to the load path.
# See the README for instructions on how to set up
# your shell environment for Pyenv.
# Load pyenv-virtualenv automatically by adding
# the following to ~/.bashrc:
eval "$(pyenv virtualenv-init -)"
⬆️ this is already a red flag, but the docs only say to exec $SHELL
:
root ➜ / $ exec $SHELL
root ➜ / $ pyenv
bash: pyenv: command not found
This leaves the user having to go back to the pyenv
README (which doesn't make any mention of needed to manually append to ~/.bashrc
in the Automatic installer section).
from pyenv-installer.
this should be a part of the pyenv installer script to ask the user if the user would like to add the required lines to the ~/.bashrc
from pyenv-installer.
I'm taking a look at at nvm
s installer and it automatically modifies your shell environment via https://github.com/nvm-sh/nvm/blob/81fc05684de8b0b13aed401de64733e1d5d23a9a/install.sh#L345 and then adds the required lines to your shell config file here
the pyenv-installer should do something similar while also leaving an option of not modifying your shell config files if you already do that on your own.
For example I have separate files that my shell config loads if the binary is present.
from pyenv-installer.
This still looks broken for me?
The workaround I used since there was only one file was sudo ln -s "${HOME}/.pyenv/bin/pyenv" "/usr/local/bin/."
which got it working.
from pyenv-installer.
I am still having this issue.
For Ubuntu-based Linux distros try to use my script:
https://github.com/zaemiel/ubuntu-pyenv-installer
from pyenv-installer.
Had the same issue w/ Mac OS X 10.15.7 using zsh
. Had to manually add the shim path to .zshrc
Running % pyenv doctor
would say all was good:
% pyenv doctor
Cloning /Users/jheasly/.pyenv/plugins/pyenv-doctor/bin/.....
Installing python-pyenv-doctor...
python-build: use readline from homebrew
python-build: use zlib from xcode sdk
Installed python-pyenv-doctor to /var/folders/tq/1wdf1n1n75xfr3swdjtpq6jm0000gn/T/pyenv-doctor.20211103162934.85601/prefix
Congratulations! You are ready to build pythons!
%
... but the pyenv python wouldn't be found. The system python is what would launch when I did % python
on the command line after setting a system python via pyenv
. Once I manually added the shim to .zshrc
, all worked.
p.s.: Also had to add
export LDFLAGS="-L/usr/local/opt/openssl@3/lib"
export CPPFLAGS="-I/usr/local/opt/openssl@3/include"
to .zshrc
for % pyenv doctor
to work.
from pyenv-installer.
After installing the follow message appears
WARNING: seems you still have not added 'pyenv' to the load path. # See the README for instructions on how to set up # your shell environment for Pyenv. # Load pyenv-virtualenv automatically by adding # the following to ~/.bashrc: eval "$(pyenv virtualenv-init -)"
Still fail to find pyenv after add
"eval $(pyenv virtualenv-init -)"
to .bashrc or .profileI had to manually add to .bashrc
export PATH="$HOME/.pyenv/bin:$PATH" eval "$(pyenv init --path)" eval "$(pyenv virtualenv-init -)"
I tried to manually add this and I get this error:
Failed to activate virtualenv.
Perhaps pyenv-virtualenv has not been loaded into your shell properly.
Please restart current shell and try again.
from pyenv-installer.
2023 now and no fix, maybe good idea to update readme? #145
from pyenv-installer.
Same issue.
from pyenv-installer.
I hit the same issue today.
I think this happened with pyenv 2.0+ upgrade (first release in may 23). They changed the bashrc script to:
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init --path)"
eval "$(pyenv virtualenv-init -)"
Second line was eval "$(pyenv init -)"
.
https://github.com/pyenv/pyenv/blob/master/README.md#basic-github-checkout
from pyenv-installer.
After installing the follow message appears
WARNING: seems you still have not added 'pyenv' to the load path.
# See the README for instructions on how to set up
# your shell environment for Pyenv.
# Load pyenv-virtualenv automatically by adding
# the following to ~/.bashrc:
eval "$(pyenv virtualenv-init -)"
Still fail to find pyenv after add "eval $(pyenv virtualenv-init -)"
to .bashrc or .profile
I had to manually add to .bashrc
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init --path)"
eval "$(pyenv virtualenv-init -)"
from pyenv-installer.
Here's what happens when you follow the directions in the README on Ubuntu 21.10:
$ sudo apt install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev \
libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev \
liblzma-dev python3-openssl git && echo 'Success'
Success
$ curl https://pyenv.run | bash
[snip]
WARNING: seems you still have not added 'pyenv' to the load path.
# See the README for instructions on how to set up
# your shell environment for Pyenv.
# Load pyenv-virtualenv automatically by adding
# the following to ~/.bashrc:
eval "$(pyenv virtualenv-init -)"
$ echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc
$ exec $SHELL
$ pyenv
Command 'pyenv' not found, did you mean:
command 'p7env' from deb libnss3-tools (2:3.61-1ubuntu2)
Similar problem when doing the same on Arch.
This was solved by copying and pasting the following into my ~/.bashrc
from the "Uninstall" section of the README:
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init --path)"
eval "$(pyenv virtualenv-init -)"
I agree with @davetapley's points.
from pyenv-installer.
WARNING: seems you still have not added 'pyenv' to the load path.
# See the README for instructions on how to set up
Which README? Where? The README for this repo?
from pyenv-installer.
reinstalled clean ubuntu 20.04 LTS on wsl2, installed dependencies, ran script,
$ pyenv
Command 'pyenv' not found
from pyenv-installer.
after following those instructions and restarting the terminal, I'm able to use pyenv but when I exit the terminal I get the error The terminal process "bash" terminated with exit code: 1.
as mentioned here: pyenv/pyenv#1994
from pyenv-installer.
@connerxyz were you able to fix it by adding the code to your .profile and .bashrc or did you still have the exit error code 1 issue? Are you using vscode with wsl2 ubuntu 20.04 LTS also?
from pyenv-installer.
have a look at the first solution in the link below
from pyenv-installer.
@cchanzl I tried the instructions there but still have the error code 1 #103 (comment)
The terminal process "bash" terminated with exit code: 1.
from pyenv-installer.
more context:
ApeWorX/ape#105
from pyenv-installer.
This still looks broken for me?
Did it ever work?
From what I see in the code, Pyenv-Installer didn't ever edit shell startup files automatically.
from pyenv-installer.
The script change worked for me.
from pyenv-installer.
fixed by manually adding to
~/.bashrc
the lines:
Check Pyenv's and Pyenv-Virtualenv's README for the proper setup. With the code you gave, pyenv activate
won't work.
E.g. for Ubuntu, that'll be (as of this writing):
sed -Ei -e '/^([^#]|$)/ {a \
export PYENV_ROOT="$HOME/.pyenv"
a \
export PATH="$PYENV_ROOT/bin:$PATH"
a \
' -e ':a' -e '$!{n;ba};}' ~/.profile
echo 'eval "$(pyenv init --path)"' >>~/.profile
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc
Then restart your login session.
from pyenv-installer.
@anton-petrov it seems like the issue should be reopened: as it stands, the README for this project is incorrect, pyenv
command won't work by itself after the installation
from pyenv-installer.
from pyenv-installer.
I was able to get it to activate with this
# pyenv
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
however it still is broken when trying to install it uses the wrong path
Running setup.py develop for eth-ape
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/sabotage/ape/ape/setup.py'"'"'; __file__='"'"'/home/sabotage/ape/ape/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps --user --prefix=
cwd: /home/sabotage/ape/ape/
Complete output (18 lines):
running develop
WARNING: The user site-packages directory is disabled.
error: can't create or remove files in install directory
The following error occurred while trying to add or remove files in the
installation directory:
[Errno 2] No such file or directory: '/usr/lib/python3.8/site-packages/test-easy-install-14112.write-test'
The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
/usr/lib/python3.8/site-packages/
This directory does not currently exist. Please create it and try again, or
choose a different installation directory (using the -d or --install-dir
option).
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/sabotage/ape/ape/setup.py'"'"'; __file__='"'"'/home/sabotage/ape/ape/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps --user --prefix= Check the logs for full command output.
from pyenv-installer.
from pyenv-installer.
tried these commands and it didn't resolve the issue
rm -rf ~/.pyenv
sudo apt install zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev tk-dev libssl-dev llvm \
libncurses5-dev libncursesw5-dev xz-utils libffi-dev liblzma-dev python-openssl
curl -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash
pyenv update
pyenv install 3.8.12
pyenv virtualenv 3.8.12 apeworx
from pyenv-installer.
closing as I have gotten this to work. please reopen if anyone still faces issue.
from pyenv-installer.
I added my note on how I get it to work on RL8 in #103 (comment) .
from pyenv-installer.
It worked by following the instructions in pyenv README for manual installation... but why use the installer then?
Or -at least- why the installer is not suggesting that one should read that section?
For Bash:
If your ~/.profile sources ~/.bashrc (Debian, Ubuntu, Mint):
# the sed invocation inserts the lines at the start of the file
# after any initial comment lines
sed -Ei -e '/^([^#]|$)/ {a \
export PYENV_ROOT="$HOME/.pyenv"
a \
export PATH="$PYENV_ROOT/bin:$PATH"
a \
' -e ':a' -e '$!{n;ba};}' ~/.profile
echo 'eval "$(pyenv init --path)"' >>~/.profile
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
from pyenv-installer.
Here's what happens when you follow the directions in the README on Ubuntu 21.10:
$ sudo apt install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev \ libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev \ liblzma-dev python3-openssl git && echo 'Success' Success $ curl https://pyenv.run | bash [snip] WARNING: seems you still have not added 'pyenv' to the load path. # See the README for instructions on how to set up # your shell environment for Pyenv. # Load pyenv-virtualenv automatically by adding # the following to ~/.bashrc: eval "$(pyenv virtualenv-init -)" $ echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc $ exec $SHELL $ pyenv Command 'pyenv' not found, did you mean: command 'p7env' from deb libnss3-tools (2:3.61-1ubuntu2)Similar problem when doing the same on Arch.
This was solved by copying and pasting the following into my
~/.bashrc
from the "Uninstall" section of the README:export PATH="$HOME/.pyenv/bin:$PATH" eval "$(pyenv init --path)" eval "$(pyenv virtualenv-init -)"I agree with @davetapley's points.
The same for me.
Have to add these lines manually to .bashrc on Linux Mint 20.1
from pyenv-installer.
fixed by manually adding to
~/.bashrc
the lines:Check Pyenv's and Pyenv-Virtualenv's README for the proper setup. With the code you gave,
pyenv activate
won't work.E.g. for Ubuntu, that'll be (as of this writing):
sed -Ei -e '/^([^#]|$)/ {a \ export PYENV_ROOT="$HOME/.pyenv" a \ export PATH="$PYENV_ROOT/bin:$PATH" a \ ' -e ':a' -e '$!{n;ba};}' ~/.profile echo 'eval "$(pyenv init --path)"' >>~/.profile echo 'eval "$(pyenv init -)"' >> ~/.bashrc echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrcThen restart your login session.
I'm using Fedora 35 with bash
, so I used the "appropriate" command under 'Configure your shell's environment for Pyenv', but I am experiencing the same issues as everyone else in this thread. There seems to be something wrong with how and/or where it is being defined. I managed to get around it by just adding source ~/.profile
to my .bashrc
.
from pyenv-installer.
yep, broken
from pyenv-installer.
I am still having this issue.
from pyenv-installer.
This was solved by copying and pasting the following into my~/.bashrcfrom the"Uninstall" section of the README:
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init --path)"
eval "$(pyenv virtualenv-init -)"
deepin 20.8
from pyenv-installer.
There is still the
WARNING: seems you still have not added 'pyenv' to the load path.
output of the installer script.
This is misleading as it implies I should have adapted the PATH
before running the installer.
But I obviously can't do that if I need to run pyenv init
for determining the PATH
value.
from pyenv-installer.
Still have the issue
Distributor ID: Ubuntu
Description: Ubuntu 22.04.4 LTS
Release: 22.04
Codename: jammy
$ 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 513 0 --:--:-- --:--:-- --:--:-- 514
Cloning into '/home/dummy/.pyenv'...
remote: Enumerating objects: 1242, done.
remote: Counting objects: 100% (1242/1242), done.
remote: Compressing objects: 100% (689/689), done.
remote: Total 1242 (delta 727), reused 707 (delta 420), pack-reused 0
Receiving objects: 100% (1242/1242), 618.36 KiB | 3.89 MiB/s, done.
Resolving deltas: 100% (727/727), done.
Cloning into '/home/dummy/.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.72 KiB | 1.61 MiB/s, done.
Resolving deltas: 100% (1/1), done.
Cloning into '/home/dummy/.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/dummy/.pyenv/plugins/pyenv-virtualenv'...
remote: Enumerating objects: 63, done.
remote: Counting objects: 100% (63/63), done.
remote: Compressing objects: 100% (56/56), done.
remote: Total 63 (delta 11), reused 29 (delta 0), pack-reused 0
Receiving objects: 100% (63/63), 41.13 KiB | 2.06 MiB/s, done.
Resolving deltas: 100% (11/11), done.
WARNING: seems you still have not added 'pyenv' to the load path.
bash: line 88: /home/dummy/.pyenv/bin/pyenv: Permission denied
bash: line 89: /home/dummy/.pyenv/bin/pyenv: Permission denied
from pyenv-installer.
Still have the issue
Distributor ID: Ubuntu Description: Ubuntu 22.04.4 LTS Release: 22.04 Codename: jammy
$ 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 513 0 --:--:-- --:--:-- --:--:-- 514 Cloning into '/home/dummy/.pyenv'... remote: Enumerating objects: 1242, done. remote: Counting objects: 100% (1242/1242), done. remote: Compressing objects: 100% (689/689), done. remote: Total 1242 (delta 727), reused 707 (delta 420), pack-reused 0 Receiving objects: 100% (1242/1242), 618.36 KiB | 3.89 MiB/s, done. Resolving deltas: 100% (727/727), done. Cloning into '/home/dummy/.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.72 KiB | 1.61 MiB/s, done. Resolving deltas: 100% (1/1), done. Cloning into '/home/dummy/.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/dummy/.pyenv/plugins/pyenv-virtualenv'... remote: Enumerating objects: 63, done. remote: Counting objects: 100% (63/63), done. remote: Compressing objects: 100% (56/56), done. remote: Total 63 (delta 11), reused 29 (delta 0), pack-reused 0 Receiving objects: 100% (63/63), 41.13 KiB | 2.06 MiB/s, done. Resolving deltas: 100% (11/11), done. WARNING: seems you still have not added 'pyenv' to the load path. bash: line 88: /home/dummy/.pyenv/bin/pyenv: Permission denied bash: line 89: /home/dummy/.pyenv/bin/pyenv: Permission denied
Check pyenv/pyenv#332 (comment)
Can be helpful for this issue.
from pyenv-installer.
Related Issues (20)
- Link in pyenv.run comment is broken HOT 1
- Failure to install under Windows Subsystem Linux (WSL 2) and Debian 11 HOT 3
- Change default installation location? HOT 1
- Installation of specific version of pyenv HOT 2
- Pyenv not properly working on Armbian. Possible bug? HOT 1
- Still see system /usr/bin/python after activation HOT 3
- pyenv.run is offline HOT 4
- Failed to git clone https://github.com/pyenv/pyenv-installer.git HOT 3
- How to install a particular release/commit? HOT 2
- Carrrige return error on WSL HOT 2
- Add documentation for default plugins installed HOT 2
- Installer not working on MacOS 12.6.1 HOT 4
- Offline installer repo paths fail to clone HOT 1
- Safety of remote script execution HOT 3
- -bash: pyenv: command not found HOT 1
- Need an one line command to install pyenv HOT 1
- pyenv.run Connection Refused, direct link works HOT 4
- Error: curl: (28) Failed to connect to raw.githubusercontent.com port 443 after 130271 ms: Couldn't connect to server HOT 5
- Error: Running Homebrew as root is extremely dangerous and no longer supported. As Homebrew does not drop privileges on installation you would be giving all build scripts full access to your system. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyenv-installer.