Skip to content

Commit c5e10bd

Browse files
authored
Add docs for issue #255 (#269)
1 parent f3702e4 commit c5e10bd

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

docs/src/faq.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,27 @@ Python(65251,0x104cf8580) malloc: *** set a breakpoint in malloc_error_break to
1111
```
1212

1313
A solution is to ensure that `juliacall` is imported before `torch`.
14+
15+
## `ccall requries the compiler` error when importing some Python libraries
16+
On some systems, you may see an error like the following when import e.g. `matplotlib` before `juliacall`:
17+
18+
```
19+
ERROR: `ccall` requires the compilerTraceback (most recent call last):
20+
File "/home/dingraha/projects/pythoncall_import_error/run.py", line 2, in <module>
21+
from foo import Foo
22+
File "/home/dingraha/projects/pythoncall_import_error/foo.py", line 4, in <module>
23+
import juliacall; jl = juliacall.newmodule("FooModule")
24+
File "/home/dingraha/projects/pythoncall_import_error/venv/lib/python3.9/site-packages/juliacall/__init__.py", line 218, in <module>
25+
init()
26+
File "/home/dingraha/projects/pythoncall_import_error/venv/lib/python3.9/site-packages/juliacall/__init__.py", line 214, in init
27+
raise Exception('PythonCall.jl did not start properly')
28+
Exception: PythonCall.jl did not start properly
29+
```
30+
31+
As described in [issue 255](https://github.com/cjdoris/PythonCall.jl/issues/255), the likely problem is that the "other" Python library (`matplotlib`, whatever) is loading the system `libstdc++.so`, which isn't compatible with the `libstdc++.so` that Julia ships with.
32+
Linux distributions with older `libstdc++` versions seem more likely to suffer from this issue.
33+
The solution is to either:
34+
35+
* use a Linux distribution with a more recent `libstdc++`
36+
* import `juliacall` before the other Python library, so that Julia's `libstdc++` is loaded
37+
* use a Python from a conda environment, which will have a newer `libstdc++` that is compatible with Julia's

0 commit comments

Comments
 (0)