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

add page

Yamashita Yuu
2013-05-18 12:18:27 +09:00
parent 76dd94517a
commit ff5ccc6f8d
2 changed files with 74 additions and 0 deletions

73
Common-build-problems.md Normal file

@@ -0,0 +1,73 @@
## zlib
you need to install zlib-devel and rebuild Python.
* Ubuntu: `sudo apt-get install libssl-dev zlib1g-dev`
**NOTE**: `libssl-dev` is required when compiling Python, installing `libssl-dev` will actually install `zlib1g-dev`, this will help to eliminate subsequent **openssl (LoadError)** errors when running commands provided by RubyGems (for example vagrant and vmc), which leads to uninstall and re-install Python versions (installed before installing `libssl-dev`).
* Fedora: `yum install zlib-devel`
## Readline support
Install `libreadline-dev` first before running `python-build`
* Ubuntu: `sudo apt-get install libreadline-dev`
* Fedora: `yum install readline-devel`
* Mac:
```bash
brew install readline
brew link readline
pyenv install 2.7.5
```
## Removing a ruby version
rm -rf .pyenv/versions/2.7.5
## Installing a 32 bit ruby 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
## 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:
sudo python-build 3.3.2 /usr/local/
## Make your rubies a little faster
You can set your CFLAGS to accepted safe values to help get a little more speed.
CFLAGS='-g -O2'
## Build failed - bad interpreter: Permission denied
If you encounter this error while installing ruby 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:
export TMPDIR="$HOME/src"
Please note you'll have to do it every time you'll want to install a new version of ruby unless you write this command in your `~/.bashrc`.
## Build failed
If you've got something like that:
```
$ pyenv install 2.7.5
Downloading http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz...
Installing yaml-0.1.4...
BUILD FAILED
```
please, be sure to have "make" installed (```$ sudo apt-get install make```). On Ubuntu Server, by default, it doesn't.
## ruby-build: definition not found
To update your python-build definitions:
If you have python-build installed as an pyenv plugin:
$ cd ~/.pyenv/plugins/python-build && git pull

@@ -1,4 +1,5 @@
* [[FAQ|Home]]
* [[Common build problems]]
* [[pyenv plugins|Plugins]]
* [[Deploying with pyenv]]
* [[Understanding binstubs]]