Giter VIP home page Giter VIP logo

pythonbrew's Introduction

pythonbrew

CircleCI Go Report Card GitHub release

Note

This project is no longer under active development.

You can try to pyenv(under active development) instead of pythonbrew.

Overview

pythonbrew is the Python environments manager. it's easy to switch between them.

Inspired by perlbrew and rvm.

Installation

The recommended way to download from each releases and put it somewhere in your PATH.

Or you can get as below

go get -u github.com/utahta/pythonbrew/cmd/pythonbrew

Typically, pythonbrew install packages into ~/.pythonbrew.
If you want to install packages into somewhere else, you can do that by setting a PYTHONBREW_ROOT environment variable

export PYTHONBREW_ROOT=/path/to/.pythonbrew

Setup

Bash

Add the following line at the end of the ~/.bashrc file

eval "$(pythonbrew init)"

Zsh

Add the following line at the end of the ~/.zshrc file

eval "$(pythonbrew init)"

Usage

pythonbrew(pybrew) command [options]

Install some pythons

pythonbrew install 3.6.4
pythonbrew install -v 3.6.4
pythonbrew install -f 3.6.4
pythonbrew install -C "CFLAGS=-I/path/to/include" -C "LDFLAGS=-L/path/to/lib" 3.6.4
pythonbrew install --no-ensurepip 3.6.4
pythonbrew install --no-symlink 3.6.4
pythonbrew install https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tgz
pythonbrew install 2.7.14 3.6.4

Use a specific Python version permanently

pythonbrew switch 2.7.14
pythonbrew switch 3.6.4

Use a specific Python version in the current shell

pythonbrew use 3.6.4

List all installed Python versions

pythonbrew list

List all known installable Python versions

pythonbrew list -k

Uninstall specific Python versions

pythonbrew uninstall 2.7.14

Disable pythonbrew

pythonbrew off

Manage environments (using virtualenv)

pythonbrew venv proj             # Create proj if not exists, Use proj if exists
pythonbrew venv -p 2.7.14 proj2
pythonbrew venv -l
pythonbrew venv --rm proj

Remove all cache

pythonbrew cleanup

Update pythonbrew to the latest version

pythonbrew update

Show version

pythonbrew -v

See more details

pythonbrew -h
pythonbrew <command> -h

Recommended Packages

Debian and Ubuntu

apt-get install zlib1g-dev libssl-dev libreadline-dev

Fedora, Red Hat and CentOS

yum install zlib-devel openssl-devel readline-devel

macOS

brew install openssl
brew install readline

Uninstallation

rm /path/to/pythonbrew
rm -rf ~/.pythonbrew

Remove eval "$(pythonbrew init)" line at the setup file.

pythonbrew's People

Contributors

brandon-m-skinner avatar depp avatar djv avatar eburley avatar freeyoung avatar gthb avatar hrzhu avatar kylegibson avatar limeyd avatar make-github-pseudonymous-again avatar msabramo avatar offbyone avatar r4ntix avatar rjvitorino avatar saj avatar smokey42 avatar tgs avatar tomoyan596 avatar tritium21 avatar tuxlinuxien avatar utahta avatar vtbassmatt avatar wting avatar xkerman avatar yanjost 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

pythonbrew's Issues

Detection of preinstalled Python versions

Hello,

I was wondering if I'm doing something wrong or this is an intended feature. Before installing pythonbrew, I alread installed python 2.6.5 and 3.1.2 in my box. I thought pythonbrew would automatically detect them, but when I try to run pythonbrew venv create proj, I got a message saying i need to install pythons first. Running pythonbrew list yields /usr/bin/python, though.

How do get it to detect my already installed python?

Thanks in advance!

TypeError: exceptions must be classes or instances, not NoneType

I interrupted an installation, and now I get this error:

% pythonbrew install --force 2.5.5           
Traceback (most recent call last):
  File "/Users/ca/.pythonbrew/scripts/pythonbrew_main.py", line 3, in <module>
    pythonbrew.main()
  File "/Users/ca/.pythonbrew/scripts/pythonbrew/__init__.py", line 18, in main
    command.run(args)
  File "/Users/ca/.pythonbrew/scripts/pythonbrew/basecommand.py", line 22, in run
    self.run_command(options, args[1:])
  File "/Users/ca/.pythonbrew/scripts/pythonbrew/commands/install.py", line 43, in run_command
    PythonInstaller(args[0], options).install()
  File "/Users/ca/.pythonbrew/scripts/pythonbrew/installer.py", line 138, in __init__
    headerinfo = get_headerinfo_from_url(self.download_url)
  File "/Users/ca/.pythonbrew/scripts/pythonbrew/downloader.py", line 8, in get_headerinfo_from_url
    return c.readheader(url)
  File "/Users/ca/.pythonbrew/scripts/pythonbrew/curl.py", line 25, in readheader
    raise
TypeError: exceptions must be classes or instances, not NoneType

Install distribute insted of setuptools

I'm wondering if there is --distribute option that to install distribute insted of setuptools for install command.

The option would be used like this.
pythonbrew install --distribute 2.7.2

No support for file: URIs

Hi,
this is not a bug, but a whish...

It would be great to be able to do:
pybrew install -f file:///home/me/tmp/already_downloaded_source.tgz
or even better:
pybrew install -f /home/me/tmp/already_downloaded_source.tgz

Regards.

Skip tests on install

When running pythonbrew install 2.7.2, there are a lot of tests which seem to consume a large part of the time it takes to compile Python. Are they essential part of the build process? Could Pythonbrew provide an option to skip them?

Confused by "python install --force"

Steps to reproduce:

% pythonbrew list
# installed pythons
Python-2.6.6
Python-2.7.1
/Library/Frameworks/Python.framework/Versions/Current/bin/python (*)
% pythonbrew install --force 2.7.1
You are already installed `Python-2.7.1`

I am probably misunderstanding the purpose of "--force" (i.e. force installation even if make test fails) but it would be nice if someone could "reinstall" a given version of python with e.g. new configure options easily.

import bsddb failing on python 2.7.2, Ubuntu 10.10

I tried doing:

import bsddb

on pythonb 2.7.2 installed with pythonbrew and got the error:

ImportError: No module named _bsddb

to fix this I had to install the package libdb4.8-dev and reinstall python 2.7.2. I wonder if pythonbrew should somehow check for this dependency or at least document this.

Accept buildout arguments

I would like to be able to use arguments for the buildout command. For example, currently I'm doing:
buildout -c dev.cfg
to run buildout in a dev environment.

My suggestion (IMHO) would be to do something like:
pythonbrew buildout --args -c dev.cfg

Thanks, and great project BTW!

update:
Forgot to add the workaround in case someone else runs into this:
wget "http://svn.zope.org/*checkout*/zc.buildout/trunk/bootstrap/bootstrap.py"

pythonbrew switch 2.7.2 # or which ever version you are using python ./bootstrap.py -d -c dev.cfg
or in one command...
pythonbrew py ./bootstrap.py -d -c dev.cfg

Now you can use ./bin/buildout

Symbolic link for pip

Hi,
symbolic link for Python is very useful ("py2.5.5" instead of "pybrew use 2.5.5 && python"), a similar thing for pip would be welcome.

python 2.6.6 fails to install on MacOSX Snow Leapord

test test_platform
test test_platform failed -- Traceback (most recent call last):
File "/Users/papaver/.pythonbrew/build/Python-2.6.6/Lib/test/test_platform.py", line 119, in test_mac_ver
self.assertEquals(res[2], 'i386')
AssertionError: 'x86_64' != 'i386'

331 tests OK.
1 test failed:
test_platform
34 tests skipped:
test_al test_bsddb test_bsddb3 test_cd test_cl test_codecmaps_cn
test_codecmaps_hk test_codecmaps_jp test_codecmaps_kr
test_codecmaps_tw test_curses test_dl test_epoll test_gdbm test_gl
test_imageop test_imgfile test_largefile test_linuxaudiodev
test_normalization test_ossaudiodev test_pep277 test_py3kwarn
test_smtpnet test_socketserver test_startfile test_sunaudiodev
test_tcl test_timeout test_urllib2net test_urllibnet test_winreg
test_winsound test_zipfile64
2 skips unexpected on darwin:
test_dl test_tcl

Any idea why I may be running into this? It looked like universal binaries were being created. Thanks.

python 2.6.5 fails to install on Ubuntu 11.10

running build
running build_ext
Traceback (most recent call last):
File "./setup.py", line 1942, in
main()
File "./setup.py", line 1937, in main
'Lib/smtpd.py']
File "/.pythonbrew/build/Python-2.6.5/Lib/distutils/core.py", line 152, in setup dist.run_commands() File "/.pythonbrew/build/Python-2.6.5/Lib/distutils/dist.py", line 975, in run_commands
self.run_command(cmd)
File "/.pythonbrew/build/Python-2.6.5/Lib/distutils/dist.py", line 995, in run_command cmd_obj.run() File "/.pythonbrew/build/Python-2.6.5/Lib/distutils/command/build.py", line 134, in run
self.run_command(cmd_name)
File "/.pythonbrew/build/Python-2.6.5/Lib/distutils/cmd.py", line 333, in run_command self.distribution.run_command(command) File "/.pythonbrew/build/Python-2.6.5/Lib/distutils/dist.py", line 995, in run_command
cmd_obj.run()
File "`/.pythonbrew/build/Python-2.6.5/Lib/distutils/command/build_ext.py", line 340, in run
self.build_extensions()
File "./setup.py", line 103, in build_extensions
missing = self.detect_modules()
File "./setup.py", line 337, in detect_modules
self.add_multiarch_paths()
File "./setup.py", line 314, in add_multiarch_paths
if not find_executable('dpkg-architecture'):
NameError: global name 'find_executable' is not defined
make: *** [sharedmods] Error 1

I think that the problem is in the patch because the manual installation works

Remove bash dependency in favor of pure shell to support BSD, etc

Along with issue #15 which appears to be because the user is using a C-shell, I don't install bash on any of my systems; however, I do a lot of python work including some packages and eggs used by people on other OSes and python versions. Due to these needs, I am very interested in this project, but I refuse to install bash just to try it out.

Please consider implementing pure shell (sh) scripting which is supported on all OSes I am familiar with (aside from Windows, but then there's always cygwin).

Can't build anything with pythonbrew on OS X 10.7 Lion

I have tried building python 2.7.1 and 2.7.2 on a clean install of OS X Lion with Xcode 4.1 to no avail. It fails everytime. I have built ruby and perl via RVM and perlbrew fine, so the basic system in sane. This system is a brand new, and had a clean copy of Snow Leopard on it that was upgraded to Lion.

I noticed this blog about issues that were discovered and fixed in perlbrew for Lion. Maybe it is related?

http://www.perlbrew.pl/FixLion.html

I also have the build.log should it be useful.

Why pythonbrew install --force 2.5.5?

I tried pythonbrew install 2.5.5 but it failed: test_threading was hanging (I guess it's issue 4188: http://bugs.python.org/issue4188)

In the documentation you give this example for installing 2.5.5: pythonbrew install --force 2.5.5, I guess it is to take care of this issue.

Maybe it would be useful to precise it in the documentation.

rvmrc-like auto-switching venv

Will there be support for venv auto-switching (just like what RVM does) ?

In RVM it works like this: if there is .rvmrc inside current directory, RVM will switch Ruby environment based on the content of the .rvmrc.

documentation suggestion

It would be helpful if the documentation made explicit exactly what "pythonbrew switch ..." does. Presumably it modifies the path so only the selected python and its installed-scripts are in the path. Does it also change the PythonPath? How about the current framework version on MacOS X (e.g. /System/Library/Frameworks/Python.framework/Versions/Current or /Library/Frameworks/Python.framework/Versions/Current)?

Thank you for clarifying.

can't use|create|delete|list venv once in a venv

calling pythonbrew venv use smug once everything is cool
calling pythonbrew venv use timer a second time raises error in fact you can't call and venv command inside a virtualenv.

ERROR: Can not use venv command before switching a python. Try 'pythonbrew switch '.
(smug)limeyd@~

Is this a limitation of brew or virtualenv?

pythonbrew on snow leopard failing test_socket

I'm seeing test_socket fail when installing Python 2.6.6 on Snow Leopard:

test test_socket failed -- Traceback (most recent call last):
  File "/Users/gferguson/python/pythonbrew/build/Python-2.6.6/Lib/test/test_socket.py", line 483, in testSockName
    my_ip_addr = socket.gethostbyname(socket.gethostname())
gaierror: [Errno 8] nodename nor servname provided, or not known

I triangulated the problem using Ruby and got the same message so I think it's something in our network or this machine's configuration being unable to resolve the hostname "S1WSMA-JHAMI". I tried to resolve google.com, and it was successfully done using the system Python, so I'm pretty sure that test_socket's failure is a false-positive.

How can I tell pythonbrew to ignore the test's results and continue on?

Also, I'm seeing the following tests skipped. I'm not sure which, if any, I should be worried about. Got some insight?

33 tests skipped:
    test_al test_bsddb test_bsddb3 test_cd test_cl test_codecmaps_cn
    test_codecmaps_hk test_codecmaps_jp test_codecmaps_kr
    test_codecmaps_tw test_curses test_dl test_epoll test_gdbm test_gl
    test_imageop test_imgfile test_largefile test_linuxaudiodev
    test_normalization test_ossaudiodev test_pep277 test_py3kwarn
    test_smtpnet test_socketserver test_startfile test_sunaudiodev
    test_timeout test_urllib2net test_urllibnet test_winreg
    test_winsound test_zipfile64
1 skip unexpected on darwin:
    test_dl
make: *** [test] Error 1

Configuration file

Available Python versions are in define.py. Adding versions means new pythonbrew release. It could be interesting to read external file (like ~/.pythonbrew) to read available versions.

doesn't install any python on ubuntu ( running on amazon aws)

Trying to install any of the pythons on ubuntu ( running on an amazon aws with canonical ubuntu images ) fails

or rather, gets stuck as mentioned below

 pythonbrew install --verbose 2.7.2


Use the previously fetched /home/ubuntu/.pythonbrew/dists/Python-2.7.2.tgz
Extracting Python-2.7.2.tgz into /home/ubuntu/.pythonbrew/build/Python-2.7.2

This could take a while. You can run the following command on another shell to track the status:
  tail -f /home/ubuntu/.pythonbrew/log/build.log

Installing Python-2.7.2 into /home/ubuntu/.pythonbrew/pythons/Python-2.7.2
./configure --prefix=/home/ubuntu/.pythonbrew/pythons/Python-2.7.2  
checking for --enable-universalsdk... no
checking for --with-universal-archs... 32-bit
checking MACHDEP... linux3
checking EXTRAPLATDIR...
checking machine type as reported by uname -m... x86_64
checking for --without-gcc... no
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for --with-cxx-main=<compiler>... no
checking for g++... g++
configure: WARNING:

By default, distutils will build C++ extension modules with "g++".
If this is not intended, then set CXX on the configure command line.

checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for --with-suffix...
checking for case-insensitive build directory... no
checking LIBRARY... libpython$(VERSION).a
checking LINKCC... $(PURIFY) $(MAINCC)
checking for GNU ld... yes
checking for --enable-shared... no
checking for --enable-profiling...
checking LDLIBRARY... libpython$(VERSION).a
checking for ranlib... ranlib
checking for ar... ar
checking for svnversion... not-found
checking for hg... not-found
checking for a BSD-compatible install... /usr/bin/install -c
checking for --with-pydebug... no
checking whether gcc accepts -fno-strict-aliasing... yes
checking whether gcc accepts -OPT:Olimit=0... no
checking whether gcc accepts -Olimit 1500... no
checking whether gcc supports ParseTuple __format__... no
checking whether pthreads are available without options... no
checking whether gcc accepts -Kpthread... no
checking whether gcc accepts -Kthread... no

and it never proceeds further.

Symlink without python version

Symlink command is useful, but it's bit odd for a specific use case: when you want only one instance of an application, like Hg or Landslide: you don't want Hg for all your installed pythons, just in your default python. Of course you can install hg in your system Python but the goal behind my usage of pythonbrew is to use only pythons in my home.

So, an option like --default or -d would be welcome :

pybrew symlink -b --d 2.7.1 hg

Uninstalling

I guess that to uninstall pythonbrew, we just have to do:

rm -Rf ~/.pythonbrew

and remove the source /Users/username/.pythonbrew/etc/bashrc line in .bashrc?

If so, I will add it to the wiki for future reference.

Systemwide install does not manage permissions well with virtualenv's

After installing pythonbrew systemwide as root, file permissions are not managed well. The venv command specifically seems to require write access to the venv.run file in the path specified for PATH_ETC ( or more simply: PATH_ETC_VENV).

It looks like all the venv commands need to set and manage some environment variables in this file. This is probably a good thing that pythonbrew manages this... as it seeks to be analogous to RVM (in the Ruby world) in that it's a build system for python versions and an 'environment controller'' for virtualenv's. It's also a good thing that you're using virtualenv, because it is currently the de-facto environment isolation solution for Python that provides similar functionality to RVM's gemsets. I can see that when installing pythonbrew + virtualenv to one's home directory... write access to the venv.run file is not a problem.

However, when considering a systemwide multi-user system, perhaps designing a better scheme of managing these environment variables for multiple users would be warranted. I've been successful in setting up an RVM install for multiple users, with each user owning their own gemset's directory. This way, each 'tenant' user can only install gems into their own gemset, but not create or delete gemsets owned by other users.

Steps to Reproduce

  • Set PYTHONBREW_ROOT to some systemwide path... for example:
    • export PYTHONBREW_ROOT="/opt/pythonbrew" OR
    • export PYTHONBREW_ROOT="/usr/local/pythonbrew"
  • Install pythonbrew as root ( or perhaps a pythonbrew system-level user ) with the usual install instructions
  • Install one (or more) Python versions with:
    • pythonbrew install --force ${PYTHON_VERSION}
  • Use a python version with:
    • pythonbrew switch ${PYTHON_VERSION}
  • Install virtualenv and virtualenv wrapper with:
    • pip install virtualenv virtualenvwraper
  • Create a virtualenv for a user with:
    • pythonbrew venv create ${my_username}
    • Recursively change ownership of all virtualenv folders for this user:
    • find ${PYTHONBREW_ROOT}/venvs/ -type d -iname "${my_username}" -print0 | xargs -I{} -0 chown -R --preserve-root --no-dereference ${my_username}:pythonbrew '{}'
  • Try using or listing the virtualenv as this user:
    • su --login ${my_username}
    • pythonbrew switch ${PYTHON_VERSION}
    • pythonbrew venv use ${my_username} OR
    • pythonbrew venv list

Misleading Error Returned

Even if the venv directory for any user is owned by them, pythonbrew exits with a misleading error:

$ pythonbrew venv use build_pythonbrew
ERROR: `use` command not found.
$ pythonbrew venv list
ERROR: `list` command not found.

This is because a generic try / except block catches the permission denied exception. Currently, any exception here will return a command not found error. By using pdb (see this gist), I was able to figure out what was going on:

build_pythonbrew@lucid64:~$ pythonbrew venv list
> /opt/pythonbrew/pythonbrew/scripts/pythonbrew/commands/venv.py(89)run_command()
-> self.__getattribute__('run_command_%s' % cmd)(options, args)
(Pdb) cont
ERROR: `list` command not found.
Traceback (most recent call last):
  File "/opt/pythonbrew/pythonbrew/scripts/pythonbrew/commands/venv.py", line 89, in run_command
    self.__getattribute__('run_command_%s' % cmd)(options, args)
  File "/opt/pythonbrew/pythonbrew/scripts/pythonbrew/commands/venv.py", line 156, in run_command_list
    'pkgname': self._pkgname})
  File "/opt/pythonbrew/pythonbrew/scripts/pythonbrew/commands/venv.py", line 159, in _write
    fp = open(PATH_ETC_VENV, 'w')
IOError: [Errno 13] Permission denied: '/opt/pythonbrew/pythonbrew/etc/venv.run'
> /opt/pythonbrew/pythonbrew/scripts/pythonbrew/commands/venv.py(159)_write()
-> fp = open(PATH_ETC_VENV, 'w')
(Pdb)

Systemwide install

RVM has this for server usage. It allows Ruby versions to be installed in /usr/local/rvm and be manageable by users in the rvm user group.

Pythonbrew should do the same with /usr/local/pythonbrew.

Windows Support?

Any plans to support Windows? Looking at the installation instructions and glancing at the code it doesn't look like windows is supported. Are there any plans to support windows?

Handle venv binary with the symlink command

venv is a nice feature, but it's hard to remember the path to the new Python binary. It could be great to add alias with a command like this one:
$pybrew symlink -v venv-name python

And I get a py-venv-name (ex: py-bb101 if my venv name is bb101).

Maybe add the python version (py-2.5-bb101).

Error performing pythonbrew install --configure="--enable-shared" 2.7.2

Hi,

I am trying the following command:

[python-deploy@localhost mod_python-3.2.10]$ pythonbrew install --configure="--enable-shared" 2.7.2

But it doesn't seem to work. The very last line in build.log shows:

/home/python-deploy/.pythonbrew/pythons/Python-2.7.2/bin/python: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory

The only error that the output shows is:

ERROR: Failed to install setuptools. See /home/python-deploy/.pythonbrew/build.log to see why.
Skip installation of setuptools.

Add --as option

I will implement --as option. it work like this:

$ pybrew install 2.6.6 --as=foo
$ pybrew switch foo

$ pybrew install 2.6.6 --as=bar -C "--with-readline"
$ pybrew switch bar

Cleanup of OS X python build flags

The arch flag (with-universal-archs) should be 64-bit, 32-bit or all when building at least Python 2.6 (haven't checked the other versions) on OS X. It can probably be removed entirely since the configure script should detect that on it's own and macs only ship with 64-bit nowadays anyway.

Also i can't find any reason to include the enable-universalsdk either. That seems so only be used for building universal (both ppc and intel) binaries and i don't see any reason so continue to support ppc when even apple doesn't do that?

perlbrew install fails with TypeError

On Ubuntu 10.04

$ pythonbrew version
0.9

mock@hd-t3943cl:~$ pythonbrew install 2.7.2
Traceback (most recent call last):
File "/home/mock/.pythonbrew/scripts/pythonbrew_main.py", line 3, in
pythonbrew.main()
File "/home/mock/.pythonbrew/scripts/pythonbrew/init.py", line 23, in main
command.run(args[1:])
File "/home/mock/.pythonbrew/scripts/pythonbrew/basecommand.py", line 21, in run
self.run_command(options, args)
File "/home/mock/.pythonbrew/scripts/pythonbrew/commands/install.py", line 73, in run_command
p = PythonInstaller(arg, options)
File "/home/mock/.pythonbrew/scripts/pythonbrew/installer/pythoninstaller.py", line 58, in init
headerinfo = get_headerinfo_from_url(self.download_url)
File "/home/mock/.pythonbrew/scripts/pythonbrew/downloader.py", line 10, in get_headerinfo_from_url
return c.readheader(url)
File "/home/mock/.pythonbrew/scripts/pythonbrew/curl.py", line 26, in readheader
raise
TypeError: exceptions must be old-style classes or derived from BaseException, not NoneType

on snow leopard

$ pythonbrew version
0.9

shady:~ mock$ pythonbrew install 2.7.2
Traceback (most recent call last):
File "/Users/mock/.pythonbrew/scripts/pythonbrew_main.py", line 3, in
pythonbrew.main()
File "/Users/mock/.pythonbrew/scripts/pythonbrew/init.py", line 23, in main
command.run(args[1:])
File "/Users/mock/.pythonbrew/scripts/pythonbrew/basecommand.py", line 21, in run
self.run_command(options, args)
File "/Users/mock/.pythonbrew/scripts/pythonbrew/commands/install.py", line 71, in run_command
p = PythonInstallerMacOSX(arg, options)
File "/Users/mock/.pythonbrew/scripts/pythonbrew/installer/pythoninstaller.py", line 237, in init
super(PythonInstallerMacOSX, self).init(arg, options)
File "/Users/mock/.pythonbrew/scripts/pythonbrew/installer/pythoninstaller.py", line 58, in init
headerinfo = get_headerinfo_from_url(self.download_url)
File "/Users/mock/.pythonbrew/scripts/pythonbrew/downloader.py", line 10, in get_headerinfo_from_url
return c.readheader(url)
File "/Users/mock/.pythonbrew/scripts/pythonbrew/curl.py", line 26, in readheader
raise
TypeError: exceptions must be classes or instances, not NoneType

The two machines I tested on are on totally different networks, so it's probably not some sort of weird network issue with my stuff.

Multiple Python's fail to install on OSX

So far the following Pythons have failed to install on my 64-bit Snow Leopard install:

  • Python-2.4.6
  • Python-2.5.5
  • Python-3.2

Each failed for tests failing to pass, although the test(s) in question varied with the version. For Python-3.2 it was a multiprocessing test, for Python-2.4.6 it was test_socket and for Python-2.5.5 it was various os-specific tests.

Help command by default

When you type pybrew, her said:
error: You must give a command (use "pythonbrew help" to see a list of commands)

Display help message is more useful I think.

`write_current` is not defined

Hi.

I Installed version 0.6.6.

I execute

$ pythonbrew off

but command result:

Traceback (most recent call last):
  File "/home/nyarla/.pythonbrew/scripts/pythonbrew_main.py", line 3, in <module>
    pythonbrew.main()
  File "/home/nyarla/.pythonbrew/scripts/pythonbrew/__init__.py", line 19, in main
    command.run(args)
  File "/home/nyarla/.pythonbrew/scripts/pythonbrew/basecommand.py", line 22, in run
    self.run_command(options, args[1:])
  File "/home/nyarla/.pythonbrew/scripts/pythonbrew/commands/off.py", line 10, in run_command
    off()
  File "/home/nyarla/.pythonbrew/scripts/pythonbrew/util.py", line 111, in off
    write_current(PATH_BIN)
NameError: global name 'write_current' is not defined

Running environment:

OS: Ubuntu 10.10 32bit Japanese remix
Shell: zsh on Gnome terminal
Pythonbrew: 0.6.6

Create symbolic link in the home

I'm always lost with the use and switch commands. Thus I use "pybrew py -p 2.5.5 ". A simpler solution is to create automatically (or with a command) an symlink, like "/bin/py2.5" to link to "/.pythonbrew/pythons/Python-2.5.5/bin/python".

ERROR: Failed to patch - Python-3.2 on Centos 5.6

Whenever I run the following it errors out.

pythonbrew install 3.2
Use the previously fetched /home/superbox/.pythonbrew/dists/Python-3.2.tgz
Extracting Python-3.2.tgz into /home/superbox/.pythonbrew/build/Python-3.2

This could take a while. You can run the following command on another shell to track the status:
tail -f /home/superbox/.pythonbrew/log/build.log

Patching Python-3.2
ERROR: Failed to patch `/home/superbox/.pythonbrew/build/Python-3.2`.
127: failed to `(patch -p0 < /home/superbox/.pythonbrew/patches/all/python32/patch-setup.py.diff) >>     '/home/superbox/.pythonbrew/log/build.log' 2>&1`

I checked the logs and it just has:

/bin/sh: patch: command not found

I was able to install 2.7.2 without issue, and this was on a clean system so I didn't realize I needed patch. After doing

yum install patch

everything went smoothly. It might not be a bad idea to tell your Redhat/Fedora/CentOS users that they need patch installed first. I'm bringing up this issue purely so others can find it via the web and get it resolved.

Missing Python 3.2

Hi,
Python 3.2 is now released. Could you add this release on the list?

Thanks.

Seems not working on FreeBSD

%./pythonbrew-install
Downloading http://pypi.python.org/packages/source/p/pythonbrew/pythonbrew-0.7.tar.gz

################################################################## 100,0%

Extracting /storage/home/srv23417/.pythonbrew/dists/pythonbrew-0.7.tar.gz
Installing pythonbrew into /storage/home/srv23417/.pythonbrew
Traceback (most recent call last):
File "/storage/home/srv23417/.pythonbrew/dists/pythonbrew-0.7/pythonbrew_install.py", line 16, in
install_pythonbrew()
File "/u/c33/srv23417/.pythonbrew/dists/pythonbrew-0.7/pythonbrew/installer.py", line 22, in install_pythonbrew
PythonbrewInstaller().install(INSTALLER_ROOT)
File "/u/c33/srv23417/.pythonbrew/dists/pythonbrew-0.7/pythonbrew/installer.py", line 80, in install
shutil.copytree(os.path.join(installer_root,"patches"), PATH_PATCHES)
File "/usr/local/lib/python2.6/shutil.py", line 177, in copytree
raise Error, errors
shutil.Error: [('/u/c33/srv23417/.pythonbrew/dists/pythonbrew-0.7/pythonbrew/patches/macosx/python24/patch-configure', '/storage/home/srv23417/.pythonbrew/patches/macosx/python24/patch-configure', "[Errno 45] Operation not supported: '/storage/home/srv23417/.pythonbrew/patches/macosx/python24/patch-configure'"), ('/u/c33/srv23417/.pythonbrew/dists/pythonbrew-0.7/pythonbrew/patches/macosx/python24/patch-configure-badcflags.diff', '/storage/home/srv23417/.pythonbrew/patches/macosx/python24/patch-configure-badcflags.diff', "[Errno 45] Operation not supported: '/storage/home/srv23417/.pythonbrew/patches/macosx/python24/patch-configure-badcflags.diff'"), ('/u/c33/srv23417/.pythonbrew/dists/pythonbrew-0.7/pythonbrew/patches/macosx/python24/patch-Mac-OSX-Makefile.in', '/storage/home/srv23417/.pythonbrew/patches/macosx/python24/patch-Mac-OSX-Makefile.in', "[Errno 45] Operation not supported: '/storage/home/srv23417/.pythonbrew/patches/macosx/python24/patch-Mac-OSX-Makefile.in'"), ('/u/c33/srv23417/.pythonbrew/dists/pythonbrew-0.7/pythonbrew/patches/macosx/python24/patch-configure-arch_only.diff', '/storage/home/srv23417/.pythonbrew/patches/macosx/python24/patch-configure-arch_only.diff', "[Errno 45] Operation not supported: '/storage/home/srv23417/.pythonbrew/patches/macosx/python24/patch-configure-arch_only.diff'"), ('/u/c33/srv23417/.pythonbrew/dists/pythonbrew-0.7/pythonbrew/patches/macosx/python24/patch-Lib-cgi.py.diff', '/storage/home/srv23417/.pythonbrew/patches/macosx/python24/patch-Lib-cgi.py.diff', "[Errno 45] Operation not supported: '/storage/home/srv23417/.pythonbrew/patches/macosx/python24/patch-Lib-cgi.py.diff'"), ('/u/c33/srv23417/.pythonbrew/dists/pythonbrew-0.7/pythonbrew/patches/macosx/python24/patch-setup.py.diff', '/storage/home/srv23417/.pythonbrew/patches/macosx/python24/patch-setup.py.diff', "[Errno 45] Operation not supported: '/storage/home/srv23417/.pythonbrew/patches/macosx/python24/patch-setup.py.diff'"), ('/u/c33/srv23417/.pythonbrew/dists/pythonbrew-0.7/pythonbrew/patches/macosx/python24/patch-macosmodule.diff', '/storage/home/srv23417/.pythonbrew/patches/macosx/python24/patch-macosmodule.diff', "[Errno 45] Operation not supported: '/storage/home/srv23417/.pythonbrew/patches/macosx/python24/patch-macosmodule.diff'"), ('/u/c33/srv23417/.pythonbrew/dists/pythonbrew-0.7/pythonbrew/patches/macosx/python24/patch-Include-pyport.h', '/storage/home/srv23417/.pythonbrew/patches/macosx/python24/patch-Include-pyport.h', "[Errno 45] Operation not supported: '/storage/home/srv23417/.pythonbrew/patches/macosx/python24/patch-Include-pyport.h'"), ('/u/c33/srv23417/.pythonbrew/dists/pythonbrew-0.7/pythonbrew/patches/macosx/python24/patch-Makefile.pre.in', '/storage/home/srv23417/.pythonbrew/patches/macosx/python24/patch-Makefile.pre.in', "[Errno 45] Operation not supported: '/storage/home/srv23417/.pythonbrew/patches/macosx/python24/patch-Makefile.pre.in'"), ('/u/c33/srv23417/.pythonbrew/dists/pythonbrew-0.7/pythonbrew/patches/macosx/python24/patch-pymactoolbox.diff', '/storage/home/srv23417/.pythonbrew/patches/macosx/python24/patch-pymactoolbox.diff', "[Errno 45] Operation not supported: '/storage/home/srv23417/.pythonbrew/patches/macosx/python24/patch-pymactoolbox.diff'"), ('/u/c33/srv23417/.pythonbrew/dists/pythonbrew-0.7/pythonbrew/patches/macosx/python24/patch-Mac-OSX-IDLE-Makefile.in', '/storage/home/srv23417/.pythonbrew/patches/macosx/python24/patch-Mac-OSX-IDLE-Makefile.in', "[Errno 45] Operation not supported: '/storage/home/srv23417/.pythonbrew/patches/macosx/python24/patch-Mac-OSX-IDLE-Makefile.in'"), ('/u/c33/srv23417/.pythonbrew/dists/pythonbrew-0.7/pythonbrew/patches/macosx/python24/patch-mactoolboxglue.diff', '/storage/home/srv23417/.pythonbrew/patches/macosx/python24/patch-mactoolboxglue.diff', "[Errno 45] Operation not supported: '/storage/home/srv23417/.pythonbrew/patches/macosx/python24/patch-mactoolboxglue.diff'"), ('/u/c33/srv23417/.pythonbrew/dists/pythonbrew-0.7/pythonbrew/patches/macosx/python24/patch-Mac-OSX-PythonLauncher-Makefile.in', '/storage/home/srv23417/.pythonbrew/patches/macosx/python24/patch-Mac-OSX-PythonLauncher-Makefile.in', "[Errno 45] Operation not supported: '/storage/home/srv23417/.pythonbrew/patches/macosx/python24/patch-Mac-OSX-PythonLauncher-Makefile.in'"), ('/u/c33/srv23417/.pythonbrew/dists/pythonbrew-0.7/pythonbrew/patches/macosx/python24/patch-gestaltmodule.c.diff', '/storage/home/srv23417/.pythonbrew/patches/macosx/python24/patch-gestaltmodule.c.diff', "[Errno 45] Operation not supported: '/storage/home/srv23417/.pythonbrew/patches/macosx/python24/patch-gestaltmodule.c.diff'"), ('/u/c33/srv23417/.pythonbrew/dists/pythonbrew-0.7/pythonbrew/patches/macosx/python24/patch-Lib-site.py.diff', '/storage/home/srv23417/.pythonbrew/patches/macosx/python24/patch-Lib-site.py.diff', "[Errno 45] Operation not supported: '/storage/home/srv23417/.pythonbrew/patches/macosx/python24/patch-Lib-site.py.diff'"), '/u/c33/srv23417/.pythonbrew/dists/pythonbrew-0.7/pythonbrew/patches/macosx/python24', '/storage/home/srv23417/.pythonbrew/patches/macosx/python24', "[Errno 45] Operation not supported: '/storage/home/srv23417/.pythonbrew/patches/macosx/python24'", ('/u/c33/srv23417/.pythonbrew/dists/pythonbrew-0.7/pythonbrew/patches/macosx/python25/patch-Modules-posixmodule.c.diff', '/storage/home/srv23417/.pythonbrew/patches/macosx/python25/patch-Modules-posixmodule.c.diff', "[Errno 45] Operation not supported: '/storage/home/srv23417/.pythonbrew/patches/macosx/python25/patch-Modules-posixmodule.c.diff'"), ('/u/c33/srv23417/.pythonbrew/dists/pythonbrew-0.7/pythonbrew/patches/macosx/python25/patch-pyconfig.h.in.diff', '/storage/home/srv23417/.pythonbrew/patches/macosx/python25/patch-pyconfig.h.in.diff', "[Errno 45] Operation not supported: '/storage/home/srv23417/.pythonbrew/patches/macosx/python25/patch-pyconfig.h.in.diff'"), ('/u/c33/srv23417/.pythonbrew/dists/pythonbrew-0.7/pythonbrew/patches/macosx/python25/patch-Makefile.pre.in.diff', '/storage/home/srv23417/.pythonbrew/patches/macosx/python25/patch-Makefile.pre.in.diff', "[Errno 45] Operation not supported: '/storage/home/srv23417/.pythonbrew/patches/macosx/python25/patch-Makefile.pre.in.diff'"), ('/u/c33/srv23417/.pythonbrew/dists/pythonbrew-0.7/pythonbrew/patches/macosx/python25/patch-64bit.diff', '/storage/home/srv23417/.pythonbrew/patches/macosx/python25/patch-64bit.diff', "[Errno 45] Operation not supported: '/storage/home/srv23417/.pythonbrew/patches/macosx/python25/patch-64bit.diff'"), ('/u/c33/srv23417/.pythonbrew/dists/pythonbrew-0.7/pythonbrew/patches/macosx/python25/patch-configure.diff', '/storage/home/srv23417/.pythonbrew/patches/macosx/python25/patch-configure.diff', "[Errno 45] Operation not supported: '/storage/home/srv23417/.pythonbrew/patches/macosx/python25/patch-configure.diff'"), ('/u/c33/srv23417/.pythonbrew/dists/pythonbrew-0.7/pythonbrew/patches/macosx/python25/patch-gestaltmodule.c.diff', '/storage/home/srv23417/.pythonbrew/patches/macosx/python25/patch-gestaltmodule.c.diff', "[Errno 45] Operation not supported: '/storage/home/srv23417/.pythonbrew/patches/macosx/python25/patch-gestaltmodule.c.diff'"), ('/u/c33/srv23417/.pythonbrew/dists/pythonbrew-0.7/pythonbrew/patches/macosx/python25/patch-Misc-setuid-prog.c.diff', '/storage/home/srv23417/.pythonbrew/patches/macosx/python25/patch-Misc-setuid-prog.c.diff', "[Errno 45] Operation not supported: '/storage/home/srv23417/.pythonbrew/patches/macosx/python25/patch-Misc-setuid-prog.c.diff'"), ('/u/c33/srv23417/.pythonbrew/dists/pythonbrew-0.7/pythonbrew/patches/macosx/python25/patch-configure-badcflags.diff', '/storage/home/srv23417/.pythonbrew/patches/macosx/python25/patch-configure-badcflags.diff', "[Errno 45] Operation not supported: '/storage/home/srv23417/.pythonbrew/patches/macosx/python25/patch-configure-badcflags.diff'"), ('/u/c33/srv23417/.pythonbrew/dists/pythonbrew-0.7/pythonbrew/patches/macosx/python25/patch-Lib-distutils-dist.py.diff', '/storage/home/srv23417/.pythonbrew/patches/macosx/python25/patch-Lib-distutils-dist.py.diff', "[Errno 45] Operation not supported: '/storage/home/srv23417/.pythonbrew/patches/macosx/python25/patch-Lib-distutils-dist.py.diff'"), ('/u/c33/srv23417/.pythonbrew/dists/pythonbrew-0.7/pythonbrew/patches/macosx/python25/patch-Lib-cgi.py.diff', '/storage/home/srv23417/.pythonbrew/patches/macosx/python25/patch-Lib-cgi.py.diff', "[Errno 45] Operation not supported: '/storage/home/srv23417/.pythonbrew/patches/macosx/python25/patch-Lib-cgi.py.diff'"), ('/u/c33/srv23417/.pythonbrew/dists/pythonbrew-0.7/pythonbrew/patches/macosx/python25/patch-FSIORefNum.diff', '/storage/home/srv23417/.pythonbrew/patches/macosx/python25/patch-FSIORefNum.diff', "[Errno 45] Operation not supported: '/storage/home/srv23417/.pythonbrew/patches/macosx/python25/patch-FSIORefNum.diff'"), ('/u/c33/srv23417/.pythonbrew/dists/pythonbrew-0.7/pythonbrew/patches/macosx/python25/patch-setup.py.diff', '/storage/home/srv23417/.pythonbrew/patches/macosx/python25/patch-setup.py.diff', "[Errno 45] Operation not supported: '/storage/home/srv23417/.pythonbrew/patches/macosx/python25/patch-setup.py.diff'"), ('/u/c33/srv23417/.pythonbrew/dists/pythonbrew-0.7/pythonbrew/patches/macosx/python25/patch-configure-arch_only.diff', '/storage/home/srv23417/.pythonbrew/patches/macosx/python25/patch-configure-arch_only.diff', "[Errno 45] Operation not supported: '/storage/home/srv23417/.pythonbrew/patches/macosx/python25/patch-configure-arch_only.diff'"), '/u/c33/srv23417/.pythonbrew/dists/pythonbrew-0.7/pythonbrew/patches/macosx/python25', '/storage/home/srv23417/.pythonbrew/patches/macosx/python25', "[Errno 45] Operation not supported: '/storage/home/srv23417/.pythonbrew/patches/macosx/python25'", '/u/c33/srv23417/.pythonbrew/dists/pythonbrew-0.7/pythonbrew/patches/macosx', '/storage/home/srv23417/.pythonbrew/patches/macosx', "[Errno 45] Operation not supported: '/storage/home/srv23417/.pythonbrew/patches/macosx'", '/u/c33/srv23417/.pythonbrew/dists/pythonbrew-0.7/pythonbrew/patches', '/storage/home/srv23417/.pythonbrew/patches', "[Errno 45] Operation not supported: '/storage/home/srv23417/.pythonbrew/patches'"]
Failed to install pythonbrew.

has problem with bash

Bash's hash should be updated (using "hash -r") after a "switch" command or an "off" command.

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.