Git Product home page Git Product logo

pyenv-installer's Introduction

pyenv installer

This tool installs pyenv and friends. It is inspired by rbenv-installer.

Prerequisites ----Git installed.

In general, compiling your own Python interpreter requires the installation of the appropriate libraries and packages. The installation wiki provides a list of these for common operating systems.

Installation / Update / Uninstallation

Once prerequisites have been installed correctly:

Install: ~~~~ If you wish to install a specific release of Pyenv rather than the latest head, set the PYENV_GIT_TAG environment variable (e.g. export PYENV_GIT_TAG=v2.2.5).

curl https://pyenv.run | bash

pyenv.run redirects to the install script in this repository and the invocation above is equivalent to:

curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash

After installing, follow these instructions to set up your shell environment.

You can now begin using pyenv.

If you need, export USE_SSH to use [email protected](SSH pseudo-URL) instead of https:// for git clone. (Need to have ssh installled.)

Update: ~~~~

pyenv update

Uninstall: ~~~~

pyenv is installed within $PYENV_ROOT (default: ~/.pyenv). To uninstall, just remove it:

rm -fr ~/.pyenv

then remove these three lines from .bashrc:

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

and finally, restart your shell:

exec $SHELL

Using pyenv-installer on Travis CI

Travis itself uses pyenv and therefore PYENV_ROOT is set already. To make it work anyway the installation for pyenv-installer needs to look like this:

[...]
- unset PYENV_ROOT
- curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
- export PATH="$HOME/.pyenv/bin:$PATH"
- pyenv install 3.5.2

Development and testing

The project on github contains a setup for vagrant to test the installer inside a vagrant managed virtual image.

If you don't know vagrant yet: just install the latest package, open a shell in this project directory and say

vagrant up
vagrant ssh

Now you are inside the vagrant container and your prompt should like something like vagrant@vagrant-ubuntu-trusty-64:~$

The project (this repository) is mapped into the vagrant image at /vagrant

cd /vagrant
python setup.py install
echo 'export PATH="$HOME/.pyenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc
source ~/.bashrc

Pyenv should be installed and responding now.

Version History

20190111

  • Remove experimental PyPi support and replace with a dummy package.

20150113

  • Initial release on PyPi.

20130601

  • Initial public release.

License

MIT - see License file.

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

pyenv-installer's Issues

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

../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

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!

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.

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?

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 ?

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!

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!

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."

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?

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.

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'

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.

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 #.#.#

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 ~]#
`

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

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.

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

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.

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?

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.

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?

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

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

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\

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?

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.

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

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.

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 ?

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

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.

/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.

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.

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.

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?

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.