From 8fc5ed1b20c9c9fab75164aae1984698a46974dc Mon Sep 17 00:00:00 2001 From: Giampaolo Rodola Date: Sun, 15 Nov 2020 00:27:05 +0100 Subject: Rewrite Linux prlimit() with ctypes (Linux wheels) (#1879) --- INSTALL.rst | 125 ++++++++++++++++++++++++------------------------------------ 1 file changed, 50 insertions(+), 75 deletions(-) (limited to 'INSTALL.rst') diff --git a/INSTALL.rst b/INSTALL.rst index c3b9e91c..a4f2bf11 100644 --- a/INSTALL.rst +++ b/INSTALL.rst @@ -1,83 +1,38 @@ -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:: - - wget https://bootstrap.pypa.io/get-pip.py -O - | python +Linux, Windows, macOS (wheels) +============================== -On macOS or via curl:: - - python < <(curl -s https://bootstrap.pypa.io/get-pip.py) - -On Windows, `download pip `__, open -cmd.exe and install it:: +psutil makes extensive use of C extension modules, meaning a C compiler is +required. +For these 3 platforms though, pre-compiled cPython wheels are provided on each +psutil release, so all you have to do is this:: - C:\Python27\python.exe get-pip.py - -Permission issues (UNIX) -======================== - -The commands below assume you're running as root. -If you aren't or you bump into permission errors you can either install psutil -for your user only:: - - pip3 install --user psutil - -...or prepend ``sudo`` and install it globally, e.g.:: + pip3 install psutil - sudo pip3 install psutil +If wheels are not available and you whish to install from sources, keep reading. -Linux -===== +Linux (install from sources) +============================ Ubuntu / Debian:: sudo apt-get install gcc python3-dev - pip3 install psutil + pip3 install --user psutil --no-binary :all: RedHat / CentOS:: sudo yum install gcc python3-devel - pip3 install psutil - -If you're on Python 2 use ``python-dev`` instead. - -macOS -===== + pip3 install --user psutil --no-binary :all: -Install `Xcode `__ then run:: - - pip3 install psutil - -Windows -======= - -Open a cmd.exe shell and run:: - - python3 -m pip install psutil +Windows (install from sources) +============================== -This assumes "python" is in your PATH. If not, specify the full python.exe -path. +In order to compile psutil on Windows you'll need **Visual Studio**. +Here's a couple of guides describing how to do it: `1 `__ +and `2 `__. And then:: -In order to compile psutil from sources you'll need **Visual Studio** (Mingw32 -is not supported). -This `blog post `__ -provides numerous info on how to properly set up VS. The needed VS versions are: + pip3 install --user psutil --no-binary :all: -* Python 2.6, 2.7: `VS-2008 `__ -* Python 3.4: `VS-2010 `__ -* Python 3.5+: `VS-2015 `__ - -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` -(see `here `__). -Once VS is setup open a cmd.exe shell, cd into psutil directory and run:: - - python3 setup.py build - python3 setup.py install +Note that MinGW compiler is not supported. FreeBSD ======= @@ -85,7 +40,7 @@ FreeBSD :: pkg install python3 gcc - python -m pip3 install psutil + python3 -m pip3 install psutil OpenBSD ======= @@ -118,15 +73,6 @@ Install:: pkg install gcc python3 -m pip install psutil -Install from sources -==================== - -:: - - git clone https://github.com/giampaolo/psutil.git - cd psutil - python3 setup.py install - Testing installation ==================== @@ -137,4 +83,33 @@ Testing installation Dev Guide ========= -See: `dev guide `__. +`Link `__. + +Install pip +=========== + +Pip is shipped by default with Python 2.7.9+ and 3.4+. +If you don't have it you can install with wget:: + + wget https://bootstrap.pypa.io/get-pip.py -O - | python3 + +...ow with curl:: + + python3 < <(curl -s https://bootstrap.pypa.io/get-pip.py) + +On Windows, `download pip `__, open +cmd.exe and install it:: + + C:\Python27\python.exe get-pip.py + +Permission issues (UNIX) +======================== + +If you bump into permission errors you have two options. +Install psutil for your user only:: + + pip3 install --user psutil + +...or prepend ``sudo`` and install it at system level:: + + sudo pip3 install psutil -- cgit v1.2.1