Reputation: 3332
I'm scripting a progam (Rhino/Grasshopper) with external IDE/debugging (Visual Studio 2019 Community) and everything is fine, except for some imports. Rhino uses an internal IronPython 2.7 interpreter with built in Pyhthon classes that are available as stubs in Pyhton module. I have installed an IronPython (C:\Program Files\IronPython 2.7) and installed modules there that are available under C:\Program Files\IronPython 2.7\Lib\site-packages\Rhino-stubs. Then I added the Lib folder to the Search Paths (in my .pyproj
<SearchPath>..\..\..\..\Program Files\IronPython 2.7\Lib</SearchPath>
among other paths). And intellisense doesn't detect it.
Note that if I add a more complete path, ie.
<SearchPath>..\..\..\..\Program Files\IronPython 2.7\Lib\site-packages\Rhino-stubs</SearchPath>
then the classes that are in subfolders' sources are seen.
Any ideas what is wrong and what is to be set up?
(Note that ironPyhton is deprecated in VS 2019 and not supported in 2022, but I'm bound to this environment as this is used by the Rhino).
Upvotes: 0
Views: 660
Reputation: 3332
The solution was absurd: The packages and their folder names contained hyphens ("Rhino-stubs", "Grasshopper-stubs") and Visual Studio 2019 didn't like this (while PyCharm handled it the right way, calling the package "Rhino" etc. and providing autocomplete).
A workaround was to rename folder from "Rhino-stubs" to "Rhino" etc. (Note that the whole environment was set up only to edit Python files in a convenient way, so picking around these stubs is not harmful).
Upvotes: 0