Skip to content

Add docs for issue #255 #269

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions docs/src/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,27 @@ Python(65251,0x104cf8580) malloc: *** set a breakpoint in malloc_error_break to
```

A solution is to ensure that `juliacall` is imported before `torch`.

## `ccall requries the compiler` error when importing some Python libraries
On some systems, you may see an error like the following when import e.g. `matplotlib` before `juliacall`:

```
ERROR: `ccall` requires the compilerTraceback (most recent call last):
File "/home/dingraha/projects/pythoncall_import_error/run.py", line 2, in <module>
from foo import Foo
File "/home/dingraha/projects/pythoncall_import_error/foo.py", line 4, in <module>
import juliacall; jl = juliacall.newmodule("FooModule")
File "/home/dingraha/projects/pythoncall_import_error/venv/lib/python3.9/site-packages/juliacall/__init__.py", line 218, in <module>
init()
File "/home/dingraha/projects/pythoncall_import_error/venv/lib/python3.9/site-packages/juliacall/__init__.py", line 214, in init
raise Exception('PythonCall.jl did not start properly')
Exception: PythonCall.jl did not start properly
```

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.
Linux distributions with older `libstdc++` versions seem more likely to suffer from this issue.
The solution is to either:

* use a Linux distribution with a more recent `libstdc++`
* import `juliacall` before the other Python library, so that Julia's `libstdc++` is loaded
* use a Python from a conda environment, which will have a newer `libstdc++` that is compatible with Julia's