I like PyCharm and have used it before for my Python projects, but I just started messing with IronPython and I can't figure out how to make PyCharm or any other IDE for that matter (except for VS which works fine) recognize the .NET libraries.
For example, I have the code:
from System.Environment import *
path = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)
The above code works fine, but the "System" part is underlined grey everywhere with the message "Unresolved reference System". The IronPython documentation explains that System is not a module but rather a namespace. If I do type(system)
I get <type 'namespace#'>
. So is there a way to make PyCharm/PyDev recognize the namespaces as well? On a side note, the PATH is fine, everything is fine.
For performance reasons, PyCharm does not generate Python stubs for .NET assemblies by default. You can trigger the generation by putting the caret on an unresolved reference in an import statement, pressing Alt-Enter and selecting the "Generate stubs for binary module ..." quickfix.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With