mirror of
https://github.com/pyenv/pyenv.git
synced 2025-11-14 22:33:52 -05:00
markdown style issue
@@ -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:
|
||||||
```
|
|
||||||
brew install readline
|
|
||||||
```
|
|
||||||
|
|
||||||
|
```sh
|
||||||
|
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
|
||||||
|
|
||||||
rm -rf ~/.pyenv/versions/2.7.5
|
```sh
|
||||||
|
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
|
```sh
|
||||||
|
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/
|
```sh
|
||||||
|
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='-O2'
|
```sh
|
||||||
|
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:
|
||||||
|
|
||||||
export TMPDIR="$HOME/src"
|
```sh
|
||||||
|
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):
|
||||||
```
|
|
||||||
CFLAGS="-I$(xcrun --show-sdk-path)/usr/include" pyenv install -v 2.7.7
|
```sh
|
||||||
```
|
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)
|
||||||
```
|
|
||||||
xcode-select --install
|
```sh
|
||||||
```
|
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:
|
||||||
|
|
||||||
$ cd ~/.pyenv/plugins/python-build && git pull
|
```sh
|
||||||
|
$ cd ~/.pyenv/plugins/python-build && git pull
|
||||||
|
```
|
||||||
|
|||||||
39
Home.md
39
Home.md
@@ -30,43 +30,44 @@ environment.
|
|||||||
If you haven't done so, install Xcode Command Line Tools
|
If you haven't done so, install Xcode Command Line Tools
|
||||||
(`xcode-select --install`) and [Homebrew][]. Then:
|
(`xcode-select --install`) and [Homebrew][]. Then:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
# optional, but recommended:
|
# optional, but recommended:
|
||||||
brew install openssl readline
|
brew install openssl readline
|
||||||
```
|
```
|
||||||
|
|
||||||
* **Ubuntu/Debian/Mint:**
|
* **Ubuntu/Debian/Mint:**
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev
|
apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev
|
||||||
```
|
```
|
||||||
|
|
||||||
* **CentOS/Fedora 21 and below:**
|
* **CentOS/Fedora 21 and below:**
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
yum install gcc zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel
|
yum install gcc zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel
|
||||||
```
|
```
|
||||||
|
|
||||||
* **Fedora 22 and above:**
|
* **Fedora 22 and above:**
|
||||||
```sh
|
|
||||||
dnf install -y gcc zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel
|
```sh
|
||||||
```
|
dnf install -y gcc zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel
|
||||||
|
```
|
||||||
|
|
||||||
* **openSUSE:**
|
* **openSUSE:**
|
||||||
|
|
||||||
FIXME
|
FIXME
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
zypper install gcc automake openssl-devel ncurses-devel readline-devel zlib-devel
|
zypper install gcc automake openssl-devel ncurses-devel readline-devel zlib-devel
|
||||||
```
|
```
|
||||||
|
|
||||||
* **Arch Linux:**
|
* **Arch Linux:**
|
||||||
|
|
||||||
FIXME
|
FIXME
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
pacman -S base-devel openssl zlib
|
pacman -S base-devel openssl zlib
|
||||||
```
|
```
|
||||||
|
|
||||||
See also [Common build problems](https://github.com/yyuu/pyenv/wiki/Common-build-problems) for further information.
|
See also [Common build problems](https://github.com/yyuu/pyenv/wiki/Common-build-problems) for further information.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user