-
Notifications
You must be signed in to change notification settings - Fork 8
/
INSTALL
162 lines (107 loc) · 5.76 KB
/
INSTALL
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
=====================
Installing PyInteraph
=====================
PyInteraph is made of a Python packages with Cython and C extensions.
In order to install PyInteraph you will need
- Python 3.7 or higher
- a C compiler (e.g. GNU gcc)
- the Python header files (e.g. package python-dev in Debian-based
Linux distributions)
- several open-source Python packages, including numpy and Cython
most of these requirements are available by default in any Linux installation,
except for the Python packages, that will be installed automatically during
the installation process. Please see the requirements.txt file for the
complete list of Python package requirements.
If you are unsure whether your system already satisfies such requirements, we
recommend installing PyInteraph in a conda enviornment (see below) that also
supports installation of non-Python requirements.
PLEASE NOTE: PyInteraph was mainly developed and tested on Linux systems.
Support for Mac is limited, especially we don't currently support most recent
MacOS versions and native use on Apple silicon Macs. We are working to add
such support.
=========================
Installation instructions
=========================
Here we provide instructions for installing PyInteraph in a simple Python
environment or in a conda environment.
----------------------------------
Installing with pip and setuptools
----------------------------------
This is a simple installation procedure that requires a Python >=3.7 distribution
to be available. It guides you in the installation of the PyInteraph package
in a virtual environment, meaning an instance of Python isolated from the rest
of your system. This is not strictly necessary however and PyInteraph may be
installed system-wide pretty much in the same fashion, following steps 4 to 6.
1) Check if the virtualenv Python package is installed in your system. If the
"virtualenv" command is available to you, it is installed and you can skip this step.
If instead it is not available and you need to install it, it is usually
available as a package in your distribution. For instance, on Debian-based
systems (such as Debian or Ubuntu) this boils down to installing the
python-virtualenv package:
sudo apt install python-virtualenv
if this is not possible for you, you might still install the virtualenv package
for just your local user, using pip:
pip install --user virtualenv
if the installation is successfull, the virtualenv command will be available
2) create your Python 3.7 virtual environment, in a directory of your choice:
(in this case, it will be ./pyinteraph-env)
virtualenv -p /usr/bin/python3.7 pyinteraph-env
you might need to replace the argument of option -p according to the location
of your Python installation in the system. Nonetheless the one in the
aforamentioned command line covers the most common case.
3) activate it:
source pyinteraph-env/bin/activate
4) clone the PyInteraph source code from its GitHub repository. Enter the local
copy of the repository.
git clone https://github.com/ELELAB/pyinteraph2.git
cd pyinteraph2
if git is not available to you, you can download the repository content as a zip
file from the PyInteraph2 GitHub repository web page
5) install all the required Python packages as specified in the requirements.txt file
pip install -r requirements.txt
6) install PyInteraph.
python setup.py install
That's it! The main PyInteraph executables (such as for instance "pyinteraph")
should now be available.
Every time you need to run pyinteraph after opening a new shell, just run step 2 beforehand.
---------------------
Installing with conda
---------------------
We have provided an environment.yml file that can be used together with conda to automatically
install an environment contaning all of PyInteraph's requirement. In order to use it you need
to have conda installed in your system. Please visit https://docs.conda.io/en/latest/miniconda.html
for further instructions. Installing miniconda rather than full anaconda is advised.
Once conda is installed on your system, you can use it to create a virtual
environment similarly to what you would do using the virtualenv package, as
previously detailed.
1) create your conda environment starting from the provided environment file:
conda env create --file environment.yaml --prefix ./pyinteraph-env
in this case we are asking conda to create the environment locally (--prefix). This is not
strictly necessary.
Note that if your home directory is size-constrained the installation might fail for lack of
space. In that case you need to select another directory with more available free space
in which conda will download packages. This is done by running
conda config --add pkgs_dirs /my/other/directory/conda/pkgs
just change the directory name to one of your choice
2) activate the conda environment, just by running the command line that conda suggests for
this purpose at the end of the previous step. It's usually something like
conda activate ./pyinteraph-env
3) clone the PyInteraph source code from its GitHub repository. Enter the local
copy of the repository.
git clone https://github.com/ELELAB/pyinteraph2.git
cd pyinteraph2
if git is not available to you, you can download the repository content as a zip
file from the PyInteraph2 GitHub repository web page
4) install PyInteraph.
python setup.py install
That's it! The main PyInteraph executables (such as for instance "pyinteraph")
should now be available.
Every time you need to run pyinteraph after opening a new shell, just run
step 2 beforehand.
=======
Testing
=======
to check that your installation has been performed correctly, just enter the tests directory in the
pyinteraph source code directory and run pytest:
cd tests; pytest
You should have no tests reporting failures or errors.