Преглед на файлове

Further details on integrating nixWrapper with common tools, particularly virtualenv and jupyter

Andrej преди 1 месец
родител
ревизия
c93341e269
променени са 1 файла, в които са добавени 33 реда и са изтрити 2 реда
  1. 33 2
      README.md

+ 33 - 2
README.md

@@ -8,7 +8,7 @@ A set of tools used to format NIX compatible databases.
 pip install nixWrapper 
 ```
 
-##Usage
+## Usage
 
 ```python
 import nixWrapper
@@ -16,9 +16,40 @@ nixWrapper.loadLibrary('labkeyInterface')
 import labkeyInterface
 ...
 ```
+
+## Use with virtualenv
+
+Create virtualenv called `nix` where we will use nixWrapper:
+```bash
+#: cd $HOME
+#:~$ mkdir venv
+#:~$ cd venv
+#:~/venv$ virtualenv -p python3 nix
+#:~/venv$ . ./nix/bin/activate
+(nix) $:~/venv$ cd
+(nix) $:~$ pip install nixWrapper
+```
+Whenever you need `nixWrapper` in your code, simply run:
+```bash
+#: ~/venv/nix/python3 yourScript.py
+```
+where in your script `yourScript.py` you use nixWrapper directly like in Usage section.
+
+## Use virtualenv in jupyter
+
+To integrate `nixWrapper` installed in virtualenv with your jupyter code, jupyter needs
+to be aware of virtualenv. To do that:
+```bash
+#~$: . ~/venv/nix/bin/activate
+(nix) #:~$ pip install ipykernel
+(nix) #:~$ python -m ipykernel install --user --name=nix
+Installed kernelspec nix in /home/<your name>/.local/share/jupyter/kernels/nix
+```
+More info [here][venvJupyter].
+
 ## Developer notes
 
 [Packaging][pypiTutorial] howto.
 
 [pypiTutorial]: https://packaging.python.org/en/latest/tutorials/packaging-projects/
-
+[venvJupyter]: https://docs.support.arc.umich.edu/python/jupyter_virtualenv/