From 084ab2e466593b0e3eb71c65bc2b6ec66c6fc09d Mon Sep 17 00:00:00 2001 From: "Yamashita, Yuu" Date: Tue, 5 Jul 2016 01:07:10 +0000 Subject: [PATCH] markdown style issue --- Common-build-problems.md | 70 ++++++++++++++++++++++++++-------------- Home.md | 41 +++++++++++------------ 2 files changed, 66 insertions(+), 45 deletions(-) diff --git a/Common-build-problems.md b/Common-build-problems.md index e0baf29..9ff9994 100644 --- a/Common-build-problems.md +++ b/Common-build-problems.md @@ -1,42 +1,51 @@ ## Requirements: * Ubuntu/Debian: - ``` + +```sh 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 - ``` +``` * Fedora/CentOS/RHEL: - ``` + +```sh yum install zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel - ``` +``` * 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`. - ## 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) - 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 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 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 @@ -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: - 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`. @@ -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: -``` +```sh $ pyenv install 2.7.5 Downloading http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz... 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?" -``` +```sh Installing Python-2.7.7... 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): - ``` - 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) - ``` - xcode-select --install - ``` + +```sh +xcode-select --install +``` ## 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: -``` + +```sh CFLAGS="-I$(brew --prefix openssl)/include" \ LDFLAGS="-L$(brew --prefix openssl)/lib" \ pyenv install -v 3.4.3 ``` + or (checked on RHEL6): -``` + +```sh CFLAGS=-I/usr/include/openssl \ LDFLAGS=-L/usr/lib64 \ pyenv install -v 3.4.3 ``` + * Alternatively, if you installed openssl with macports, use the following paths: -``` + +```sh CFLAGS="-I/opt/local/include/" \ LDFLAGS="-L/opt/local/lib/" \ 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: - $ cd ~/.pyenv/plugins/python-build && git pull \ No newline at end of file +```sh +$ cd ~/.pyenv/plugins/python-build && git pull +``` diff --git a/Home.md b/Home.md index fbea3fe..a289e8a 100644 --- a/Home.md +++ b/Home.md @@ -30,43 +30,44 @@ environment. If you haven't done so, install Xcode Command Line Tools (`xcode-select --install`) and [Homebrew][]. Then: - ```sh - # optional, but recommended: - brew install openssl readline - ``` +```sh +# optional, but recommended: +brew install openssl readline +``` * **Ubuntu/Debian/Mint:** - ```sh - apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev - ``` +```sh +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:** - ```sh - yum install gcc zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel - ``` +```sh +yum install gcc zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel +``` * **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:** FIXME - ```sh - zypper install gcc automake openssl-devel ncurses-devel readline-devel zlib-devel - ``` +```sh +zypper install gcc automake openssl-devel ncurses-devel readline-devel zlib-devel +``` * **Arch Linux:** FIXME - ```sh - pacman -S base-devel openssl zlib - ``` +```sh +pacman -S base-devel openssl zlib +``` See also [Common build problems](https://github.com/yyuu/pyenv/wiki/Common-build-problems) for further information. @@ -150,4 +151,4 @@ Some of 3rd party tool like [PyInstaller](https://github.com/pyinstaller/pyinsta $ env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.5.0 ``` -Since pyenv (precisely, python-build) will build CPython with configuring RPATH, you don't have to set `LD_LIBRARY_PATH` to specify library path on GNU/Linux. \ No newline at end of file +Since pyenv (precisely, python-build) will build CPython with configuring RPATH, you don't have to set `LD_LIBRARY_PATH` to specify library path on GNU/Linux.