osx - Python installation errors

06
2014-06
  • asselinpaul

    This is incredibly, annoying, I can't do anything in python until this is fixed. Thanks if you can help, I know it can be annoying to have to look at so much code but i'd really appreciate. I'm trying to install python because I think my previous installs aren't very clean.

        familys-imac:~ Paul-Arthur$ ruby -e "$(curl -fsS https://raw.github.com/gist/323731)"
        /usr/local/.git already exists!
        familys-imac:~ Paul-Arthur$  brew install python --framework
        Warning: It appears you have MacPorts or Fink installed.
        Software installed with other package managers causes known problems for
        Homebrew. If a formula fails to build, uninstall MacPorts/Fink and try again.
        ==> Installing python dependency: readline
        ==> Downloading http://ftpmirror.gnu.org/readline/readline-6.2.tar.gz
        ######################################################################## 100.0%
        ==> Downloading patches
        ######################################################################## 100.0%
        ==> Patching
        patching file vi_mode.c
        patching file callback.c
        ==> ./configure --prefix=/usr/local/Cellar/readline/6.2.1 --mandir=/usr/local/Ce
        ==> make install
        ==> Caveats
        This formula is keg-only, so it was not symlinked into /usr/local.
    
        OS X provides the BSD libedit library, which shadows libreadline.
        In order to prevent conflicts when programs look for libreadline we are
        defaulting this GNU Readline installation to keg-only.
    
        Generally there are no consequences of this for you.
        If you build your own software and it requires this formula, you'll need
        to add its lib & include paths to your build variables:
    
            LDFLAGS  -L/usr/local/Cellar/readline/6.2.1/lib
            CPPFLAGS -I/usr/local/Cellar/readline/6.2.1/include
        ==> Summary
        /usr/local/Cellar/readline/6.2.1: 30 files, 1.7M, built in 26 seconds
        ==> Installing python dependency: sqlite
        ==> Downloading http://www.sqlite.org/sqlite-autoconf-3070900.tar.gz
        ######################################################################## 100.0%
        ==> ./configure --prefix=/usr/local/Cellar/sqlite/3.7.9
        ==> make install
        /usr/local/Cellar/sqlite/3.7.9: 9 files, 1.9M, built in 35 seconds
        ==> Installing python dependency: gdbm
        ==> Downloading http://ftpmirror.gnu.org/gdbm/gdbm-1.9.1.tar.gz
        ######################################################################## 100.0%
        ==> ./configure --prefix=/usr/local/Cellar/gdbm/1.9.1 --mandir=/usr/local/Cellar
        ==> make install
        /usr/local/Cellar/gdbm/1.9.1: 10 files, 224K, built in 9 seconds
        ==> Installing python
        ==> Downloading http://www.python.org/ftp/python/2.7.2/Python-2.7.2.tar.bz2
        ######################################################################## 100.0%
        ==> Patching
        patching file Lib/whichdb.py
        Hunk #1 succeeded at 91 with fuzz 1.
        ==> ./configure --prefix=/usr/local/Cellar/python/2.7.2 --enable-framework=/usr/
        ==> make
        ==> make install
        ==> Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0
        ######################################################################## 100.0%
        ==> /usr/local/Cellar/python/2.7.2/bin/python setup.py install
        Before install bootstrap.
        Scanning installed packages
        No setuptools distribution found
        running install
        error: can't create or remove files in install directory
    
        The following error occurred while trying to add or remove files in the
        installation directory:
    
            [Errno 13] Permission denied: '/usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/test-easy-install-37718.write-test'
    
        The installation directory you specified (via --install-dir, --prefix, or
        the distutils default setting) was:
    
            /usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/
    
        Perhaps your account does not have write access to this directory?  If the
        installation directory is a system-owned directory, you may need to sign in
        as the administrator or "root" account.  If you do not have administrative
        access to this machine, you may wish to choose a different installation
        directory, preferably one that is listed in your PYTHONPATH environment
        variable.
    
        For information on other options, you may wish to consult the
        documentation at:
    
          http://packages.python.org/distribute/easy_install.html
    
        Please make the appropriate changes for your system and try again.
    
        ==> Exit Status: 1
        http://github.com/mxcl/homebrew/blob/master/Library/Formula/python.rb#L106
        ==> Environment
        gcc-4.2: error trying to exec '/usr/bin/i686-apple-darwin11-gcc-4.2.1': execvp: No such file or directory
        HOMEBREW_VERSION: 0.8
        HEAD: 67da1952979f60b776f1b986850e45b98c4ccaa9
        HOMEBREW_PREFIX: /usr/local
        HOMEBREW_CELLAR: /usr/local/Cellar
        HOMEBREW_REPOSITORY: /usr/local
        HOMEBREW_LIBRARY_PATH: /usr/local/Library/Homebrew
        Hardware: dual-core 64-bit penryn
        OS X: 10.7.2
        Kernel Architecture: x86_64
        Ruby: 1.8.7-249
        /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
        Xcode: 4.2.1
        GCC-4.0: N/A
        GCC-4.2: build 0
        LLVM: build 2336
        Clang: 3.0-211.12
        MacPorts or Fink? /opt/local/bin/port
        X11 installed? true
        ==> Build Flags
        CC: /usr/bin/llvm-gcc => /usr/llvm-gcc-4.2/bin/llvm-gcc-4.2
        CXX: /usr/bin/llvm-g++ => /usr/llvm-gcc-4.2/bin/llvm-g++-4.2
        LD: /usr/bin/llvm-gcc => /usr/llvm-gcc-4.2/bin/llvm-gcc-4.2
        CFLAGS: -O3 -w -pipe -march=core2 -msse4.1
        CXXFLAGS: -O3 -w -pipe -march=core2 -msse4.1
        CPPFLAGS: -I/usr/local/Cellar/readline/6.2.1/include
        LDFLAGS: -L/usr/local/Cellar/readline/6.2.1/lib
        PKG_CONFIG_PATH: /usr/local/Cellar/readline/6.2.1/lib/pkgconfig
    
        Error: Failed executing: /usr/local/Cellar/python/2.7.2/bin/python setup.py install
        These existing issues may help you:
            https://github.com/mxcl/homebrew/issues/6233
            https://github.com/mxcl/homebrew/issues/6984
            https://github.com/mxcl/homebrew/issues/7687
            https://github.com/mxcl/homebrew/issues/8070
            https://github.com/mxcl/homebrew/issues/8713
            https://github.com/mxcl/homebrew/issues/9017
            https://github.com/mxcl/homebrew/issues/9167
            https://github.com/mxcl/homebrew/issues/9215
            https://github.com/mxcl/homebrew/issues/9345
            https://github.com/mxcl/homebrew/issues/9370
            https://github.com/mxcl/homebrew/issues/9434
            https://github.com/mxcl/homebrew/issues/9489
        Otherwise, please report the bug:
            https://github.com/mxcl/homebrew/wiki/checklist-before-filing-a-new-issue
        familys-imac:~ Paul-Arthur$ brew install pip
        Error: No available formula for pip
        Install pip with easy_install:
    
            easy_install pip
        familys-imac:~ Paul-Arthur$ easy_install pip
        Searching for pip
        Best match: pip 1.0.2
        Processing pip-1.0.2-py2.6.egg
        pip 1.0.2 is already the active version in easy-install.pth
        Installing pip script to /Library/Frameworks/Python.framework/Versions/2.6/bin
        error: /Library/Frameworks/Python.framework/Versions/2.6/bin/pip: Permission denied
        familys-imac:~ Paul-Arthur$ export PATH=/usr/local/bin:$PATH
        familys-imac:~ Paul-Arthur$ brew install readline sqlite gdbm pkg-config
        Error: sqlite already installed
        Try: brew upgrade sqlite
        familys-imac:~ Paul-Arthur$ brew install python --framework --universal
        Warning: It appears you have MacPorts or Fink installed.
        Software installed with other package managers causes known problems for
        Homebrew. If a formula fails to build, uninstall MacPorts/Fink and try again.
        ==> Downloading http://www.python.org/ftp/python/2.7.2/Python-2.7.2.tar.bz2
        File already downloaded in /Users/Paul-Arthur/Library/Caches/Homebrew
        ==> Patching
        patching file Lib/whichdb.py
        Hunk #1 succeeded at 91 with fuzz 1.
        ==> ./configure --prefix=/usr/local/Cellar/python/2.7.2 --enable-universalsdk=/ 
        ==> make
        ==> make install
        ==> Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0
        File already downloaded in /Users/Paul-Arthur/Library/Caches/Homebrew
        ==> /usr/local/Cellar/python/2.7.2/bin/python setup.py install
        Before install bootstrap.
        Scanning installed packages
        No setuptools distribution found
        running install
        error: can't create or remove files in install directory
    
        The following error occurred while trying to add or remove files in the
        installation directory:
    
            [Errno 13] Permission denied: '/usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/test-easy-install-51610.write-test'
    
        The installation directory you specified (via --install-dir, --prefix, or
        the distutils default setting) was:
    
            /usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/
    
        Perhaps your account does not have write access to this directory?  If the
        installation directory is a system-owned directory, you may need to sign in
        as the administrator or "root" account.  If you do not have administrative
        access to this machine, you may wish to choose a different installation
        directory, preferably one that is listed in your PYTHONPATH environment
        variable.
    
        For information on other options, you may wish to consult the
        documentation at:
    
          http://packages.python.org/distribute/easy_install.html
    
        Please make the appropriate changes for your system and try again.
    
        ==> Exit Status: 1
        http://github.com/mxcl/homebrew/blob/master/Library/Formula/python.rb#L106
        ==> Environment
        gcc-4.2: error trying to exec '/usr/bin/i686-apple-darwin11-gcc-4.2.1': execvp: No such file or directory
        HOMEBREW_VERSION: 0.8
        HEAD: 67da1952979f60b776f1b986850e45b98c4ccaa9
        HOMEBREW_PREFIX: /usr/local
        HOMEBREW_CELLAR: /usr/local/Cellar
        HOMEBREW_REPOSITORY: /usr/local
        HOMEBREW_LIBRARY_PATH: /usr/local/Library/Homebrew
        Hardware: dual-core 64-bit penryn
        OS X: 10.7.2
        Kernel Architecture: x86_64
        Ruby: 1.8.7-249
        /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
        Xcode: 4.2.1
        GCC-4.0: N/A
        GCC-4.2: build 0
        LLVM: build 2336
        Clang: 3.0-211.12
        MacPorts or Fink? /opt/local/bin/port
        X11 installed? true
        ==> Build Flags
        CC: /usr/bin/llvm-gcc => /usr/llvm-gcc-4.2/bin/llvm-gcc-4.2
        CXX: /usr/bin/llvm-g++ => /usr/llvm-gcc-4.2/bin/llvm-g++-4.2
        LD: /usr/bin/llvm-gcc => /usr/llvm-gcc-4.2/bin/llvm-gcc-4.2
        CFLAGS: -O3 -w -pipe -march=core2 -msse4.1
        CXXFLAGS: -O3 -w -pipe -march=core2 -msse4.1
        CPPFLAGS: -I/usr/local/Cellar/readline/6.2.1/include
        LDFLAGS: -L/usr/local/Cellar/readline/6.2.1/lib
        PKG_CONFIG_PATH: /usr/local/Cellar/readline/6.2.1/lib/pkgconfig
    
        Error: Failed executing: /usr/local/Cellar/python/2.7.2/bin/python setup.py install
        These existing issues may help you:
            https://github.com/mxcl/homebrew/issues/6233
            https://github.com/mxcl/homebrew/issues/6984
            https://github.com/mxcl/homebrew/issues/7687
            https://github.com/mxcl/homebrew/issues/8070
            https://github.com/mxcl/homebrew/issues/8713
            https://github.com/mxcl/homebrew/issues/9017
            https://github.com/mxcl/homebrew/issues/9167
            https://github.com/mxcl/homebrew/issues/9215
            https://github.com/mxcl/homebrew/issues/9345
            https://github.com/mxcl/homebrew/issues/9370
            https://github.com/mxcl/homebrew/issues/9434
            https://github.com/mxcl/homebrew/issues/9489
        Otherwise, please report the bug:
            https://github.com/mxcl/homebrew/wiki/checklist-before-filing-a-new-issue
        familys-imac:~ Paul-Arthur$ 
    
  • Answers
  • berlotto

    You are installing the lib in system wide and have not permission at directory. Run your make install with sudo.


  • Related Question

    installation - Python Can't Find Platform Dependent Libraries -- Mac Homebrew Install
  • Pygmalion

    In an effort to purify my environment I have recently eliminated MacPorts and all traces therein from my Mac OS 10.6.6 box, replacing it with the hip new Homebrew (https://github.com/mxcl/homebrew).

    Today I ran into my first problem. I'm attempting to install Python 2.7.1 (Mac OS X still defaults to 2.6). I ran brew install python at the Terminal. Everything seemed to install fine. When I ran python however, I received this output:

    pygmalion:~:% python
    Could not find platform dependent libraries <exec_prefix>
    Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
    Python 2.7.1 (r271:86832, Jan 24 2011, 12:12:00) 
    [GCC 4.2.1 (Apple Inc. build 5664)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>>
    

    At first I thought it was an inconsequential error message, but upon further investigation, I've come to see that Python is very much lacking its core system libraries. I've tried uninstalling/reinstalling, playing around with all different values for $PYTHONHOME and $PYTHONPATH but so far no luck.

    As far as system information: brew appears to have installed Python in /usr/local/bin/python.

    pygmalion:~:% brew --config
    HOMEBREW_VERSION: 0.7.1
    HEAD: 38b93387ea732d6c6b08a491f74124854b28107a
    HOMEBREW_PREFIX: /usr/local
    HOMEBREW_CELLAR: /usr/local/Cellar
    HOMEBREW_REPOSITORY: /usr/local
    HOMEBREW_LIBRARY_PATH: /usr/local/Library/Homebrew
    Hardware: dual-core 64-bit penryn
    OS X: 10.6.6
    Kernel Architecture: i386
    Ruby: 1.8.7-174
    /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
    Xcode: 3.2.5
    GCC-4.0: build 5494 
    GCC-4.2: build 5664 
    LLVM: build 2333 
    MacPorts or Fink? false
    X11 installed? true
    

    Thanks in advance... I'm at a loss.

    Edit: Here is the output of sys.path.

    Could not find platform dependent libraries <exec_prefix>
    Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
    Python 2.7.1 (r271:86832, Jan 24 2011, 12:12:00) 
    [GCC 4.2.1 (Apple Inc. build 5664)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import sys
    >>> sys.path
    ['', '/usr/local/Cellar/python/2.7.1/lib/python27.zip',    '/usr/local/Cellar/python/2.7.1/lib/python2.7', '/usr/local/Cellar/python/2.7.1/lib/python2.7/plat-darwin', '/usr/local/Cellar/python/2.7.1/lib/python2.7/plat-mac', '/usr/local/Cellar/python/2.7.1/lib/python2.7/plat-mac/lib-scriptpackages', '/usr/local/Cellar/python/2.7.1/lib/python2.7/lib-tk', '/usr/local/Cellar/python/2.7.1/lib/python2.7/lib-old', '/usr/local/Cellar/python/2.7.1/lib/lib-dynload', '/Users/dlobraico/.local/lib/python2.7/site-packages', '/usr/local/Cellar/python/2.7.1/lib/python2.7/site-packages', '/usr/local/lib/python2.7/site-packages',        '/usr/local/Cellar/python/2.7.1/lib/python2.7/site-packages']
    >>> 
    

  • Related Answers
    Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.