Reputation: 31
I have a binary module made with pyo3 and rust. It is in a directory with a script that imports it. The directory is marked as source root, so that shouldn't be the problem. There are red squiggly marks under the import, but when I run the script, it runs fine.
directory
|- string_sum.pyd
|- test.py
test.py:
import string_sum
print(string_sum.sum_as_string(1, 2))
The output is 3, so it is working. How to make pycharm behave?
Upvotes: 1
Views: 1331
Reputation: 11942
PyCharm does not support Cython pyd modules out of the box, it can't introspect Cython code so no completion is possible. You can suppress import errors by Alt+Enter | Ignore unresolved reference (on the line marked as error).
Perhaps there's a plug-in for PyCharm to work with these kind of modules, you might want to look into those.
Upvotes: 3