From a7e7b4e83f66576f507ca5fa2759f092cffc18b7 Mon Sep 17 00:00:00 2001 From: Giampaolo Rodola Date: Sat, 18 Nov 2017 03:09:58 +0100 Subject: syntax highlight in doc files --- INSTALL.rst | 55 +++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 37 insertions(+), 18 deletions(-) (limited to 'INSTALL.rst') diff --git a/INSTALL.rst b/INSTALL.rst index 8737c94a..4cd9bc9e 100644 --- a/INSTALL.rst +++ b/INSTALL.rst @@ -4,16 +4,22 @@ Install pip pip is the easiest way to install psutil. It is shipped by default with Python 2.7.9+ and 3.4+. For other Python versions you can install it manually. -On Linux or via wget:: +On Linux or via wget: + +.. code-block:: bash wget https://bootstrap.pypa.io/get-pip.py -O - | python -On OSX or via curl:: +On OSX or via curl: + +.. code-block:: bash python < <(curl -s https://bootstrap.pypa.io/get-pip.py) On Windows, `download pip `__, open -cmd.exe and install it:: +cmd.exe and install it: + +.. code-block:: bat C:\Python27\python.exe get-pip.py @@ -25,25 +31,30 @@ If you're not or you bump into permission errors you can either: * prepend ``sudo``, e.g.: -:: +.. code-block:: bash sudo pip install psutil * install psutil for your user only (not at system level): -:: +.. code-block:: bash pip install --user psutil Linux ===== -Ubuntu / Debian:: +Ubuntu / Debian: + +.. code-block:: bash sudo apt-get install gcc python-dev python-pip pip install psutil -RedHat / CentOS:: +RedHat / CentOS: + + +.. code-block:: bash sudo yum install gcc python-devel python-pip pip install psutil @@ -51,11 +62,15 @@ RedHat / CentOS:: If you're on Python 3 use ``python3-dev`` and ``python3-pip`` instead. Major Linux distros also provide binary distributions of psutil so, for -instance, on Ubuntu and Debian you can also do:: +instance, on Ubuntu and Debian you can also do: + +.. code-block:: bash sudo apt-get install python-psutil -On RedHat and CentOS:: +On RedHat and CentOS: + +.. code-block:: bash sudo yum install python-psutil @@ -68,7 +83,7 @@ OSX Install `Xcode `__ first, then: -:: +.. code-block:: bash pip install psutil @@ -77,7 +92,9 @@ Windows The easiest way to install psutil on Windows is to just use the pre-compiled exe/wheel installers hosted on -`PYPI `__ via pip:: +`PYPI `__ via pip: + +.. code-block:: bat C:\Python27\python.exe -m pip install psutil @@ -92,7 +109,9 @@ Compiling 64 bit versions of Python 2.6 and 2.7 with VS 2008 requires `Windows SDK and .NET Framework 3.5 SP1 `__. Once installed run vcvars64.bat, then you can finally compile (see `here `__). -To compile / install psutil from sources on Windows run:: +To compile / install psutil from sources on Windows run: + +.. code-block:: bat make.bat build make.bat install @@ -100,7 +119,7 @@ To compile / install psutil from sources on Windows run:: FreeBSD ======= -:: +.. code-block:: bash pkg install python gcc python -m pip install psutil @@ -108,7 +127,7 @@ FreeBSD OpenBSD ======= -:: +.. code-block:: bash export PKG_PATH="http://ftp.openbsd.org/pub/OpenBSD/`uname -r`/packages/`arch -s`/" pkg_add -v python gcc @@ -117,7 +136,7 @@ OpenBSD NetBSD ====== -:: +.. code-block:: bash export PKG_PATH="ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/`uname -m`/`uname -r`/All" pkg_add -v pkgin @@ -129,13 +148,13 @@ Solaris If ``cc`` compiler is not installed create a symlink to ``gcc``: -:: +.. code-block:: bash sudo ln -s /usr/bin/gcc /usr/local/bin/cc Install: -:: +.. code-block:: bash pkg install gcc python -m pip install psutil @@ -143,7 +162,7 @@ Install: Install from sources ==================== -:: +.. code-block:: bash git clone https://github.com/giampaolo/psutil.git cd psutil -- cgit v1.2.1