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

markdown style issue

Yamashita, Yuu
2016-07-05 01:07:10 +00:00
parent f8ca13af1b
commit 084ab2e466
2 changed files with 66 additions and 45 deletions

@@ -1,42 +1,51 @@
## Requirements: ## Requirements:
* Ubuntu/Debian: * Ubuntu/Debian:
```
```sh
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 libncurses5-dev libncursesw5-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev
``` ```
* Fedora/CentOS/RHEL: * Fedora/CentOS/RHEL:
```
```sh
yum install zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel yum install zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel
``` ```
* Mac OS X: * Mac OS X:
```
```sh
brew install readline brew install readline
``` ```
**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
```sh
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)
```sh
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:
```sh
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.
```sh
CFLAGS='-O2' CFLAGS='-O2'
```
## Build failed - bad interpreter: Permission denied ## Build failed - bad interpreter: Permission denied
@@ -44,7 +53,9 @@ If you encounter this error while installing python and your server is a VPS, th
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:
```sh
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`.
@@ -52,7 +63,7 @@ Please note you'll have to do it every time you'll want to install a new version
If you've got something like that: If you've got something like that:
``` ```sh
$ 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...
@@ -64,7 +75,7 @@ Please, be sure to have "make" installed (```$ sudo apt-get install make```). On
## Build failed: "ERROR: The Python zlib extension was not compiled. Missing the zlib?" ## Build failed: "ERROR: The Python zlib extension was not compiled. Missing the zlib?"
``` ```sh
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?
@@ -76,31 +87,38 @@ BUILD FAILED
``` ```
* 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): * 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):
```
```sh
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
``` ```
* Alternatively, try reinstalling XCode command line tools for your OS (especially if you just upgraded your OS) * Alternatively, try reinstalling XCode command line tools for your OS (especially if you just upgraded your OS)
```
```sh
xcode-select --install xcode-select --install
``` ```
## ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib? ## ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib?
* If you have homebrew openssl and pyenv installed, you may need to tell the compiler where the openssl package is located: * If you have homebrew openssl and pyenv installed, you may need to tell the compiler where the openssl package is located:
```
```sh
CFLAGS="-I$(brew --prefix openssl)/include" \ CFLAGS="-I$(brew --prefix openssl)/include" \
LDFLAGS="-L$(brew --prefix openssl)/lib" \ LDFLAGS="-L$(brew --prefix openssl)/lib" \
pyenv install -v 3.4.3 pyenv install -v 3.4.3
``` ```
or (checked on RHEL6): or (checked on RHEL6):
```
```sh
CFLAGS=-I/usr/include/openssl \ CFLAGS=-I/usr/include/openssl \
LDFLAGS=-L/usr/lib64 \ LDFLAGS=-L/usr/lib64 \
pyenv install -v 3.4.3 pyenv install -v 3.4.3
``` ```
* Alternatively, if you installed openssl with macports, use the following paths: * Alternatively, if you installed openssl with macports, use the following paths:
```
```sh
CFLAGS="-I/opt/local/include/" \ CFLAGS="-I/opt/local/include/" \
LDFLAGS="-L/opt/local/lib/" \ LDFLAGS="-L/opt/local/lib/" \
pyenv install -v 3.4.3 pyenv install -v 3.4.3
@@ -114,4 +132,6 @@ 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:
```sh
$ cd ~/.pyenv/plugins/python-build && git pull $ cd ~/.pyenv/plugins/python-build && git pull
```

@@ -48,6 +48,7 @@ environment.
``` ```
* **Fedora 22 and above:** * **Fedora 22 and above:**
```sh ```sh
dnf install -y gcc zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel dnf install -y gcc zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel
``` ```