1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-15 23:03:53 -05:00

Updated Common build problems (markdown)

jwittkoski
2014-10-01 20:22:53 -07:00
parent 5ad5a7a222
commit 7179061247

@@ -1,88 +1,86 @@
## Requirements: ## Requirements:
* Ubuntu/Debian: * Ubuntu/Debian:
``` ```
sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \ sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm libreadline-dev libsqlite3-dev wget curl llvm
``` ```
* Fedora: * Fedora:
`yum install zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel` `yum install zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel`
* Mac: * Mac:
```bash brew install readline; brew link readline; pyenv install 2.7.5``` ```bash brew install readline; brew link readline; pyenv install 2.7.5```
**NOTE**: `libssl-dev` is required when compiling Python, installing `libssl-dev` will actually install `zlib1g-dev`, which leads to uninstall and re-install Python versions (installed before installing `libssl-dev`). On Redhat and derivatives the package is named `openssl-devel`. **NOTE**: `libssl-dev` is required when compiling Python, installing `libssl-dev` will actually install `zlib1g-dev`, which leads to uninstall and re-install Python versions (installed before installing `libssl-dev`). On Redhat and derivatives the package is named `openssl-devel`.
## Removing a python version ## Removing a python version
rm -rf .pyenv/versions/2.7.5 rm -rf .pyenv/versions/2.7.5
## Installing a 32 bit python on 64 bit Mac OS X (this will *not* work on Linux) ## Installing a 32 bit python on 64 bit Mac OS X (this will *not* work on Linux)
CONFIGURE_OPTS="--with-arch=i386" CFLAGS="-arch i386" LDFLAGS="-arch i386" python-build options CONFIGURE_OPTS="--with-arch=i386" CFLAGS="-arch i386" LDFLAGS="-arch i386" python-build options
## Installing a system-wide Python ## Installing a system-wide Python
If you want to install a Python interpreter that's available to all users and system scripts (no pyenv), use `/usr/local/` as the install path. For example: If you want to install a Python interpreter that's available to all users and system scripts (no pyenv), use `/usr/local/` as the install path. For example:
sudo python-build 3.3.2 /usr/local/ sudo python-build 3.3.2 /usr/local/
## Make your pythons a little faster ## Make your pythons a little faster
You can set your CFLAGS to accepted safe values to help get a little more speed. You can set your CFLAGS to accepted safe values to help get a little more speed.
CFLAGS='-g -O2' CFLAGS='-g -O2'
## Build failed - bad interpreter: Permission denied ## Build failed - bad interpreter: Permission denied
If you encounter this error while installing python and your server is a VPS, the **/tmp** directory where python-build download and compile the packages is probably mounted as **noexec**. You can check with your hosting provider if wether they provide a way to bypass this protection. If you encounter this error while installing python and your server is a VPS, the **/tmp** directory where python-build download and compile the packages is probably mounted as **noexec**. You can check with your hosting provider if wether they provide a way to bypass this protection.
If the answer is no, just set the **$TMPDIR** environment variable to wherever you have a write + execution rights. For example: If the answer is no, just set the **$TMPDIR** environment variable to wherever you have a write + execution rights. For example:
export TMPDIR="$HOME/src" export TMPDIR="$HOME/src"
Please note you'll have to do it every time you'll want to install a new version of python unless you write this command in your `~/.bashrc`. Please note you'll have to do it every time you'll want to install a new version of python unless you write this command in your `~/.bashrc`.
## Build failed ## Build failed
If you've got something like that: If you've got something like that:
``` ```
$ pyenv install 2.7.5 $ pyenv install 2.7.5
Downloading http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz... Downloading http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz...
Installing yaml-0.1.4... Installing yaml-0.1.4...
BUILD FAILED BUILD FAILED
``` ```
please, be sure to have "make" installed (```$ sudo apt-get install make```). On Ubuntu Server, by default, it doesn't. please, be sure to have "make" installed (```$ sudo apt-get install make```). On Ubuntu Server, by default, it doesn't.
If you've got something like that: If you've got something like that:
``` ```
Installing Python-2.7.7... Installing Python-2.7.7...
ERROR: The Python zlib extension was not compiled. Missing the zlib? ERROR: The Python zlib extension was not compiled. Missing the zlib?
Please consult to the Wiki page to fix the problem. Please consult to the Wiki page to fix the problem.
https://github.com/yyuu/pyenv/wiki/Common-build-problems https://github.com/yyuu/pyenv/wiki/Common-build-problems
BUILD FAILED BUILD FAILED
``` ```
You could try this: On Mac OS X 10.9 and 10.10 you may need to set the CFLAGS environment variable when installing a new version in order for configure to find the zlib headers (XCode command line tools must be installed first):
``` ```
CFLAGS="-I$(xcrun --show-sdk-path)/usr/include" pyenv install -v 2.7.7 CFLAGS="-I$(xcrun --show-sdk-path)/usr/include" pyenv install -v 2.7.7
``` ```
It works for me on osx 10.10 DP. ## python-build: definition not found
## python-build: definition not found To update your python-build definitions:
To update your python-build definitions: If you have python-build installed as an pyenv plugin:
If you have python-build installed as an pyenv plugin:
$ cd ~/.pyenv/plugins/python-build && git pull $ cd ~/.pyenv/plugins/python-build && git pull