We tested the following scenario:
Installed Python 3.8.0 with the numpy package (pip install numpy). On our tests, if we set
CodeEnvironment.PythonPath to the installation of Python 3.8, the following script compiles and runs just fine:
import numpy as np
result = [[0,0,0],
det = np.linalg.det(np.array(result))
print("det = " + str(det))
Could you please try our DebuggerIntegration sample for Python to see if it works for you? It uses embedded Python installation, however you can change it to use Python 3.8 instead by calling
CodeEnvironment.PythonPath = instead of SetupPython in this demo.
In the same demo, we use PythonNETParser, and the code completion for np does not work indeed.
We do support (partially) code completion for Python packages. For example, code completion for the following code will work:
However, numpy package has more complex structure that our parser does not handle yet. Fixing this issue is already on our to-do list.
BTW, you may consider using our LSP-based Python parser which can be initialized like this:
var parser = new Alternet.Syntax.Parsers.Lsp.Python.PythonParser();
parser.Workspace.ServerDeploymentOptions.Mode = Alternet.Syntax.Parsers.Lsp.ServerDeploymentMode.ApplicationDefined;
parser.Workspace.ServerDeploymentOptions.ApplicationDefinedServerDirectory = pythonPath;
We tested it, and It shows code completion for numpy in case we set pythonPath to Python 3.9, however, it does not work for Python 3.8 (both have the language server installed: pip install language-server).