Code Monkey home page Code Monkey logo

Comments (9)

obestwalter avatar obestwalter commented on August 31, 2024

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.

tigerinus avatar tigerinus commented on August 31, 2024

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.

obestwalter avatar obestwalter commented on August 31, 2024

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.

tigerinus avatar tigerinus commented on August 31, 2024

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.

obestwalter avatar obestwalter commented on August 31, 2024

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.

tigerinus avatar tigerinus commented on August 31, 2024

@obestwalter Thanks so much!

from pyenv-installer.

obestwalter avatar obestwalter commented on August 31, 2024

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.

obestwalter avatar obestwalter commented on August 31, 2024

Closing as not an installer issue.

from pyenv-installer.

sebma avatar sebma commented on August 31, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.