You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Experimenting with developing a better interface to [Julia language](https://julialang.org/) that works with [Python](https://www.python.org/) 2 & 3 and Julia v0.6+.
8
8
9
-
to run the tests, execute from the toplevel directory
10
-
11
-
```shell
12
-
tox
13
-
```
14
-
15
-
See [Testing](#testing) below for details.
16
-
17
-
**Note** You need to explicitly add julia to your `PATH`, an alias will not work.
18
-
19
9
`pyjulia` is tested against Python versions 2.7, 3.6, and 3.7. Older versions of Python (than 2.7) are not supported.
20
10
21
11
Installation
22
12
------------
13
+
14
+
**Note:** If you are using Python installed with Ubuntu or `conda`,
15
+
PyJulia does not work by default with standard Python interpreter and
16
+
Julia ≥ 0.7. For workarounds, see [Troubleshooting](#troubleshooting)
17
+
below. Same caution applies to other Debian-based and possibly other
18
+
GNU/Linux distributions.
19
+
23
20
You will need to install PyCall in your existing Julia installation
24
21
25
22
```julia
23
+
using Pkg # for julia ≥ 0.7
26
24
Pkg.add("PyCall")
27
25
```
28
26
29
27
Your python installation must be able to call Julia. If your installer
30
28
does not add the Julia binary directory to your `PATH`, you will have to
31
-
add it.
29
+
add it._An alias will not work._
32
30
33
31
Then finally you have to install pyjulia.
34
32
33
+
**Note:** If you are not familiar with `pip` and have some troubles
34
+
with the following installation steps, we recommend to go through
35
+
[Tutorials in Python Packaging User Guide](https://packaging.python.org/tutorials/).
36
+
35
37
To get released versions you can use:
36
38
39
+
```sh
40
+
python3 -m pip install --user julia
41
+
python2 -m pip install --user julia # If you need Python 2
37
42
```
38
-
pip install julia
43
+
44
+
where `--user` should be omitted if you are using virtual environment
45
+
(`virtualenv`, `venv`, `conda`, etc.).
46
+
47
+
If you are interested in using the development version, you can
You may experience segmentation fault when using PyJulia in old
215
+
versions of IPython. You can avoid this issue by updating IPython to
216
+
7.0 or above. Alternatively, you can use IPython via Jupyter (e.g.,
217
+
`jupyter console`) to workaround the problem.
218
+
219
+
129
220
How it works
130
221
------------
131
222
PyJulia loads the `libjulia` library and executes the statements therein.
@@ -139,7 +230,50 @@ when reference count drops to zero, so that the Julia object may be freed).
139
230
Limitations
140
231
------------
141
232
142
-
Not all valid Julia identifiers are valid Python identifiers. Unicode identifiers are invalid in Python 2.7 and so `pyjulia` cannot call or access Julia methods/variables with names that are not ASCII only. Additionally, it is a common idiom in Julia to append a `!` character to methods which mutate their arguments. These method names are invalid Python identifers. `pyjulia` renames these methods by subsituting `!` with `_b`. For example, the Julia method `sum!` can be called in `pyjulia` using `sum_b(...)`.
233
+
### Mismatch in valid set of identifiers
234
+
235
+
Not all valid Julia identifiers are valid Python identifiers. Unicode
236
+
identifiers are invalid in Python 2.7 and so `pyjulia` cannot call or
237
+
access Julia methods/variables with names that are not ASCII only.
238
+
Although Python 3 allows Unicode identifiers, they are more
239
+
aggressively normalized than Julia. For example, `ϵ` (GREEK LUNATE
240
+
EPSILON SYMBOL) and `ε` (GREEK SMALL LETTER EPSILON) are identical in
241
+
Python 3 but different in Julia. Additionally, it is a common idiom
242
+
in Julia to append a `!` character to methods which mutate their
243
+
arguments. These method names are invalid Python identifers.
244
+
`pyjulia` renames these methods by subsituting `!` with `_b`. For
245
+
example, the Julia method `sum!` can be called in `pyjulia` using
246
+
`sum_b(...)`.
247
+
248
+
### Pre-compilation mechanism in Julia 1.0
249
+
250
+
There was a major overhaul in the module loading system between Julia
0 commit comments