GithubHelp home page GithubHelp logo

pyenv-installer's Introduction

Simple Python Version Management: pyenv

Join the chat at https://gitter.im/yyuu/pyenv

pyenv lets you easily switch between multiple versions of Python. It's simple, unobtrusive, and follows the UNIX tradition of single-purpose tools that do one thing well.

This project was forked from rbenv and ruby-build, and modified for Python.

Terminal output example

What pyenv does...

  • Lets you change the global Python version on a per-user basis.
  • Provides support for per-project Python versions.
  • Allows you to override the Python version with an environment variable.
  • Searches for commands from multiple versions of Python at a time. This may be helpful to test across Python versions with tox.

In contrast with pythonbrew and pythonz, pyenv does not...

  • Depend on Python itself. pyenv was made from pure shell scripts. There is no bootstrap problem of Python.
  • Need to be loaded into your shell. Instead, pyenv's shim approach works by adding a directory to your PATH.
  • Manage virtualenv. Of course, you can create virtualenv yourself, or pyenv-virtualenv to automate the process.

Table of Contents


How It Works

At a high level, pyenv intercepts Python commands using shim executables injected into your PATH, determines which Python version has been specified by your application, and passes your commands along to the correct Python installation.

Understanding PATH

When you run a command like python or pip, your shell (bash / zshrc / ...) searches through a list of directories to find an executable file with that name. This list of directories lives in an environment variable called PATH, with each directory in the list separated by a colon:

/usr/local/bin:/usr/bin:/bin

Directories in PATH are searched from left to right, so a matching executable in a directory at the beginning of the list takes precedence over another one at the end. In this example, the /usr/local/bin directory will be searched first, then /usr/bin, then /bin.

Understanding Shims

pyenv works by inserting a directory of shims at the front of your PATH:

$(pyenv root)/shims:/usr/local/bin:/usr/bin:/bin

Through a process called rehashing, pyenv maintains shims in that directory to match every Python command across every installed version of Python—python, pip, and so on.

Shims are lightweight executables that simply pass your command along to pyenv. So with pyenv installed, when you run, say, pip, your operating system will do the following:

  • Search your PATH for an executable file named pip
  • Find the pyenv shim named pip at the beginning of your PATH
  • Run the shim named pip, which in turn passes the command along to pyenv

Understanding Python version selection

When you execute a shim, pyenv determines which Python version to use by reading it from the following sources, in this order:

  1. The PYENV_VERSION environment variable (if specified). You can use the pyenv shell command to set this environment variable in your current shell session.

  2. The application-specific .python-version file in the current directory (if present). You can modify the current directory's .python-version file with the pyenv local command.

  3. The first .python-version file found (if any) by searching each parent directory, until reaching the root of your filesystem.

  4. The global $(pyenv root)/version file. You can modify this file using the pyenv global command. If the global version file is not present, pyenv assumes you want to use the "system" Python (see below).

A special version name "system" means to use whatever Python is found on PATH after the shims PATH entry (in other words, whatever would be run if Pyenv shims weren't on PATH). Note that Pyenv considers those installations outside its control and does not attempt to inspect or distinguish them in any way. So e.g. if you are on MacOS and have OS-bundled Python 3.8.9 and Homebrew-installed Python 3.9.12 and 3.10.2 -- for Pyenv, this is still a single "system" version, and whichever of those is first on PATH under the executable name you specified will be run.

NOTE: You can activate multiple versions at the same time, including multiple versions of Python2 or Python3 simultaneously. This allows for parallel usage of Python2 and Python3, and is required with tools like tox. For example, to instruct Pyenv to first use your system Python and Python3 (which are e.g. 2.7.9 and 3.4.2) but also have Python 3.3.6, 3.2.1, and 2.5.2 available, you first pyenv install the missing versions, then set pyenv global system 3.3.6 3.2.1 2.5.2. Then you'll be able to invoke any of those versions with an appropriate pythonX or pythonX.Y name. You can also specify multiple versions in a .python-version file by hand, separated by newlines. Lines starting with a # are ignored.

pyenv which <command> displays which real executable would be run when you invoke <command> via a shim. E.g. if you have 3.3.6, 3.2.1 and 2.5.2 installed of which 3.3.6 and 2.5.2 are selected and your system Python is 3.2.5, pyenv which python2.5 should display $(pyenv root)/versions/2.5.2/bin/python2.5, pyenv which python3 -- $(pyenv root)/versions/3.3.6/bin/python3 and pyenv which python3.2 -- path to your system Python due to the fall-through (see below).

Shims also fall through to anything further on PATH if the corresponding executable is not present in any of the selected Python installations. This allows you to use any programs installed elsewhere on the system as long as they are not shadowed by a selected Python installation.

Locating Pyenv-provided Python installations

Once pyenv has determined which version of Python your application has specified, it passes the command along to the corresponding Python installation.

Each Python version is installed into its own directory under $(pyenv root)/versions.

For example, you might have these versions installed:

  • $(pyenv root)/versions/2.7.8/
  • $(pyenv root)/versions/3.4.2/
  • $(pyenv root)/versions/pypy-2.4.0/

As far as Pyenv is concerned, version names are simply directories under $(pyenv root)/versions.


Installation

Getting Pyenv

UNIX/MacOS

Homebrew in macOS
  1. Consider installing with Homebrew:

    brew update
    brew install pyenv

    If you want to install (and update to) the latest development head of Pyenv rather than the latest release, instead run:

    brew install pyenv --head
  2. Then follow the rest of the post-installation steps, starting with Set up your shell environment for Pyenv.

  3. OPTIONAL. To fix brew doctor's warning ""config" scripts exist outside your system or Homebrew directories"

    If you're going to build Homebrew formulae from source that link against Python like Tkinter or NumPy (This is only generally the case if you are a developer of such a formula, or if you have an EOL version of MacOS for which prebuilt bottles are no longer provided and you are using such a formula).

    To avoid them accidentally linking against a Pyenv-provided Python, add the following line into your interactive shell's configuration:

    • Bash/Zsh:

      alias brew='env PATH="${PATH//$(pyenv root)\/shims:/}" brew'
    • Fish:

      alias brew="env PATH=(string replace (pyenv root)/shims '' \"\$PATH\") brew"
Automatic installer
curl https://pyenv.run | bash

For more details visit our other project: https://github.com/pyenv/pyenv-installer

Basic GitHub Checkout

This will get you going with the latest version of Pyenv and make it easy to fork and contribute any changes back upstream.

  • Check out Pyenv where you want it installed. A good place to choose is $HOME/.pyenv (but you can install it somewhere else):
    git clone https://github.com/pyenv/pyenv.git ~/.pyenv
    
  • Optionally, try to compile a dynamic Bash extension to speed up Pyenv. Don't worry if it fails; Pyenv will still work normally:
    cd ~/.pyenv && src/configure && make -C src
    

Windows

Pyenv does not officially support Windows and does not work in Windows outside the Windows Subsystem for Linux. Moreover, even there, the Pythons it installs are not native Windows versions but rather Linux versions running in a virtual machine -- so you won't get Windows-specific functionality.

If you're in Windows, we recommend using @kirankotari's pyenv-win fork -- which does install native Windows Python versions.

Set up your shell environment for Pyenv

Upgrade note: The startup logic and instructions have been updated for simplicity in 2.3.0. The previous, more complicated configuration scheme for 2.0.0-2.2.5 still works.

  • Define environment variable PYENV_ROOT to point to the path where Pyenv will store its data. $HOME/.pyenv is the default. If you installed Pyenv via Git checkout, we recommend to set it to the same location as where you cloned it.
  • Add the pyenv executable to your PATH if it's not already there
  • run eval "$(pyenv init -)" to install pyenv into your shell as a shell function, enable shims and autocompletion
    • You may run eval "$(pyenv init --path)" instead to just enable shims, without shell integration

The below setup should work for the vast majority of users for common use cases. See Advanced configuration for details and more configuration options.

  • For bash:

    Stock Bash startup files vary widely between distributions in which of them source which, under what circumstances, in what order and what additional configuration they perform. As such, the most reliable way to get Pyenv in all environments is to append Pyenv configuration commands to both .bashrc (for interactive shells) and the profile file that Bash would use (for login shells).

    First, add the commands to ~/.bashrc by running the following in your terminal:

    echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
    echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
    echo 'eval "$(pyenv init -)"' >> ~/.bashrc

    Then, if you have ~/.profile, ~/.bash_profile or ~/.bash_login, add the commands there as well. If you have none of these, add them to ~/.profile.

    • to add to ~/.profile:

      echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.profile
      echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.profile
      echo 'eval "$(pyenv init -)"' >> ~/.profile
    • to add to ~/.bash_profile:

      echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
      echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
      echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
  • For Zsh:

    echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
    echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
    echo 'eval "$(pyenv init -)"' >> ~/.zshrc

    If you wish to get Pyenv in noninteractive login shells as well, also add the commands to ~/.zprofile or ~/.zlogin.

  • For Fish shell:

    If you have Fish 3.2.0 or newer, execute this interactively:

    set -Ux PYENV_ROOT $HOME/.pyenv
    fish_add_path $PYENV_ROOT/bin

    Otherwise, execute the snippet below:

    set -Ux PYENV_ROOT $HOME/.pyenv
    set -U fish_user_paths $PYENV_ROOT/bin $fish_user_paths

    Now, add this to ~/.config/fish/config.fish:

    pyenv init - | source

Bash warning: There are some systems where the BASH_ENV variable is configured to point to .bashrc. On such systems, you should almost certainly put the eval "$(pyenv init -)" line into .bash_profile, and not into .bashrc. Otherwise, you may observe strange behaviour, such as pyenv getting into an infinite loop. See #264 for details.

Proxy note: If you use a proxy, export http_proxy and https_proxy, too.

In MacOS, you might also want to install Fig which provides alternative shell completions for many command line tools with an IDE-like popup interface in the terminal window. (Note that their completions are independent from Pyenv's codebase so they might be slightly out of sync for bleeding-edge interface changes.)

Restart your shell

for the PATH changes to take effect.

exec "$SHELL"

Install Python build dependencies

Install Python build dependencies before attempting to install a new Python version.

You can now begin using Pyenv.


Usage

Install additional Python versions

To install additional Python versions, use pyenv install.

For example, to download and install Python 3.10.4, run:

pyenv install 3.10.4

Running pyenv install -l gives the list of all available versions.

NOTE: Most Pyenv-provided Python releases are source releases and are built from source as part of installation (that's why you need Python build dependencies preinstalled). You can pass options to Python's configure and compiler flags to customize the build, see Special environment variables in Python-Build's README for details.

NOTE: If you are having trouble installing a Python version, please visit the wiki page about Common Build Problems.

NOTE: If you want to use proxy for download, please set the http_proxy and https_proxy environment variables.

NOTE: If you'd like a faster interpreter at the cost of longer build times, see Building for maximum performance in Python-Build's README.

Prefix auto-resolution to the latest version

All Pyenv subcommands except uninstall automatically resolve full prefixes to the latest version in the corresponding version line.

pyenv install picks the latest known version, while other subcommands pick the latest installed version.

E.g. to install and then switch to the latest 3.10 release:

pyenv install 3.10
pyenv global 3.10

You can run pyenv latest -k <prefix> to see how pyenv install would resolve a specific prefix, or pyenv latest <prefix> to see how other subcommands would resolve it.

See the pyenv latest documentation for details.

Python versions with extended support

For the following Python releases, Pyenv applies user-provided patches that add support for some newer environments. Though we don't actively maintain those patches, since existing releases never change, it's safe to assume that they will continue working until there are further incompatible changes in a later version of those environments.

  • 3.7.8-3.7.15, 3.8.4-3.8.12, 3.9.0-3.9.7 : XCode 13.3
  • 3.5.10, 3.6.15 : MacOS 11+ and XCode 13.3
  • 2.7.18 : MacOS 10.15+ and Apple Silicon

Switch between Python versions

To select a Pyenv-installed Python as the version to use, run one of the following commands:

E.g. to select the above-mentioned newly-installed Python 3.10.4 as your preferred version to use:

pyenv global 3.10.4

Now whenever you invoke python, pip etc., an executable from the Pyenv-provided 3.10.4 installation will be run instead of the system Python.

Using "system" as a version name would reset the selection to your system-provided Python.

See Understanding shims and Understanding Python version selection for more details on how the selection works and more information on its usage.

Uninstall Python versions

As time goes on, you will accumulate Python versions in your $(pyenv root)/versions directory.

To remove old Python versions, use pyenv uninstall <versions>.

Alternatively, you can simply rm -rf the directory of the version you want to remove. You can find the directory of a particular Python version with the pyenv prefix command, e.g. pyenv prefix 2.6.8. Note however that plugins may run additional operations on uninstall which you would need to do by hand as well. E.g. Pyenv-Virtualenv also removes any virtual environments linked to the version being uninstalled.

Other operations

Run pyenv commands to get a list of all available subcommands. Run a subcommand with --help to get help on it, or see the Commands Reference.

Note that Pyenv plugins that you install may add their own subcommands.

Upgrading

Upgrading with Homebrew

If you've installed Pyenv using Homebrew, upgrade using:

brew upgrade pyenv

To switch from a release to the latest development head of Pyenv, use:

brew uninstall pyenv
brew install pyenv --head

then you can upgrade it with brew upgrade pyenv as usual.

Upgrading with Installer or Git checkout

If you've installed Pyenv with Pyenv-installer, you likely have the Pyenv-Update plugin that would upgrade Pyenv and all installed plugins:

pyenv update

If you've installed Pyenv using Pyenv-installer or Git checkout, you can also upgrade your installation at any time using Git.

To upgrade to the latest development version of pyenv, use git pull:

cd $(pyenv root)
git pull

To upgrade to a specific release of Pyenv, check out the corresponding tag:

cd $(pyenv root)
git fetch
git tag
git checkout v0.1.0

Uninstalling pyenv

The simplicity of pyenv makes it easy to temporarily disable it, or uninstall from the system.

  1. To disable Pyenv managing your Python versions, simply remove the pyenv init invocations from your shell startup configuration. This will remove Pyenv shims directory from PATH, and future invocations like python will execute the system Python version, as it was before Pyenv.

    pyenv will still be accessible on the command line, but your Python apps won't be affected by version switching.

  2. To completely uninstall Pyenv, remove all Pyenv configuration lines from your shell startup configuration, and then remove its root directory. This will delete all Python versions that were installed under the $(pyenv root)/versions/ directory:

    rm -rf $(pyenv root)

    If you've installed Pyenv using a package manager, as a final step, perform the Pyenv package removal. For instance, for Homebrew:

    brew uninstall pyenv
    

Pyenv plugins

Pyenv provides a simple way to extend and customize its functionality with plugins -- as simple as creating a plugin directory and dropping a shell script on a certain subpath of it with whatever extra logic you need to be run at certain moments.

The main idea is that most things that you can put under $PYENV_ROOT/<whatever> you can also put under $PYENV_ROOT/plugins/your_plugin_name/<whatever>.

See Plugins on the wiki on how to install and use plugins as well as a catalog of some useful existing plugins for common needs.

See Authoring plugins on the wiki on writing your own plugins.

Advanced Configuration

Skip this section unless you must know what every line in your shell profile is doing.

Also see the Environment variables section for the environment variables that control Pyenv's behavior.

pyenv init is the only command that crosses the line of loading extra commands into your shell. Coming from RVM, some of you might be opposed to this idea. Here's what eval "$(pyenv init -)" actually does:

  1. Sets up the shims path. This is what allows Pyenv to intercept and redirect invocations of python, pip etc. transparently. It prepends $(pyenv root)/shims to your $PATH. It also deletes any other instances of $(pyenv root)/shims on PATH which allows to invoke eval "$(pyenv init -)" multiple times without getting duplicate PATH entries.

  2. Installs autocompletion. This is entirely optional but pretty useful. Sourcing $(pyenv root)/completions/pyenv.bash will set that up. There are also completions for Zsh and Fish.

  3. Rehashes shims. From time to time you'll need to rebuild your shim files. Doing this on init makes sure everything is up to date. You can always run pyenv rehash manually.

  4. Installs pyenv into the current shell as a shell function. This bit is also optional, but allows pyenv and plugins to change variables in your current shell. This is required for some commands like pyenv shell to work. The sh dispatcher doesn't do anything crazy like override cd or hack your shell prompt, but if for some reason you need pyenv to be a real script rather than a shell function, you can safely skip it.

eval "$(pyenv init --path)" only does items 1 and 3.

To see exactly what happens under the hood for yourself, run pyenv init - or pyenv init --path.

eval "$(pyenv init -)" is supposed to run at any interactive shell's startup (including nested shells -- e.g. those invoked from editors) so that you get completion and convenience shell functions.

eval "$(pyenv init --path)" can be used instead of eval "$(pyenv init -)" to just enable shims, without shell integration. It can also be used to bump shims to the front of PATH after some other logic has prepended stuff to PATH that may shadow Pyenv's shims.

  • In particular, in Debian-based distributions, the stock ~/.profile prepends per-user bin directories to PATH after having sourced ~/.bashrc. This necessitates appending a pyenv init call to ~/.profile as well as ~/.bashrc in these distributions because the system's Pip places executables for modules installed by a non-root user into those per-user bin directories.

Using Pyenv without shims

If you don't want to use pyenv init and shims, you can still benefit from pyenv's ability to install Python versions for you. Just run pyenv install and you will find versions installed in $(pyenv root)/versions.

You can manually execute or symlink them as required, or you can use pyenv exec <command> whenever you want <command> to be affected by Pyenv's version selection as currently configured.

pyenv exec works by prepending $(pyenv root)/versions/<selected version>/bin to PATH in the <command>'s environment, the same as what e.g. RVM does.

Environment variables

You can affect how Pyenv operates with the following environment variables:

name default description
PYENV_VERSION Specifies the Python version to be used.
Also see pyenv shell
PYENV_ROOT ~/.pyenv Defines the directory under which Python versions and shims reside.
Also see pyenv root
PYENV_DEBUG Outputs debug information.
Also as: pyenv --debug <subcommand>
PYENV_HOOK_PATH see wiki Colon-separated list of paths searched for pyenv hooks.
PYENV_DIR $PWD Directory to start searching for .python-version files.

See also Special environment variables in Python-Build's README for environment variables that can be used to customize the build.


Development

The pyenv source code is hosted on GitHub. It's clean, modular, and easy to understand, even if you're not a shell hacker.

Tests are executed using Bats:

bats test
bats/test/<file>.bats

Contributing

Feel free to submit pull requests and file bugs on the issue tracker.

See CONTRIBUTING.md for more details on submitting changes.

Version History

See CHANGELOG.md.

License

The MIT License

pyenv-installer's People

Contributors

alanyee avatar anton-petrov avatar cavcrosby avatar charlesreid1 avatar fgimian avatar gvoysey avatar ianchen-tw avatar iurisilvio avatar jaycenhorton avatar jkwill87 avatar joshfriend avatar jvtrigueros avatar luzfcb avatar marcospgp avatar mnencia avatar native-api avatar obestwalter avatar peterdavehello avatar proinsias avatar rli avatar sean-smith avatar sethwoodworth avatar shubhodeep9 avatar tekumara avatar tronicum avatar voronind avatar wjv avatar x2es avatar yuvipanda avatar yyuu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pyenv-installer's Issues

Instead of requiring `git` be installed, use curl/wget to grab the latest release or master.zip?

If they can curl https://pyenv.run | bash then we know they can grab files via curl, and on almost all systems (minus Git Bash on Windows), even if they don't have the zip package or the unzip command they likely have python or python3 which includes a ZipFile.extract() function in the standard library. For safety you could try ZipFile.testzip() to see if the zip was corrupted during the download.

bash: /usr/libexec/vte-urlencode-cwd: No such file or directory

OS: Fedora Silverblue

Log

[scott@localhost ~]$ toolbox enter
⬢[scott@toolbox ~]$ curl https://pyenv.run | bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   285  100   285    0     0    587      0 --:--:-- --:--:-- --:--:--   587
Cloning into '/var/home/scott/.pyenv'...
remote: Enumerating objects: 693, done.
remote: Counting objects: 100% (693/693), done.
remote: Compressing objects: 100% (510/510), done.
remote: Total 693 (delta 353), reused 278 (delta 91), pack-reused 0
Receiving objects: 100% (693/693), 389.19 KiB | 2.29 MiB/s, done.
Resolving deltas: 100% (353/353), done.
Cloning into '/var/home/scott/.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
Unpacking objects: 100% (11/11), 38.62 KiB | 534.00 KiB/s, done.
Cloning into '/var/home/scott/.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
Unpacking objects: 100% (16/16), 5.99 KiB | 340.00 KiB/s, done.
Cloning into '/var/home/scott/.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
Unpacking objects: 100% (10/10), 2.66 KiB | 389.00 KiB/s, done.
Cloning into '/var/home/scott/.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
Unpacking objects: 100% (57/57), 34.86 KiB | 206.00 KiB/s, done.
Cloning into '/var/home/scott/.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
Unpacking objects: 100% (10/10), 2.92 KiB | 331.00 KiB/s, done.
bash: /usr/libexec/vte-urlencode-cwd: No such file or directory
⬢[scott@toolbox ~]$ 

Looks to be related to:
containers/toolbox#390

Just an FYI for others experiencing this error that the upstream fix is said to be in:

  • vte-profile-0.60.0-2.fc32

Pyenv-installer doesn't update path

Hi,

I don't know why, but the pyenv installer doesn't seem to do the right thing on my machine.

it gets all the files correctly and puts them into the right folder, but path is not updated:

vagrant@vagrant:~$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/opt/vagrant_ruby/bin

Of course I can call ./pyenv/bin/pyenv directly, but without the path it won't work obviously. Also pyenv shell doesn't work,

I'm aware I can update all that stuff by hand, but isn't it the purpose of the installer? :-)

Here is the output of the installation process. Please advice:

Cloning into '/home/vagrant/.pyenv'...
remote: Counting objects: 5898, done.
remote: Compressing objects: 100% (1388/1388), done.
remote: Total 5898 (delta 4269), reused 5836 (delta 4235)
Receiving objects: 100% (5898/5898), 987.60 KiB | 219 KiB/s, done.
Resolving deltas: 100% (4269/4269), done.
Cloning into '/home/vagrant/.pyenv/plugins/pyenv-doctor'...
remote: Reusing existing pack: 26, done.
remote: Total 26 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (26/26), done.
Cloning into '/home/vagrant/.pyenv/plugins/pyenv-installer'...
remote: Reusing existing pack: 28, done.
remote: Total 28 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (28/28), done.
Cloning into '/home/vagrant/.pyenv/plugins/pyenv-pip-migrate'...
remote: Reusing existing pack: 19, done.
remote: Total 19 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (19/19), done.
Cloning into '/home/vagrant/.pyenv/plugins/pyenv-pip-rehash'...
remote: Reusing existing pack: 117, done.
remote: Total 117 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (117/117), 14.99 KiB, done.
Resolving deltas: 100% (51/51), done.
Cloning into '/home/vagrant/.pyenv/plugins/pyenv-update'...
remote: Reusing existing pack: 19, done.
remote: Total 19 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (19/19), done.
Cloning into '/home/vagrant/.pyenv/plugins/pyenv-version-ext'...
remote: Reusing existing pack: 9, done.
remote: Total 9 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (9/9), done.
Cloning into '/home/vagrant/.pyenv/plugins/pyenv-virtualenv'...
remote: Reusing existing pack: 503, done.
remote: Total 503 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (503/503), 190.40 KiB | 151 KiB/s, done.
Resolving deltas: 100% (280/280), done.
Seems you still have not added 'pyenv' to the load path:

export PYENV_ROOT="${HOME}/.pyenv"

if [ -d "${PYENV_ROOT}" ]; then
  export PATH="${PYENV_ROOT}/bin:${PATH}"
  eval "$(pyenv init -)"
fi

OS X: pyenv update no such command

OSX: 10.12.2
pyenv: 1.0.6

(cdm-ops-web) Sarits-MacBook-Air-2:cdm-ops-web el$ pyenv update
pyenv: no such command `update'

(cdm-ops-web) Sarits-MacBook-Air-2:cdm-ops-web el$ cat ~/.bash_profile
# pyenv
export PATH="/Users/el/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"

Is pyenv update valid on OSX 10.12.2?

Update the description

"This tools is used to install pyenv and friends." is incorrect.

Two forms are possible:

"These tools are used to install pyenv and friends.
"This tool is used to install pyenv and friends."

/etc/zshenv is sourced twice

On my Mac 10.9 it looks like /etc/zshenv gets sourced twice which causes pyenv to get appended too late in the path.

The execution order for login shells is

/etc/zshenv
.zshenv
.zshrc
/etc/zshenv (again)

So if my pyenv init command is in zshrc, it gets prepended to the path, then /etc/zshenv runs again and sets the initial path to everything in /etc/paths and /etc/paths.d/*.

I'm not sure why it is being sourced twice though it just started happening locally. My zsh version is zsh 5.0.7 (x86_64-apple-darwin13.4.0). I am running pyenv 20141106.

Was wondering if anyone else could comment on this.

error message in first install

I was installing pyenv in a new laptop, and do a new install with pyenv-installer.

all was good, but I have an error message that didn't appear in previous installs.

~  pyenv update
Updating /home/yonsy/.pyenv...
pyenv-update: /home/yonsy/.pyenv is not on master branch.
Updating /home/yonsy/.pyenv/plugins/pyenv-doctor...
From https://github.com/yyuu/pyenv-doctor
* branch            master     -> FETCH_HEAD
Already up-to-date.
Updating /home/yonsy/.pyenv/plugins/pyenv-installer...
From https://github.com/yyuu/pyenv-installer
* branch            master     -> FETCH_HEAD
Already up-to-date.
Updating /home/yonsy/.pyenv/plugins/pyenv-update...
From https://github.com/yyuu/pyenv-update
* branch            master     -> FETCH_HEAD
Already up-to-date.
Updating /home/yonsy/.pyenv/plugins/pyenv-virtualenv...
From https://github.com/yyuu/pyenv-virtualenv
* branch            master     -> FETCH_HEAD
Already up-to-date.
Updating /home/yonsy/.pyenv/plugins/pyenv-which-ext...
From https://github.com/yyuu/pyenv-which-ext
* branch            master     -> FETCH_HEAD
Already up-to-date.
✘  ~ 

you can view the error message pyenv-update: /home/yonsy/.pyenv is not on master branch.

debugging this, i find that in verify_repo_branch function for base ~/.pyenv directory (the pyenv repo, not plugins), git name-rev --name-only HEAD returns tags/v1.0.5, not master and this causes the problem.

Make it work well with Ubuntu

It is my understanding that on Ubuntu the ~/.bashrc file needs to be update instead of ~/.bash_profile. I don't know much shell scripting, but could this script detect the distribution and make the changes in the right file?

Is it really necessary to rely on a login shell?

The installer script suggests using the file ~/.bash_profile for bash environment settings, which is only read by login shells:

case "$shell" in
bash )
profile="~/.bash_profile"
;;

Is it not possible to use either ~/.profile or ~/.bashrc instead? They are sourced by interactive shells of all types, which seems to make things easier for the user.

Ignoring potentially dangerous file name ../Python-2.7.8/Lib/site.py

The patches in python-builder have relative path names (begin with '..'), which patch doesn't like.

I worked around the issue with this:

perl -pi -e 's{^(\+\+\+|--- |diff.* )\.\./}{$1}' $(find ~/.pyenv -name \*.patch)

However, a better solution would be to generate the patches without relative path names.

Define what "friends" means exactly?

Also, does this script do things automatically as soon as you run it, or does it ask some questions, give you time to cancel?

Can it just install pyenv, or does it always install its "friends" with it?

This stuff would be nice to know in the readme before being asked to just run something in your shell.

potentially missing symlink

For compiling opencv and python-boost against a pyen python I had to add the following link:

~/.pyenv/versions/{envname}/include/python3.6
pointing to
~/.pyenv/versions/3.6.0/include/python3.6.m

I think this should be added by default.

error: failed to download python-####

I encountered this problem on mac. after some digging I found out it had to do with curl not being able to find the certificates. Because I have a custom build curl I can't just reinstall. I have therefore modified python-build with (starting at line 320):

  http() {
  local method="$1"
  local url="$2"
  local file="$3"
  [ -n "$url" ] || return 1

  if type aria2c &>/dev/null; then
    "http_${method}_aria2c" "$url" "$file"
  elif type curl &>/dev/null; then
    if [ $NO_CURL ]; then
       if type wget &>/dev/null; then
          "http_${method}_wget" "$url" "$file"
       else
          echo "error: please install \`aria2c\` or \`wget\` of remove \'-n\' from arguments and try again" >&2
          exit 1
       fi
    else
       "http_${method}_curl" "$url" "$file"
    fi
  elif type wget &>/dev/null; then
    "http_${method}_wget" "$url" "$file"
  else
    echo "error: please install \`aria2c\`, \`curl\` or \`wget\` and try again" >&2
    exit 1
  fi
}

and added unset NO_CURL on line 1765 and

    "n" | "no-curl" )
    NO_CURL=true
    ;;

to the section starting at 1777

In file pyenv-install I added unset NO_CURL before line 69 and

     "n" | "no-curl" )
    NO_CURL=true
    ;;

starting at line 96

now all I have to do to ignore curl is using pyenv install -n #.#.#

USE_HTTPS

Hi,
i had to dig into the script to learn the git:// is the default. decent firewall setups blog the git protocol.

PLEASE make USE_HTTPS a default or at least mention it on the githup page.

Greetings,
tronicum

https://pyenv.run script still references https://github.com/yyuu/pyenv-installer

The command

$ curl https://pyenv.run

Returns

#!/bin/bash
#
# Usage: curl https://pyenv.run | bash
#
# For more info, visit: https://github.com/yyuu/pyenv-installer
#
set -e
curl -s -S -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash -s -- "$@"

I know this still works because of GitHub renaming. But would it not be best to point to

https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer ?

make pyenv install correctly with pip

The fact that there is a pyenv package on pypi that is outdated and that installs incorrectly. This is causing confusions for everyone.

pip became the official way to install Python software, is easy to use and reliable. I think is used by 95% of python packages so why having a broken version on pypi? If Is broken why is still there?

Is there a bug in current versions of pip that prevents proper distribution of pyenv via it?

Cut a release

pyenv looks awesome! We've been recommending a script called bootstrap_python.sh for a few years now, but pyenv definitely looks like a much better solution.

Is there any chance we can cut a version of pyenv-installer? I'd much prefer we point to a released tag of the install script in a (much simpler) bootstrap_python.sh if possible.

Thanks!

Ubuntu 14 Install ? Help please

OK, so I followed the docs. [Please note I am new to Linux environments, coming from Windows but trying to get rid of it]

I curled the script and got into ~/.pyenv directory
Added this info to my ~/.bash_profile

# Load pyenv automatically by adding
# the following to ~/.bash_profile:

export PATH="/home/anthoni/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"

Restarted my shell and tried pyenv but it said unrecognised command. So I logged out and then back in and tried again. Still nothing.

How do I get it so I can just type pyenv and have it run please ?

User can set $profile by himself?

I found that under some verion centos, ubuntu,pyenv-installer cant not detect profile correct.

User can set $profile by himself?

Lkie this:

wget https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer
chmod +x pyenv-installer
profile="~/.bash_profile"  ./pyenv-installer

unable to install pyenv on windows 10 (pip install pyenv )

Collecting pyenv
Using cached pyenv-20150113.1.tar.gz
Building wheels for collected packages: pyenv
Running setup.py bdist_wheel for pyenv ... error
Complete output from command d:\python\python.exe -u -c "import setuptools, tokenize;file='c:\users\user\appdata\local\temp\pip-build-6ldgff\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 c:\users\user\appdata\local\temp\tmprauu_6pip-wheel- --python-tag cp27:
running bdist_wheel
running build
installing to build\bdist.win32\wheel
running install
error: [Error 2] The system cannot find the file specified


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
Complete output from command d:\python\python.exe -u -c "import setuptools, tokenize;file='c:\users\user\appdata\local\temp\pip-build-6ldgff\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 c:\users\user\appdata\local\temp\pip-wg9dun-record\install-record.txt --single-version-externally-managed --compile:
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help

error: option --single-version-externally-managed not recognized

----------------------------------------

Command "d:\python\python.exe -u -c "import setuptools, tokenize;file='c:\users\user\appdata\local\temp\pip-build-6ldgff\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 c:\users\user\appdata\local\temp\pip-wg9dun-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\user\appdata\local\temp\pip-build-6ldgff\pyenv\

virtualenvwrapper error, how to fix?

Whenever I start up the terminal in Linux Mint 17.3, I get this message:
pyenv: no such command `virtualenvwrapper'

How do I fix this?

Here's a list of commands I ran leading up to it:
curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
pyenv update
pip3 install virtualenvwrapper
sudo pip3 install virtualenvwrapper
sudo pip install virtualenvwrapper
sudo pip install --user virtualenvwrapper
sudo pip3 install --user virtualenvwrapper
sudo apt-get install python-pip
sudo pip install virtualenvwrapper
virtualenvwrapper
python virtualenvwrapper
export WORKON_HOME=$HOME/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh
export PATH=/usr/local/bin:$PATH
source /usr/local/bin/virtualenvwrapper.sh
$PATH

Before this all happened, I deleted some folders in /home/jacob3 related to pyenv, since I no longer needed it. They all started with a dot (.), not sure what that means.

Automatically update path

Does the installer purposely not update the path?

$ curl -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash
WARNING: seems you still have not added 'pyenv' to the load path.

# Load pyenv automatically by adding
# the following to ~/.bash_profile:

export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"

CentOS 6.5

Many Thanks

Not creating bin folder within root

On OS X El Capitan 10.11.6, when running the installation it will silently fail and not create the bin folder for pyenv. Temporary workaround is to install manually clone the repository to the identical root path.

pyenv install fails at download stage

Hi,

been trying to get pyenv to work on a Scientific Linux 6.5 system. I had this working on an earlier kernel/cluster setup but in the current constellation of kernel etc pyenv won't work. I used the pyenv-installer script (but also tried cloning directly from github) and set the environment variables. When running pyenv install 2.7.8, I get:

pyenv install 2.7.8
Downloading Python-2.7.8.tgz...
-> https://www.python.org/ftp/python/2.7.8/Python-2.7.8.tgz
error: failed to download Python-2.7.8.tgz

BUILD FAILED (Scientific 6.5 using python-build 20141211-6-g995da2d)

I can download this file manually following above link, so that doesn't seem to be the issue. I don't have the versions folder to which I am guessing the download will go. I also have no shims folder, by the way. Running the make file in the pyenv root throws one error about shims directory not being writeable (which makes sense, since it doesn't exist). There is no mentioning of a compilation step in the instructions, so I am guessing something is amiss here?

why pyenv make bash or any other termminal(such as zsh) slowly?

export PATH="/root/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
Comment out the above commands, the bash or zsh will performs better.
This will make pyenv unusable, but i prefer to have a quick terminal.

By the way, this problem happened in wsl and virtual Machine(vmware+ubuntu).
So If anyone knows the solution to the problem, please leave a message.Thank you!

get-pip.py is no longer compatible with python2.6

I have installed openssl, readline from homebrew, then use pyenv install python 2.6.7 cause error.
I try to debug this error. I found pyenv may not be linked openssl.

yongjie.zhao@:workspace$ pyenv install 2.6.9
python-build: use openssl from homebrew
python-build: use readline from homebrew
Downloading Python-2.6.9.tgz...
-> https://www.python.org/ftp/python/2.6.9/Python-2.6.9.tgz
Installing Python-2.6.9...
patching file setup.py
Hunk #1 succeeded at 354 (offset 9 lines).
patching file ./configure
patching file ./Modules/readline.c
Hunk #1 succeeded at 199 (offset -7 lines).
Hunk #2 succeeded at 698 (offset -51 lines).
Hunk #3 succeeded at 808 (offset -51 lines).
Hunk #4 succeeded at 848 with fuzz 2 (offset -70 lines).
patching file ./setup.py
Hunk #1 succeeded at 1698 (offset 23 lines).
patching file ./Lib/ssl.py
patching file ./Modules/_ssl.c
python-build: use readline from homebrew
Installing pip from https://bootstrap.pypa.io/get-pip.py...
error: failed to install pip via get-pip.py

BUILD FAILED (OS X 10.13.3 using python-build 20160602)

Inspect or clean up the working tree at /var/folders/jh/43k6mlm116q4mzskbszmm2hh60hf8t/T/python-build.20180319143249.14627
Results logged to /var/folders/jh/43k6mlm116q4mzskbszmm2hh60hf8t/T/python-build.20180319143249.14627.log

Last 10 log lines:
		/Users/yongjie.zhao/.pyenv/versions/2.6.9/share/man/man1/python.1
Traceback (most recent call last):
  File "get-pip.py", line 22373, in <module>
    main()
  File "get-pip.py", line 194, in main
    bootstrap(tmpdir=tmpdir)
  File "get-pip.py", line 82, in bootstrap
    import pip
  File "/var/folders/jh/43k6mlm116q4mzskbszmm2hh60hf8t/T/tmpnHxF2K/pip.zip/pip/__init__.py", line 34, in <module>
AttributeError: 'module' object has no attribute 'OPENSSL_VERSION_NUMBER'

Why python 3.4.1 is not installed ?

10 log lines:
i am try to install python 3.4.1 using pyenv but it is not installed and it give the below error , please give the solution.

(cd /home/ri/.pyenv/versions/3.4.1/share/man/man1; ln -s python3.4.1 python3.1)
if test "xupgrade" != "xno" ; then
case upgrade in
upgrade) ensurepip="--upgrade" ;;
install|*) ensurepip="" ;;
esac;
./python -E -m ensurepip
$ensurepip --root=/ ;
fi
Ignoring ensurepip failure: pip 1.5.6 requires SSL/TLS

How do I install in Debian Wheezy?

I've tried installing in up-to-date (heh) Debian 7 virtual machine:

apt-get install python3 python3-pip
pip-3.2 install --egg pyenv

I've got:

/usr/bin/pip-3.2 install: error: no such option: --egg

I guess it's something about pip version... How could I install it to current stable Debian using pip? Could this be documented, please?

Install script: requested URL returned error: 403

Any hints as to this error (Debian Lenny):

curl -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 2140 100 2140 0 0 3635 0 --:--:-- --:--:-- --:--:-- 2089k
Initialized empty Git repository in /root/.pyenv/.git/
error: The requested URL returned error: 403
warning: remote HEAD refers to nonexistent ref, unable to checkout.

Install to /usr/local when using sudo.

Latest version of python comes with Debian is 3.5. I need a newer version. I have daemon written in Python starting at boot time, which requires Python not be installed to any user folder.

Currently when using installer with sudo, Python is installed under /root. It'd be nice to recognize sudo privilege and install it to /usr/local instead.

Thanks!

../libexec/pyenv: No such file or directory

I've installed pyenv both by manually cloning the repo described on the pytest github page and also by using the automatic installer. With both attempts I get the following whenever I try to use any pyenv command:
/c/Users/jukline/.pyenv/bin/pyenv: line 1: ../libexec/pyenv: No such file or directory

When I go directly to the libexec/pyenv directory and try to use pyenv commands, I am simply presented with the commands available.
image

I have seen the related post (pyenv/pyenv#332) and have verified my git config. There are two listings of core.symlinks, but my understanding is that the last one takes precedence.
$ git config --list
core.symlinks=false
core.autocrlf=false
core.fscache=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
help.format=html
http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
diff.astextplain.textconv=astextplain
rebase.autosquash=true
credential.helper=manager
user.name=j
user.email=[email protected]
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.symlinks=true
core.ignorecase=true
remote.origin.url=https://github.com/yyuu/pyenv.git
remote.origin.fetch=+refs/heads/master:refs/remotes/origin/master
branch.master.remote=origin
branch.master.merge=refs/heads/master

Anyone have ideas on how to resolve? Thanks

Error message should be given when .pyenv folder already exists

While following the instructions to curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash not much happened, but no error message was given either.

This was because the .pyenv folder already existed (due to a previous failed installation attempt).

If the script aborts due to the .pyenv folder already existing, it would be useful with a warning or error message telling this.

I got past this by removing the .pyenv folder and then running the above again, which then installed as it should.

git vs https protocol

In my work network only ssh/http/https ports are open.
So last change break installer for me.
The workaround is

curl -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | sed "s/git:/https:/" | bash

Fix wrong impression that pyenv should be installed via pip

pip install pyenv is pretty broken - why is it here anyway?

The current state is that usage of pip install pyenv is discouraged and does not work in (if I should hazard a guess) all but the most standard cases (and only with Python2). pip uninstall pyenv does not work at all, which is simply embarassing. I dropped the ball there as just too much else was going on in my life. No excuse. Just an explanation.

As pyenv is a collection of shell scripts and has a perfectly nice way of installing and updating already, the question begs: why is it on pypi anyway? Two reasons:

  1. At the time there was an abandoned project (actually never really started) with the same name on pypi and I wanted to clear up the naming confusion by having the actual pyenv project on pypi to raise awareness that such a great tool exists. (thanks again @yyuu - I could not imagine doing without it anymore). So I wrote a hacky proof of concept for pip installation (not really having a clue about what I was doing at that time) and asked the owner of the defunct project and the friendly maintainers of pypi to let the real pyenv in and they were nice enough to do that (original issue if you are interested).
  2. pyenv is not a project written in Python, but it is a project for the Python ecosystem. pypi is very much the epicenter of the Python ecosystem - so in my mind pyenv belongs there ... but it would be nice if it then would actually work :)

So how can I fix the mess I made? I have several ideas:

Remove pip install functionality

... by making a special release on pypi that clearly documents the "correct" way of installing pyenv (which is not via pip but via Github).

This could also be a first step as a temporary solution that is better to have something utterly broken on pypi.

Remove functionality from pyenv-installer

... but create a new project called e.g. pyenv-pip-installer that will be hosted as pyenv on pypi and provide proper pip install functionality with a release cylce that is detached from pyenvs release cycle

Fix it right here

... by just making it work (by using setuptools instead of distutils to start with). This is still favorite solution.

There are a few things to consider though:

  1. pyenv is actually meant to work in user space without needing to have adminstrative rights - that's part of the beauty of it. A normal pip install call tries to install to the system Python though - although this is being discussed if this might change in the future. To make it work for pyenv properly atm the user would have to be at least aware that he would have to invoke pip with the --user flag. I did not look into that to deeply yet though.
  2. Different behaviours on different platforms (could we even make it work on Windows? Windows 10 has a linux subsystem now and otherwise bash can be installed in several ways on Windows (Cygwin, whatever).
  3. Synchronizing releases on Github and pypi. This screams for automation, thorugh Travis or something like that - haven't thought about it yet, but should be pretty easy to have a hook that makes a releas on pypy whenever @yyuu releases on Github.

Related issues

Anything else?I would be happy about feedback/help :)

Document vagrant workflow

This repo contains a Vagrantfile which eases development and testing but it is not really documented yet ... especially how it could be extended to other osses.

Can't import theano

After installing py 3.5.3 through pyenv, and installing theano

I run the interpreter and tried to import theano and I got this:

Problem occurred during compilation with the command line below:
/usr/bin/g++ -shared -g -march=ivybridge -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -mno-sse4a -mcx16 -msahf -mno-movbe -maes -mno-sha -mpclmul -mpopcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mavx -mno-avx2 -msse4.2 -msse4.1 -mno-lzcnt -mno-rtm -mno-hle -mrdrnd -mf16c -mfsgsbase -mno-rdseed -mno-prfchw -mno-adx -mfxsr -mxsave -mxsaveopt -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 -mno-clflushopt -mno-xsavec -mno-xsaves -mno-avx512dq -mno-avx512bw -mno-avx512vl -mno-avx512ifma -mno-avx512vbmi -mno-clwb -mno-pcommit -mno-mwaitx --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=15360 -mtune=ivybridge -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -m64 -fPIC -I/root/.pyenv/versions/3.5.3/lib/python3.5/site-packages/numpy/core/include -I/root/.pyenv/versions/3.5.3/include/python3.5m -I/root/.pyenv/versions/3.5.3/lib/python3.5/site-packages/theano/gof -L/root/.pyenv/versions/3.5.3/lib -fvisibility=hidden -o /root/.theano/compiledir_Linux-4.4--generic-x86_64-with-debian-stretch-sid-x86_64-3.5.3-64/lazylinker_ext/lazylinker_ext.so /root/.theano/compiledir_Linux-4.4--generic-x86_64-with-debian-stretch-sid-x86_64-3.5.3-64/lazylinker_ext/mod.cpp -lpython3.5m
/usr/bin/ld: /root/.pyenv/versions/3.5.3/lib/libpython3.5m.a(abstract.o): relocation R_X86_64_32S against `_Py_NotImplementedStruct' can not be used when making a shared object; recompile with -fPIC
/root/.pyenv/versions/3.5.3/lib/libpython3.5m.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status

Traceback (most recent call last):
  File "/root/.pyenv/versions/3.5.3/lib/python3.5/site-packages/theano/gof/lazylinker_c.py", line 75, in <module>
    raise ImportError()
ImportError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/.pyenv/versions/3.5.3/lib/python3.5/site-packages/theano/gof/lazylinker_c.py", line 92, in <module>
    raise ImportError()
ImportError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/root/.pyenv/versions/3.5.3/lib/python3.5/site-packages/theano/__init__.py", line 66, in <module>
    from theano.compile import (
  File "/root/.pyenv/versions/3.5.3/lib/python3.5/site-packages/theano/compile/__init__.py", line 10, in <module>
    from theano.compile.function_module import *
  File "/root/.pyenv/versions/3.5.3/lib/python3.5/site-packages/theano/compile/function_module.py", line 21, in <module>
    import theano.compile.mode
  File "/root/.pyenv/versions/3.5.3/lib/python3.5/site-packages/theano/compile/mode.py", line 10, in <module>
    import theano.gof.vm
  File "/root/.pyenv/versions/3.5.3/lib/python3.5/site-packages/theano/gof/vm.py", line 662, in <module>
    from . import lazylinker_c
  File "/root/.pyenv/versions/3.5.3/lib/python3.5/site-packages/theano/gof/lazylinker_c.py", line 127, in <module>
    preargs=args)
  File "/root/.pyenv/versions/3.5.3/lib/python3.5/site-packages/theano/gof/cmodule.py", line 2316, in compile_str
    (status, compile_stderr.replace('\n', '. ')))
Exception: Compilation failed (return status=1): /usr/bin/ld: /root/.pyenv/versions/3.5.3/lib/libpython3.5m.a(abstract.o): relocation R_X86_64_32S against `_Py_NotImplementedStruct' can not be used when making a shared object; recompile with -fPIC. /root/.pyenv/versions/3.5.3/lib/libpython3.5m.a: error adding symbols: Bad value. collect2: error: ld returned 1 exit status. 

Can someone help figuring out what the solution can be?

pyenv: command not found

`[root@v40515 ~]# curl https://pyenv.run | bash
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 285 100 285 0 0 42 0 0:00:06 0:00:06 --:--:-- 67
Cloning into '/root/.pyenv'...
remote: Enumerating objects: 660, done.
remote: Counting objects: 100% (660/660), done.
remote: Compressing objects: 100% (495/495), done.
remote: Total 660 (delta 329), reused 253 (delta 74), pack-reused 0
Receiving objects: 100% (660/660), 377.32 KiB | 0 bytes/s, done.
Resolving deltas: 100% (329/329), done.
Cloning into '/root/.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
Unpacking objects: 100% (11/11), done.
Cloning into '/root/.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
Unpacking objects: 100% (16/16), done.
Cloning into '/root/.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
Unpacking objects: 100% (10/10), done.
Cloning into '/root/.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
Unpacking objects: 100% (57/57), done.
Cloning into '/root/.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
Unpacking objects: 100% (10/10), done.

WARNING: seems you still have not added 'pyenv' to the load path.

Load pyenv automatically by adding

the following to ~/.bashrc:

export PATH="/root/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
[root@v40515 ~]# exec $SHELL
[root@v40515 ~]# pyenv
bash: pyenv: command not found
[root@v40515 ~]# exec $SHELL
[root@v40515 ~]#
`

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.