summaryrefslogtreecommitdiff
path: root/INSTALL.rst
blob: fdbc4d6dda36d0c0e02b5bcbc47e5fac41ccf9e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
============================
Installing using pip on UNIX
============================

The easiest way to install psutil on UNIX is by using pip (but first you might
need to install python header files; see later).
First install pip::

    $ wget https://bootstrap.pypa.io/get-pip.py
    $ python get-pip.py

...then run::

    $ pip install psutil

You may need to install gcc and python header files first (see later).


=====================
Installing on Windows
=====================

Just get the right installer for your Python version and architecture from:
https://pypi.python.org/pypi/psutil/#downloads
Since wheels installers are also available you may also use pip.


========================================
Compiling on Windows using Visual Studio
========================================

In order to compile psutil on Windows you'll need Visual Studio (Mingw32 is
no longer supported). You must have the same version of Visual Studio used to
compile your installation of Python, that is::

* Python 2.6:  VS 2008 (download it from `here <http://www.microsoft.com/en-us/download/details.aspx?id=44266>`_)
* Python 2.7:  VS 2008 (download it from `here <http://www.microsoft.com/en-us/download/details.aspx?id=44266>`_)
* Python 3.3, 3.4: VS 2010 (you can download it from `MS website <http://www.visualstudio.com/downloads/download-visual-studio-vs#d-2010-express>`_)
* Python 3.5: `VS 2015 UP <http://www.visualstudio.com/en-au/news/vs2015-preview-vs>`_

...then run::

    setup.py build

...or::

    make.bat build

Compiling 64 bit versions of Python 2.6 and 2.7 with VS 2008 requires
Windows SDK and .NET Framework 3.5 SP1 to be installed first.
Once you have those run vcvars64.bat, then compile:
http://stackoverflow.com/questions/11072521/

===================
Installing on Linux
===================

gcc is required and so the python headers. They can easily be installed by
using the distro package manager. For example, on Debian and Ubuntu::

    $ sudo apt-get install gcc python-dev

...on Redhat and CentOS::

    $ sudo yum install gcc python-devel

Once done, you can build/install psutil with::

    $ python setup.py install


==================
Installing on OS X
==================

OS X installation from source will require gcc which you can obtain as part of
the 'XcodeTools' installer from Apple. Then you can run the standard distutils
commands.
To build only::

    $ python setup.py build

To install and build::

    $ python setup.py install


=====================
Installing on FreeBSD
=====================

The same compiler used to install Python must be present on the system in order
to build modules using distutils. Assuming it is installed, you can build using
the standard distutils commands.

Build only::

    $ python setup.py build

Install and build::

    $ python setup.py install


========
Makefile
========

A makefile is available for both UNIX and Windows (make.bat).  It provides
some automations for the tasks described above and might be preferred over
using setup.py. With it you can::

    $ make install    # just install (in --user mode)
    $ make uninstall  # uninstall (needs pip)
    $ make test       # run tests
    $ make clean      # remove installation files