Skip to content

Commit 9ce679c

Browse files
committed
Update install page
1 parent 1b186bc commit 9ce679c

20 files changed

+179
-40
lines changed

docs/src/client/install.md

Lines changed: 179 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -13,58 +13,197 @@ or upgrade
1313
pip3 install --upgrade datajoint
1414
```
1515

16-
Next configure the connection through DataJoint's `config` object:
16+
## DataJoint Python Windows Install Guide
1717

18-
```python
19-
In [1]: import datajoint as dj
20-
DataJoint 0.4.9 (February 1, 2017)
21-
No configuration found. Use `dj.config` to configure and save the configuration.
22-
```
18+
This document outlines the steps necessary to install DataJoint on Windows for use in
19+
connecting to a remote server hosting a DataJoint database.
20+
Some limited discussion of installing MySQL is discussed in `MySQL for Windows`, but is
21+
not covered in-depth since this is an uncommon usage scenario and not strictly required
22+
to connect to DataJoint pipelines.
2323

24-
You may now set the database credentials:
24+
### Quick steps
2525

26-
```python
27-
In [2]: dj.config['database.host'] = "alicelab.datajoint.io"
28-
In [3]: dj.config['database.user'] = "alice"
29-
In [4]: dj.config['database.password'] = "haha not my real password"
30-
```
26+
Quick install steps for advanced users are as follows:
3127

32-
Skip setting the password to make DataJoint prompt to enter the password every time.
28+
- Install latest Python 3.x and ensure it is in `PATH` (3.6.3 current at time of writing)
29+
```bash
30+
pip install datajoint
31+
```
3332

34-
You may save the configuration in the local work directory with
35-
`dj.config.save_local()` or for all your projects in `dj.config.save_global()`.
36-
Configuration changes should be made through the `dj.config` interface; the config file
37-
should not be modified directly by the user.
33+
For ERD drawing support:
3834

39-
You may leave the user or the password as `None`, in which case you will be prompted to
40-
enter them manually for every session.
41-
Setting the password as an empty string allows access without a password.
35+
- Install Graphviz for Windows and ensure it is in `PATH` (64 bit builds currently
36+
tested; URL below.)
37+
```bash
38+
pip install pydotplus matplotlib
39+
```
4240

43-
Note that the system environment variables `DJ_HOST`, `DJ_USER`, and `DJ_PASS` will
44-
overwrite the settings in the config file.
45-
You can use them to set the connection credentials instead of config files.
41+
Detailed instructions follow.
4642

47-
To change the password, the `dj.set_password` function will walk you through the
48-
process:
43+
### Step 1: install Python
4944

50-
```python
51-
dj.set_password()
52-
```
45+
Python for Windows is available from:
5346

54-
After that, update the password in the configuration and save it as described above:
47+
https://www.python.org/downloads/windows
5548

56-
```python
57-
dj.config['database.password'] = 'my#cool!new*psswrd'
58-
dj.config.save_local() # or dj.config.save_global()
59-
```
49+
The latest 64 bit 3.x version, currently 3.6.3, is available from the [Python site](https://www.python.org/ftp/python/3.6.3/python-3.6.3-amd64.exe).
50+
51+
From here run the installer to install Python.
52+
53+
For a single-user machine, the regular installation process is sufficient - be sure to
54+
select the `Add Python to PATH` option:
55+
56+
![install-python-simple](../images/install-python-simple.png){: style="align:left"}
57+
58+
For a shared machine, run the installer as administrator (right-click, run as
59+
administrator) and select the advanced installation.
60+
Be sure to select options as follows:
61+
62+
![install-python-advanced-1](../images/install-python-advanced-1.png){: style="align:left"}
63+
![install-python-advanced-2](../images/install-python-advanced-2.png){: style="align:left"}
64+
65+
### Step 2: verify installation
66+
67+
To verify the Python installation and make sure that your system is ready to install
68+
DataJoint, open a command window by entering `cmd` into the Windows search bar:
69+
70+
![install-cmd-prompt](../images/install-cmd-prompt.png){: style="align:left"}
71+
72+
From here `python` and the Python package manager `pip` can be verified by running
73+
`python -V` and `pip -V`, respectively:
74+
75+
![install-verify-python](../images/install-verify-python.png){: style="align:left"}
76+
77+
If you receive the error message that either `pip` or `python` is not a recognized
78+
command, please uninstall Python and ensure that the option to add Python to the `PATH`
79+
variable was properly configured.
80+
81+
### Step 3: install DataJoint
82+
83+
DataJoint (and other Python modules) can be easily installed using the `pip` Python
84+
package manager which is installed as a part of Python and was verified in the previous
85+
step.
86+
87+
To install DataJoint simply run `pip install datajoint`:
88+
89+
![install-datajoint-1](../images/install-datajoint-1.png){: style="align:left"}
90+
91+
This will proceed to install DataJoint, along with several other required packages from
92+
the PIP repository.
93+
When finished, a summary of the activity should be presented:
94+
95+
![install-datajoint-2](../images/install-datajoint-2.png){: style="align:left"}
96+
97+
Note: You can find out more about the packages installed here and many other freely
98+
available open source packages via [pypi](https://pypi.python.org/pypi), the Python
99+
package index site.
100+
101+
### (Optional) step 4: install packages for ERD support
102+
103+
To draw diagrams of your DataJoint schema, the following additional steps should be
104+
followed.
105+
106+
#### Install Graphviz
107+
108+
DataJoint currently utilizes [Graphviz](http://graphviz.org) to generate the ERD
109+
visualizations.
110+
Although a Windows version of Graphviz is available from the main site, it is an older
111+
and out of date 32-bit version.
112+
The recommended pre-release builds of the 64 bit version are available here:
113+
114+
https://ci.appveyor.com/project/ellson/graphviz-pl238
115+
116+
More specifically, the build artifacts from the `Win64; Configuration: Release` are
117+
recommended, available
118+
[here](https://ci.appveyor.com/api/buildjobs/hlkclpfhf6gnakjq/artifacts/build%2FGraphviz-install.exe).
119+
120+
This is a regular Windows installer executable, and will present a dialog when starting:
121+
122+
![install-graphviz-1](../images/install-graphviz-1.png){: style="align:left"}
123+
124+
It is important that an option to place Graphviz in the `PATH` be selected.
125+
126+
For a personal installation:
127+
128+
![install-graphviz-2a](../images/install-graphviz-2a.png){: style="align:left"}
129+
130+
To install system wide:
131+
132+
![install-graphviz-2b](../images/install-graphviz-2b.png){: style="align:left"}
133+
134+
Once installed, Graphviz can be verified from a fresh command window as follows:
135+
136+
![install-verify-graphviz](../images/install-verify-graphviz.png){: style="align:left"}
137+
138+
If you receive the error message that the `dot` program is not a recognized command,
139+
please uninstall Graphviz and ensure that the
140+
option to add Python to the PATH variable was properly configured.
141+
142+
Important: in some cases, running the `dot -c` command in a command prompt is required
143+
to properly initialize the Graphviz installation.
144+
145+
#### Install PyDotPlus
146+
147+
The PyDotPlus library links the Graphviz installation to DataJoint and is easily
148+
installed via `pip`:
149+
150+
![install-pydotplus](../images/install-pydotplus.png){: style="align:left"}
151+
152+
#### Install Matplotlib
153+
154+
The Matplotlib library provides useful plotting utilities which are also used by
155+
DataJoint's `Diagram` drawing facility.
156+
The package is easily installed via `pip`:
157+
158+
![install-matplotlib](../images/install-matplotlib.png){: style="align:left"}
159+
160+
### (Optional) step 5: install Jupyter Notebook
161+
162+
As described on the www.jupyter.org website:
163+
164+
'''
165+
The Jupyter Notebook is an open-source web application that allows
166+
you to create and share documents that contain live code, equations,
167+
visualizations and narrative text.
168+
'''
169+
170+
Although not a part of DataJoint, Jupyter Notebook can be a very useful tool for
171+
building and interacting with DataJoint pipelines.
172+
It is easily installed from `pip` as well:
173+
174+
![install-jupyter-1](../images/install-jupyter-1.png){: style="align:left"}
175+
![install-jupyter-2](../images/install-jupyter-2.png){: style="align:left"}
176+
177+
Once installed, Jupyter Notebook can be started via the `jupyter notebook` command,
178+
which should now be on your path:
179+
180+
![install-verify-jupyter](../images/install-verify-jupyter.png){: style="align:left"}
181+
182+
By default Jupyter Notebook will start a local private web server session from the
183+
directory where it was started and start a web browser session connected to the session.
184+
185+
![install-run-jupyter-1](../images/install-run-jupyter-1.png){: style="align:left"}
186+
![install-run-jupyter-2](../images/install-run-jupyter-2.png){: style="align:left"}
187+
188+
You now should be able to use the notebook viewer to navigate the filesystem and to
189+
create new project folders and interactive Jupyter/Python/DataJoint notebooks.
190+
191+
### Git for Windows
192+
193+
The [Git](https://git-scm.com/) version control system is not a part of DataJoint but
194+
is recommended for interacting with the broader Python/Git/GitHub sharing ecosystem.
195+
196+
The Git for Windows installer is available from https://git-scm.com/download/win.
197+
198+
![install-git-1](../images/install-git-1.png){: style="align:left"}
60199

61-
## Other Configuration Settings
200+
The default settings should be sufficient and correct in most cases.
62201

63-
If you are not using DataJoint on your own, or are setting up a DataJoint
64-
system for other users, some additional configuration options may be required
65-
to support [TLS](#tls-configuration) or :ref:`external storage <external>` .
202+
### MySQL for Windows
66203

67-
## TLS Configuration
204+
For hosting pipelines locally, the MySQL server package is required.
68205

69-
Starting with v0.12, DataJoint will by default use TLS if it is available. TLS can be
70-
forced on or off with the boolean `dj.config['database.use_tls']`.
206+
MySQL for windows can be installed via the installers available from the
207+
[MySQL website](https://dev.mysql.com/downloads/windows/).
208+
Please note that although DataJoint should be fully compatible with a Windows MySQL
209+
server installation, this mode of operation is not tested by the DataJoint team.
19.6 KB
Loading
10.2 KB
Loading
46.8 KB
Loading

docs/src/images/install-git-1.png

17.5 KB
Loading
15.4 KB
Loading
17.7 KB
Loading
17.8 KB
Loading

docs/src/images/install-jupyter-1.png

7.04 KB
Loading

docs/src/images/install-jupyter-2.png

60.7 KB
Loading

0 commit comments

Comments
 (0)