Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Philippe Ombredanne
    @pombredanne
    @seandstewart did you upgrade? Try the latest from master
    https://github.com/pyenv/pyenv/compare/v1.2.20...master
    Thanks to @ashwinvis :)
    Mark
    @markfaine
    Hi everyone, I am trying to configure pyenv so that anyone on the team can use it. My goal is to make it simple for a team not very familiar with python to use any version of python they may need and to do so as transparently as possible with sane defaults. I've installed it to /opt/python/.pyenv but here is the heart of my question. How can I configure it so that when someone logs in with their PYENV_ROOT set to /opt/python/.pyenv their virtualenvs go to a different location and not under $PYENV_ROOT/versions? For example, in their home directory. Basically I'm attempting to configure it with a shared .pyenv with shared python installations but user specific virtual environments based on those python versions.
    Angus Hollands
    @agoose77
    I imagine one way is to symlink the global version into the user pyenv dir
    Alexander Gehrke
    @crater2150
    Hi. Is there a way to upgrade the pip version globally, so that new virtualenvs created use that version? I tried upgrading while having the python version used as base for the envs as global, but creating a venv after that still uses the old pip version.
    Mark
    @markfaine

    I imagine one way is to symlink the global version into the user pyenv dir

    Yeah, that's what I've been doing, or just moving them entirely to the user's home directory. I'd like a more correct and automated way of doing it. As it is now, we will seriously clutter the PYENV_ROOT directory.

    Hi. Is there a way to upgrade the pip version globally, so that new virtualenvs created use that version? I tried upgrading while having the python version used as base for the envs as global, but creating a venv after that still uses the old pip version.

    There is a pyenv plugin that lets you set default installed modules, perhaps it might also upgrade those modules? I'm not sure.

    Tomás Farías Santana
    @tomasfarias
    Hi all :wave: wanted to install the new Python 3.9.0 to try it out, but it seems the version is not yet available when I check pyenv install --list (latest appears to be 3.9.0-dev). Although I have been loving it so far, I am fairly new to pyenv so I still don't know how new versions become available, is there a PR that needs to happen? I am running the latest pyenv version. Thanks!
    Chris Barnes
    @clbarnes
    hi all, I've had a PR up for a while which makes it trivial to test new python build scripts - any chance of a review? the changelog is small pyenv/pyenv#1548
    backendbee
    @backendbee
    Hi all, I am trying to setup a symbolic link using ln -s /Users/u1/.pyenv/versions/prj1/bin/python3 /usr/local/bin/py3 but when I activate prj1 and run command py3 -m pip freeze it return empty. What can I be missing?
    Andrew Annex
    @AndrewAnnex
    hey all, I use pyenv with travis ci for my project, but recently I had timeouts with updating pyenv using homebrew which I now see is not recommended anyways. But it also seems that I can't update pyenv using git because it was installed with homebrew (no .git directory at root). Is there a preferred way to update pyenv for CI jobs on services like travis?
    Alexander Gehrke
    @crater2150
    Hi. I've recently removed my system python2. now when calling pip using the system python, I get home/crater2150/.local/share/pyenv/pyenv.d/exec/pip-rehash/pip: /home/crater2150/.local/bin/pip: /usr/bin/python2: bad interpreter: No such file or directory. Curiously, calling the python shim works and starts my system python, and so do various other system commands that have a shim, only pip seems broken.
    Could this be some caching problem? I already tried pyenv rehash.
    (FWIW, /usr/bin/python is a symlink to python3, there isn't any reference to python2 left in my /usr/bin)
    Philippe Ombredanne
    @pombredanne
    @crater2150 which OS?
    (or rather which distro)
    Alexander Gehrke
    @crater2150
    I'm using void-linux
    there is also a working /usr/bin/pip, it just isn't recognized via the shim (or rather, executed with the wrong, nonexistent python)
    Philippe Ombredanne
    @pombredanne
    I am not familiar with void, but my hunch is that removing system python2 is the root of the probelm, not pyenv
    worst case, I would whack the local pyenv and reinstall from git
    Alexander Gehrke
    @crater2150
    ah, reinstalling changed the problem, pip now threw that error, but without the part with a pyenv-related path, and afterwards ran the right pip o.O
    It seems, that the pip in ~/.local/bin was the problem, I'm not sure, how that ended up there, probably the system pip2 installed it.
    Philippe Ombredanne
    @pombredanne
    @crater2150 :P
    Alexander Gehrke
    @crater2150
    @pombredanne so you were right, it wasn't actually pyenv-related. Thanks
    Philippe Ombredanne
    @pombredanne
    @crater2150 I am crass at some many things, but somehow, once in a while, I have a decent intuition. I should work in tech support.
    @crater2150 nice profile pic BTW. You look like my cousin.
    Kent Brockman
    @KentBrockman

    hey all. I've got some beef between pyenv and ansible. I understand where the problem is coming from, but I'm unsure how to fix it. Looking for some ideas. Some details:

    ansible is being installed from my system package manager (im on pop os 20.04, based off ubuntu 20.04) to /usr/bin. pyenv is installed to ~ using the github checkout method.
    Now, when I run eval "$(pyenv init -)" pyenv modifies my PATH to use the shim'd python executable before system python. this is what is is supposed to do. but now when i execute ansible, I get this error: ModuleNotFoundError: No module named 'ansible' - which is totally understandable as ansible isn't installed to pyenv's python environment.

    my question is...how should I manage this? is there a way to 'force' ansible to use the system python install? is there a way to set pyenv init - to append ~/.pyenv/shim to PATH instead of prepending it? this allows the shebang in the ansible system install script to work properly...but i suppose this is nonideal because it exposes system python in some way. should I just suck it up and setup an ansible virtualenv/pyenv environment and just use that?
    is there a simple solution to all of this that I'm not seeing?

    Philippe Ombredanne
    @pombredanne
    Personally when I use pyenv I do not use system Python or something that depends on it
    When I use Ansible with a pyenv Python, I install ansible in a virtualenv in that "virtual" Python env
    Kent Brockman
    @KentBrockman
    thanks for the insight @pombredanne. Sounds like that may be the way to go
    Maybe the way to go - remove eval "$(pyenv init -)" from my startup scripts altogether. and only call it when im working on a python project. then use system python most of the time. certainly a bit annoying but an option.
    Philippe Ombredanne
    @pombredanne
    I have the shim on at all times. But I am using the system python at most times too
    Most distros get itchy if you do a switcheroo on their beloved python version
    Kent Brockman
    @KentBrockman
    @pombredanne oh interesting. are you accessing system python through a shim?
    Philippe Ombredanne
    @pombredanne
    pyenv local system :)
    Kent Brockman
    @KentBrockman

    ah i see

    > pyenv shell system
    pyenv: system version not found in PATH

    For me though :( my distro doesnt ship a python executable anywhere in the path like /usr/bin
    ships with /usr/bin/python3 and /usr/bin/python2 though

    Thanks for the trick nonetheless :)

    Philippe Ombredanne
    @pombredanne
    @KentBrockman IMHO your pyenv installation is damaged
    reinstall
    Kent Brockman
    @KentBrockman
    @pombredanne why do you think that? seems to be working expectedly and pyenv doctor looks OK as well
    Kent Brockman
    @KentBrockman

    to expand on the above @pombredanne - if create a system python link like so sudo ln -s /usr/bin/python3 /usr/bin/python
    Now i get this

    ❯ pyenv shell system
    ❯ which python
    /home/kent/.pyenv/shims/python
    ❯ pyenv which python
    /usr/bin/python

    Is that unexpected behaviour?
    Now whether or not it is smart or safe to manually make that link in /usr/bin is a whole other issue....
    Unsure what is the indicator here that pyenv is buggered up

    That and that I reinstalled earlier this morning
    Burak Can Kahraman
    @burakcank

    For me though :( my distro doesnt ship a python executable anywhere in the path like /usr/bin
    ships with /usr/bin/python3 and /usr/bin/python2 though

    Just symlink python to python2 or python3 based on your preference.

    Oh sorry didn't see the next post.
    If there wasn't any python link before, it shouldn't be an issue.
    Philippe Ombredanne
    @pombredanne
    it is uncommon not to have a /usr/bin/python
    Burak Can Kahraman
    @burakcank
    ❯ pyenv shell system
    ❯ which python
    /home/kent/.pyenv/shims/python
    ❯ pyenv which python
    /usr/bin/python

    Is that unexpected behaviour?

    This is how I use pyenv too, seemed like totally fine to me. You access system python through a shim.

    Kent Brockman
    @KentBrockman
    thanks for the tips guy...seems like that one is the winner for sure
    and yeah philippe I agree. this seems to be a common thing in ubuntu (common enough that theres a whole package for...applying this symlink tweak: https://ubuntu.pkgs.org/20.04/ubuntu-main-armhf/python-is-python3_3.8.2-4_all.deb.html
    @burakcank I seem to be missing a system pip install as well...do you symlink /usr/bin/pip3 ?