Comments (9)
Hi @tigerinus, the location where the Python interpreters are installed and the location where the pyenv command is installed are two different things.
Currently when using installer with sudo, Python is installed under /root.
This sounds to me that you need the interpreter to be installed somewhere else, correct? Did you see: https://github.com/pyenv/pyenv#locating-the-python-installation?
from pyenv-installer.
You r right. I made my own change to pyenv installer and then realized pyenv is still looking under /root/.pyenv.
I don't know what should I be looking at in the link. As a debian user, I just want latest Python installed globally. The latest Python on Debian is still 3.5 but I have to work with some Python written in 3.7.
from pyenv-installer.
That link shows where the interpreters are located. You can change the <pyenv root>
part of it (by setting PYENV_ROOT
) so you could set that to wherever makes your daemon happy.
from pyenv-installer.
It's not my daemon. I could hack it to make it work obviously. But referring Python from a user directory for global use is just not a best practice to me.
from pyenv-installer.
It's not my daemon.
I didn't mean that literally ... I don't even think it is legal to own daemons 😆.
But referring Python from a user directory for global use is just not a best practice to me.
The original idea of pyenv was to give the user without sudo rights a chance to conveniently compile and install Python interpreters into their user directory and easily switch between them. So from the perspective of pyenv how I understand it, nstalling it with sudo
is a bit of an exotic approach. If you have sudo rights there are other ways how to install interpreters into the "normal" directory according to the philosophy of the distro (usually meaning you compile the interpreter yourself and put it in the proper place).
Having said that: it might be worth exploring that idea to let pyenv grow the functionality to do Python installations for you and put them in a custom place, when you have superuser rights, simply because it is more connvenient than doing it by hand. I am not using Debian directly anymore for a long time, so I had a look and it's apparently still a lot of manual steps to install a newer Python (as opposed to e.g. ubuntu, where you could use the deadsnakes ppa).
IMO this is not really an installer topic though, but belongs over to pyenv. I would try to transer this issue over to pyenv if you don't mind (that github functionality is still beta though, so I don't know if it will work). If that doesn't work, you can open a new one referring to this discussion.
from pyenv-installer.
@obestwalter Thanks so much!
from pyenv-installer.
No problem, but no luck, I guess I would need to admin in pyenv, so please open a new issue there referencing this one: https://github.com/pyenv/pyenv
from pyenv-installer.
Closing as not an installer issue.
from pyenv-installer.
@obestwalter It seems git always wants to clone inside an empty directory :
$ curl -s https://pyenv.run | sudo PYENV_ROOT=/usr/local bash
WARNING: Can not proceed with installation. Kindly remove the '/usr/local' directory first.
So I did this instead :
$ curl -s https://pyenv.run | sudo PYENV_ROOT=/usr/lib/pyenv bash
Cloning into '/usr/lib/pyenv'...
remote: Enumerating objects: 701, done.
remote: Counting objects: 100% (701/701), done.
remote: Compressing objects: 100% (530/530), done.
remote: Total 701 (delta 358), reused 263 (delta 79), pack-reused 0
Receiving objects: 100% (701/701), 390.80 KiB | 1.46 MiB/s, done.
Resolving deltas: 100% (358/358), done.
Cloning into '/usr/lib/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 2 (delta 0), pack-reused 0
Receiving objects: 100% (11/11), 38.64 KiB | 460.00 KiB/s, done.
Resolving deltas: 100% (1/1), done.
Cloning into '/usr/lib/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 8 (delta 0), pack-reused 0
Receiving objects: 100% (16/16), 6.01 KiB | 6.01 MiB/s, done.
Resolving deltas: 100% (1/1), done.
Cloning into '/usr/lib/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 6 (delta 0), pack-reused 0
Receiving objects: 100% (10/10), done.
Resolving deltas: 100% (1/1), done.
Cloning into '/usr/lib/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 21 (delta 0), pack-reused 0
Receiving objects: 100% (57/57), 34.88 KiB | 637.00 KiB/s, done.
Resolving deltas: 100% (11/11), done.
Cloning into '/usr/lib/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.
# Load pyenv automatically by adding
# the following to ~/.bashrc:
export PATH="/usr/lib/pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
And finally I created a symlink just like in the Ubuntu Xenial rbenv
package :
$ cd /usr/bin/ && sudo ln -vs ../lib/pyenv/libexec/pyenv
‘./pyenv’ -> ‘../lib/pyenv/libexec/pyenv’
Here is what I get :
$ which pyenv
/usr/bin/pyenv
$ eval "$(pyenv init -)"
$ pyenv versions
* system (set by /home/sebastien/.pyenv/version)
$ pyenv root
/home/sebastien/.pyenv
$ ls $(pyenv root)
shims/ versions/
$ eval "$(pyenv virtualenv-init -)"
pyenv: no such command `virtualenv-init'
Is this the right way to install pyenv systemwide ?
from pyenv-installer.
Related Issues (20)
- Pyenv installer does not add to path HOT 45
- 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.