Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Ryan Delaney
    @rpdelaney
    Is it possible that this bug is with python? I have not attempted to build python except with pyenv
    Philippe Ombredanne
    @pombredanne
    @rpdelaney Python never liked spaces in the install path
    in general I would strongly discourage spaces in any paths :)
    Ryan Delaney
    @rpdelaney
    Yeah, unfortunately macOS defaults don't follow this
    Jerry Morrison
    @1fish2
    An empty path element can also cause build errors that are hard to debug, e.g. from a startup script that does export CPATH=foo/include:$CPATH before $CPATH gets set.
    It'd save a lot of debugging headaches if pyenv checked for bad paths, libraries required to build python that are missing from the paths, and other known problems.
    Philippe Ombredanne
    @pombredanne
    @1fish2 is this something you would know how to code?
    Jerry Morrison
    @1fish2
    @pombredanne I'm happy to help but this looks beyond my bash skills, pyenv/plugins/python-build/bin/python-build?
    Ryan Delaney
    @rpdelaney
    I'm reasonably comfortable in bash. If someone can point me in a direction I might be able to at least add a check for paths containing whitespace, newlines, or glob characters
    Although the latter is somewhat dependent on shell settings
    I'd suggest simply printing a warning message that the build may fail in case this behavior ever changes upstream
    Jerry Morrison
    @1fish2

    I dug up some history on that empty path element problem.

    Reasonable-looking shell startup code export C_INCLUDE_PATH="${C_INCLUDE_PATH}:${TEAM_HOME}/usr/local/include" ran before anything set C_INCLUDE_PATH, thus setting it to :/share/team/usr/local/include". gcc interprets that as .:/share/team/usr/local/include" which loaded the wrong include file and led to an obscure error message.

    Mark Harris
    @SiliconMeeple
    Hopefully this will sound familiar to someone. I had pyenv installed on ubuntu 20.04 (probably), and a number of successful very usable python installations. I've since updated to 20.10 (or possibly done something else) and now python install anything fails with the below error message.
    I've re-installed pyenv via brew and checked that I've got all the listed python build dependencies (https://github.com/pyenv/pyenv/wiki#suggested-build-environment).
    Unfortunately, every time I run python install for any version, it fails with the following error.
    Any thoughts or advice on how to fix or troubleshoot the problem would be gratefully received:
    
    Downloading Python-3.6.11.tar.xz...
    -> https://www.python.org/ftp/python/3.6.11/Python-3.6.11.tar.xz
    Installing Python-3.6.11...
    
    BUILD FAILED (Ubuntu 20.10 using python-build 20180424)
    
    # ... snipped to last few loglines:
    
        esac; \
         ./python -E -m ensurepip \
            $ensurepip --root=/ ; \
    fi
    Aborted (core dumped)
    make: *** [Makefile:1102: install] Error 134
    Philippe Ombredanne
    @pombredanne
    :| weird for sure
    @SiliconMeeple pyenv/pyenv#1621 ?
    Mark Harris
    @SiliconMeeple
    Following the advice there fixed it! Thank you very much. :-)
    Philippe Ombredanne
    @pombredanne
    :+1:
    Jon Crall
    @Erotemic
    Is there any way to use pyenv (or some other tool) to fetch precompiled python binaries for specific versions? I'm trying to replace conda in my workflow, and the compile time of pyenv is currently a limiting factor in how fast I can setup a machine. Any tips?
    Philippe Ombredanne
    @pombredanne
    @Erotemic pyenv only and exclusively builds from sources.
    You want to look for prebuilt binary packages instead of pyenv (or build your own) ... which OS?
    Jon Crall
    @Erotemic
    Ideally, any modern 64 bit OS, but it would be fine with just x86_64 linux. One of the use cases is that I'm trying to walk non-technical users through installing a Python application. They don't have much patience for compiling code, and sometimes they don't even have the ability to use sudo to install the deps like build-essential. I was using conda to achieve this, but they've changed their license such that it makes it hard to provide a reliable and truly FOSS solution. The other use case that I mentioned is just setting up a machine quickly without having to compile (and pgo optimize) python. (Maybe there is a way to use Conan to do this? I'm not super familiar with the system, so I'm not sure exactly what you can do with it).
    ashwinvis
    @ashwinvis:matrix.org
    [m]
    I made this pyenv plugin recently, which could be useful if you use pyenv-virtualenv and wish to upgrade your virtual environments to a different Python compiler version https://github.com/ashwinvis/pyenv-virtualenv-migrate/. Feedback welcome 🙂
    Philippe Ombredanne
    @pombredanne

    @Erotemic
    The first thing that comes to mind as you seem to be on some Debian linux or derivative (you mentioned buidl-essential) would be the deadsnakes PPA https://launchpad.net/~deadsnakes to get a binary Python package for a given Python version. This would require sudo though.

    The second thing that comes to mind in your case and that could be Linux-distro independent would be AppImage, but that might imply you may need to do the packaging in the first place? there may be some Python appimages to reuse.

    https://appimage.org/ and https://appimage.github.io/apps/ ?

    Snaps and flatpack are of the same style.

    AppImage does NOT require root
    Jon Crall
    @Erotemic
    It is important that I don't require sudo (getting sysadmin to install things I need on computers is a huge pain, my life becomes much easier if I can bypass this). I did not know about AppImage, that looks like it might work.
    Philippe Ombredanne
    @pombredanne
    @Erotemic there are pretty awesome. Linus picked that for installation of his dive log app
    https://subsurface.github.io/download/
    Jon Crall
    @Erotemic
    @pombredanne would it be possible to modify pyenv such that it can use the python-appimage? The idea being that could pyenv install python-appimage-3.9 and then get an appropriate folder in ~/.pyenv/versions? Is there any mechanism to expose the shared library with app-image? IIUC, there would be no way to build or use a c-extension-module with python-appimage that requires loading symbols from the libpython.so, correct?
    kevaad
    @kevaad:matrix.org
    [m]

    Hello everyone. I have problem with my python symlink after activating new venv with pyenv.

    ❯ which python
    /usr/bin/pythonpython -V
    Python 3.9.4
    ❯ which pyenv
    /home/vicky/.pyenv/bin/pyenv
    ❯ pyenv versions
    * system (set by /home/vicky/.pyenv/version)
      3.8.9
    ❯ pyenv which python
    /usr/bin/python
    ❯ pyenv global
    system
    ❯ pyenv global 3.8.9
    ❯ pyenv global
    3.8.9
    ❯ which python
    /usr/bin/python
    ❯ pyenv which python
    /home/vicky/.pyenv/versions/3.8.9/bin/python

    As you see, I still get my original system python version when I do which python even after activating 3.8.9. Can anyone help?

    thanks in advance

    I'm on Ubuntu 21.04 and default python version is 3.9.4
    I have installed python-is-python3 package to get around using python instead of python3
    freephys
    @freephys
    pip install on ubuntu failed after install the dep suggested on python 3.7

    Downloading http://pypi.doubanio.com/packages/98/83/07b67ec0f26f61894ab65cf1e325c2bd8938f8f4379e989ffadedcbb07e1/pyenv-0.0.1.tar.gz (1.4 kB)
    Building wheels for collected packages: pyenv
    Building wheel for pyenv (setup.py) ... error
    ERROR: Command errored out with exit status 1:
    command: /home/ls66635/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/user/1000/pip-install-2bivr697/pyenv/setup.py'"'"'; file='"'"'/tmp/user/1000/pip-install-2bivr697/pyenv/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/user/1000/pip-wheel-cjs6jdk1
    cwd: /tmp/user/1000/pip-install-2bivr697/pyenv/
    Complete output (12 lines):
    running bdist_wheel
    running build
    installing to build/bdist.linux-x86_64/wheel
    running install

    ###################### NOTE

    We are sorry, but this package is not installable with pip.

    Please read the installation instructions at:

    https://github.com/pyenv/pyenv#installation

    #

    ERROR: Failed building wheel for pyenv
    Running setup.py clean for pyenv
    Failed to build pyenv
    Installing collected packages: pyenv
    Running setup.py install for pyenv ... error
    ERROR: Command errored out with exit status 1:
    command: /home/ls66635/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/user/1000/pip-install-2bivr697/pyenv/setup.py'"'"'; file='"'"'/tmp/user/1000/pip-install-2bivr697/pyenv/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/user/1000/pip-record-bcdv1lof/install-record.txt --single-version-externally-managed --compile --install-headers /home/ls66635/anaconda3/include/python3.7m/pyenv
    cwd: /tmp/user/1000/pip-install-2bivr697/pyenv/
    Complete output (9 lines):
    running install

    ############################ NOTE ############################
    We are sorry, but this package is not installable with pip.
    
    Please read the installation instructions at:
    
    https://github.com/pyenv/pyenv#installation
    ##############################################################
    
    ----------------------------------------

    ERROR: Command errored out with exit status 1: /home/ls66635/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/user/1000/pip-install-2bivr697/pyenv/setup.py'"'"'; file='"'"'/tmp/user/1000/pip-install-2bivr697/pyenv/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/user/1000/pip-record-bcdv1lof/install-record.txt --single-version-externally-managed --compile --install-headers /home/ls66635/anaconda3/include/python3.7m/pyenv Check the logs for full command output.

    coxoperationsengineer
    @coxoperationsengineer
    Hello, recently upgraded to 2.0 with brew, standard ZSH on Big Sur, and I don't currently have a .profile or .zprofile, it is unclear from the instructions, should I be creating them?
    Angus Hollands
    @agoose77:matrix.org
    [m]
    @coxoperationsengineer: what configuration files do you have in $HOME ?
    coxoperationsengineer
    @coxoperationsengineer
    @agoose77:matrix.org I have .zshrc only and had the following working until the upgrade
    # Pyenv requirements to attach to shell
    if command -v pyenv 1>/dev/null 2>&1; then
      eval "$(pyenv init -)"
      eval "$(pyenv virtualenv-init -)"
    fi
    Angus Hollands
    @agoose77:matrix.org
    [m]
    is there a bash_profile or bashrc in your $HOME too?
    coxoperationsengineer
    @coxoperationsengineer
    there is but it is empty
    Angus Hollands
    @agoose77:matrix.org
    [m]
    which one do you have?
    coxoperationsengineer
    @coxoperationsengineer
    .bash_profile
    Angus Hollands
    @agoose77:matrix.org
    [m]
    OK. Is that where you would normally set your $PATH variables?
    Also, is ZSH your login shell?
    coxoperationsengineer
    @coxoperationsengineer
    No normally I set them in .zshrc, and yes ZSH is the default login shell now in Mac OS Big Sur on a clean install
    coxoperationsengineer
    @coxoperationsengineer
    @agoose77:matrix.org it also appears that by default there is not a ~/.zprofile in Mac OS, but there is a zprofile in /etc with the following
    # System-wide profile for interactive zsh(1) login shells.
    
    # Setup user specific overrides for this in ~/.zprofile. See zshbuiltins(1)
    # and zshoptions(1) for more details.
    
    if [ -x /usr/libexec/path_helper ]; then
        eval `/usr/libexec/path_helper -s`
    fi
    agoose77
    @agoose77:matrix.org
    [m]
    OK. Let's assume that macosx respects ~/.zprofile, then you just need to modify that file
    However, where are you currently adding pyenv to path?
    coxoperationsengineer
    @coxoperationsengineer

    Generally speaking you can put any settings in ~/.zshrc. It is loaded regardless if the shell is interactive, login, or not. ~/.zprofile does not load for non-login shells, but in macOS the default behavior in the terminal is to launch new shells as a login shell

    So I have my pyenv init statement in ~/.zshrc and have had it there working for almost 2 years, until I got the warning message after brew updated pyenv to 2.0

    Angus Hollands
    @agoose77:matrix.org
    [m]
    @coxoperationsengineer: yes, I read that whilst checking the sourcing order on MacOS 🙂 It's not a question of "can I?", but more "should I?; not all shells should be login shells and although terminals still load bashrc, they are an exception
    So the proper answer is - move your PATH configuration for pyenv to .zprofile, and add a new line for eval "$(pyenv init --path)"
    If you really don't want to do that, then the short answer is that you now need to add the shims to your PATH, which is what eval "$(pyenv init --path)" does.
    You also need to set PYENV_ROOT if I recall correctly, e.g. this answer https://github.com/pyenv/pyenv/issues/1906#issuecomment-834751771
    coxoperationsengineer
    @coxoperationsengineer
    so $(pyenv virtualenv-init -) does it stay put, and just move pyenv to .zprofile?