Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    Burak Can Kahraman
    @agoose77 Yeah apparently I should manually add shims path to my PATH. IMHO the user at least should be notified if something is necessary for pyenv to work correctly following the installation. And again I realized it has nothing to do with pyenv :) Thanks for the answer though !

    Hey there, I wish you a nice day! Thanks for pyenv!

    If I want to build python with optimizations enabled I use for example:
    CONFIGURE_OPTS="--enable-optimizations" pyenv install 3.7.7

    How can I also pass the Information to use multiple cores (like make -j8)? Is this possible?

    Hi everyone, I need some help with pyenv.
    After arch update, pyenv just stopped working.
    It is probably not an issue with pyenv. But I have no idea what's going on.
    Has anyone seen issue like this?
     » pyenv install 3.8.2
    Downloading Python-3.8.2.tar.xz...
    -> https://www.python.org/ftp/python/3.8.2/Python-3.8.2.tar.xz
     Installing Python-3.8.2...
    BUILD FAILED (Arch Linux using python-build 20180424)
    Inspect or clean up the working tree at /tmp/python-build.20200425123545.346823
    Results logged to /tmp/python-build.20200425123545.346823.log
    Last 10 log lines:
    If you want a release build with all stable optimizations active (PGO, etc),
    please run ./configure --enable-optimizations
    gcc -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall    -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration  -I./Include/internal  -I. -I./Include -I/home/rok/.pyenv/versions/3.8.2/include  -I/home/rok/.pyenv/versions/3.8.2/include   -DPy_BUILD_CORE -o Programs/python.o ./Programs/python.c
    make: gcc: Permission denied
    make: *** [Makefile:772: Programs/python.o] Error 127
    make: *** Waiting for unfinished jobs....
    Burak Can Kahraman
    Have you tried doing the suggested clean up ? @aca
    No problem on my side, using arch and pyenv works just fine.

    I have been using pyenv for managing python versions and virtual environments on my mac for some time now.
    Recently I reinstalled pyenv and since then on every pyenv command I try to run, I get the following error

    /usr/local/bin/pyenv:94: command not found: shopt

    My default shell is the latest MacOS's default shell i.e. zsh.
    On searching for the fix, I found out it has something to do with bash interfering with the zsh.
    My default shell is zsh in settings, the contents of ~/.bash_profile, /etc/profile & /etc/bashrc are all commented out but I am still having the issue.
    My OS Verion is: 10.15.4.
    I tried reinstalling pyenv as well but I am getting the same error.
    I am unable to run ANY pyenv related command, can anyone please help? Is this a pyenv issue?

    Should I create an issue on github? If there's no solution to this?
    Burak Can Kahraman
    try running it within bash and maybe try running shopt itself ?
    @denekthanyjana_twitter ^
    hi @burakcank, when I switch to bash and run shopt, I can see the command exists but when I run any pyenv command, it gives the exact same error.
    Burak Can Kahraman
    Your problem sounds exactly similar to the problem in this link and the suggested solution is probably what you are looking for.
    Burak Can Kahraman
    adding export PATH=/usr/local/bin:$PATH to your .zshenv would probably solve your issue.
    basically you need to make sure zsh is able to reach to locations where other programs are installed.

    @burakcank I switched to bash as shopt command was working in bash, and I added

    export PATH=/usr/local/bin:$PATH

    as the first line in my ~/.bash_profile, but I still got the same error. i.e.

    /usr/local/bin/pyenv:94: command not found: shopt

    As you can see it's not having trouble finding the pyenv command, pyenv command is there in /usr/loca/bin and the terminal is picking it up from there from $PATH, the problem is in pyenv not being able to find the shopt command it seems like, when shopt command is there as I can see by running shopt on the terminal.

    Burak Can Kahraman
    @denekthanyjana_twitter I am assuming you have restarted your pc after modifying your bash_profile or sourced it in the same shell session right ?
    Burak Can Kahraman
    Quote "shopt is not a command, but a shell built-in. bash knows what to do with it because it's a bash built-in , but zsh has no idea what it is. You'll want to look into setopt which is a zsh Built-in, and put those values into a new .zshrc script."
    I realized after running which shopt which failed for obvious reasons and came across with this.
    Burak Can Kahraman
    It's interesting that pyenv is trying to use a built-in command for bash. Basically pyenv is not aware that you are using zsh instead of bash in the first place.
    So this is the first thing you should solve I guess.

    @denekthanyjana_twitter I am assuming you have restarted your pc after modifying your bash_profile or sourced it in the same shell session right ?

    yes of course, i sourced it, even restarted terminal. Did not restart PC though, as that might be an overkill.

    It's interesting that pyenv is trying to use a built-in command for bash. Basically pyenv is not aware that you are using zsh instead of bash in the first place.

    as I mentioned above, I am having this problem with bash as well. I tried all of the above with bash. I am using bash, pyenv should work with that at least. I don't understand why pyenv is unable to find shopt command (if it uses it) when I can easily see it in my bash terminal)

    I realized after running which shopt which failed for obvious reasons and came across with this.

    instead of which shopt, just do shopt and you will see. Although that will only work in bash terminal, as it's a bash built-in command.

    Burak Can Kahraman
    @denekthanyjana_twitter based on your installation process pyenv might be trying to spawn a zsh session and find shopt in there. We don't know what pyenv is doing, and since you haven't restarted your pc and only sourced bash_profile in your terminal it does not alter your environment for all of the bash sessions at all. When you change ~/.bash_profile you should restart your pc for it to take effect for all bash processes, because .bash_profile gets sourced when you login, you should at least logout and login.
    @denekthanyjana_twitter As best practice if you are using zsh as default, let's try to solve the problem through zsh and not bash. You won't be spawning bash just for pyenv.

    Okay @burakcank, zsh it is then.
    I restarted my mac as you said.
    Here's the output of my $ echo $PATH


    As you can see /usr/local/bin is there which is the location of pyenv. Still having the same problem.

    19 replies
    Angus Hollands
    This message was deleted
    Niraj Lama
    Hi I have followed every step from github
    but when I try to see my python version it is still in the default of the mac os
    I am using macOs Catalina
    Is it just for me or everyone
    2 replies

    Hi, I am a new pyenv user and got a bit stuck. I posted this (https://bit.ly/3dQjnpF) on stackoverflow but did not get a response. Maybe someone here could help me? Everything works fine until I try to activate the virtual environment, it then says

    Failed to activate virtualenv.

    Perhaps pyenv-virtualenv has not been loaded into your shell properly.
    Please restart current shell and try again.

    I think my problem is twofold. I changed from bash to zsh mid way and I think I managed to make a big mess of the zshrc file. It currently looks like I shared in StackOverflow.

    Is this the place to ask this question?


    1 reply
    Jim Kopps

    When I try to install python using 'pyenv install 3.8.0" (I tried many versions, but lets go with python 3.8.0) it fails almost immediately and the only thing in my log is:

    curl: (56) OpenSSL SSL_read: error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac, errno 0

    Both OpenSSL and curl are up to date and I have everything installed that I would need to build python. Please let me know if there is any additional information that would be helpful. I have looked through the issues on the pyenv git page. I also asked the question on stack overflow, but have gotten no response. Does anyone have any thoughts or solution?


    1 reply
    I am using POP OS 20.04

    Hi, I have followed every installation steps written at github.
    But I have failed to install miniconda3-4.7.12 to SINGLE CPU VM of Ubuntu Server 20.04. The installation stopped without CPU usage.

    The installation log is here: https://gist.github.com/gotoloop1/44f54acdd08e9e063e3f42e12751748d
    Then I stopped build with Ctrl+C. The additional logs is here: https://gist.github.com/gotoloop1/06a711576e53ba36db99ddb727fd50ca
    The content of /tmp/python-build.20200601134947.1248 is here: https://gist.github.com/gotoloop1/f6575cb727af8f1db03703997fd5508e

    This problem does not happen when I install miniconda3-4.7.10 or miniconda3-latest. It also does not happen when I increase the VM CPU.

    Same problem happens on Docker.
    Use this Dockerfile( https://gist.github.com/gotoloop1/8b7f44c5f141bb61674e344aceac6bce ) and run docker build . --cpuset-cpus="0", I got same error.

    Is this new bug, or already known?
    I have looked the pyenv issues page, but could not find same bug.


    Philippe Ombredanne
    @techtheory that sounds like an installation issue. Curl installation may be damaged? or some man in the middle of sorts?
    Daniel Watson

    Hey folks, I think my pyenv installation has been borked past the point of return. What's the best way to scrub it from my machine and start again?

    I'm guessing brew uninstall, then delete all environment folders called "
    Remove all references to my path and then starting again

    Philippe Ombredanne
    and check your dot files too
    Daniel Watson
    Cool, I deleted everything and started fresh, but I'm still in the same place

    which pyenv returns: pyenv () { local command command="${1:-}" if [ "$#" -gt 0 ] then shift fi case "$command" in (activate | deactivate | rehash | shell) eval "$(pyenv "sh-$command" "$@")" ;; (*) command pyenv "$command" "$@" ;; esac }

    And it's driving me nuts

    I removed everything Python on Mac ( except /System/Libraries/blahhh/Python2.XXX which you should never, ever remove)

    brew uninstalled pyenv, pyenv-virtualenv, python, pip the lot!

    Philippe Ombredanne
    Daniel Watson
    Yeah it's really killing my buzz hahaha I'm tearing my hair out trying to figure out why and where it's calling to arrive at that answer!
    So for context, I reinstalled pyenv, pyenv-virtualenv and dependencies so I started fresh. pyenv itself looks like it's working as expected, but that which command just confuses the hell out of me, which makes me assume it's not completely working
    I have upgrade to ubuntu 20 and there is something strange with pyenv. When I run it with pyenv I have core dump. When I run with bash -c pyenv it works. I have removed all python2 from my linux and have delete and install the latest pyenv from master. would be happy if someone can give me a hint how to investigate

    Hi all. I'm trying to downgrade sqlite3.sqlite_version for Python 3.4 to run some tox tests, and am having no luck. I'm on Ubuntu 20.04. I was able to successfully upgrade it to 3.32.1 with:

    PYTHON_CONFIGURE_OPTS="LD_RUN_PATH=/home/linuxbrew/.linuxbrew/Cellar/sqlite/3.32.1/lib LDFLAGS=-L/home/linuxbrew/.linuxbrew/Cellar/sqlite/3.32.1/lib CPPFLAGS=-I/home/linuxbrew/.linuxbrew/include" pyenv install 3.4.8

    When I try to install an old formula for 3.25 or 3.24, I always wind up with 3.31.1 (the Ubuntu system version of libsqlite3-dev). I can't downgrade libsqlite3-dev since it's a dependency for a bunch of other system packages. I'm assuming it's my poor understanding of the flags I'm attempting to pass to the compilation process, but I don't know for sure.

    If I drop the CPPFLAGS variable altogether, I'm able to get it to not compile _sqlite3 at all, but when I point it to the value from snippet above, or to /include in separately compiled sqlite3 3.25/3.24, or any of the other combinations I've tried, I still end up with 3.31.1.

    Thanks in advance for any light you can shed on this, even if it's just pointing to helpful resources.

    1 reply
    I'd like to use poetry along with pyenv, and noticed something that might confuses me. When pyenv virtualenv creates a new virtualenv, it places it in the versions directory, and then creates a symlink into the python version that it was created with. This isn't usual with the tools I've used in the past. I would like to understand the benefit of the symlink so I can make an informed decision about bringing poetry into the picture. What is the purpose of that link? Could I just manually create the link myself, or does it matter if it exists? TIA!
    Jerry Morrison

    Hello everybody! I'm installing Python 3.8.3 on centos 3.10.0-957.27.2.el7.x86_6 but it fails to import readline. This is a shared compute cluster where I can't run a package installer or sudo. The key build message is:

    *** WARNING: renaming "readline" since importing it failed: /home/groups/blah.../lib/libreadline.so.8: undefined symbol: UP

    The 3rd and 4th repetitions of that warning in the build log, it's followed with:

    INFO: Could not locate ffi libs and/or headers

    and stuff I don't understand about "necessary bits to build these optional modules".

    The build command looks like

    CFLAGS="-I/home/groups/blah.../include -I/share/software/user/open/sqlite/3.18.0/include" \
    LDFLAGS="-L/home/groups/blah.../lib -L/home/groups/blah.../lib64" \
    LD_LIBRARY_PATH="/home/groups/blah.../lib:/home/groups/blah.../lib64:$LD_LIBRARY_PATH" \
    SSH=/home/groups/blah... \
    CONFIGURE_OPTS="--enable-optimizations" \
    PYTHON_CONFIGURE_OPTS="--enable-shared" \
    pyenv install -f -v 3.8.3

    This is after compiling libressl, readline, and libffi from source and installing them into that blah... directory.

    Any suggestions? TIA!

    Lano P

    if I am using macos and installed pyenv with brew, do I need to set PYENV_ROOT, when I am in nvim and do :checkhealth it says that peen_root is not set.

    I know documentatioan says when installing with home-brew, starting with #3 ("Add pyenv init to your shell) but that doesn’t set the ROOT_PYENV.

    Sebastian Gniazdowski
    Hi. I'm getting the BUILD FAILED message and pyenv global {the-version} says that it's not installed, however the build log says that Python build finished successfully! and that it performed the installation and also installed the setuptools. What can be the reason of the error message and of the build being invisible to pyenv? The complete build log is here: http://sprunge.us/2XBBe0
    Sebastian Gniazdowski
    Ok, it's solved: my openssl was too old for that python version, but an older one installed OK.