Skip to content
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

Pycharm Integration : Unavailable classes #23

Open
Maozerhouni opened this issue Oct 21, 2020 · 3 comments
Open

Pycharm Integration : Unavailable classes #23

Maozerhouni opened this issue Oct 21, 2020 · 3 comments

Comments

@Maozerhouni
Copy link

Hi,

I installed the stubs. I am trying to use them in Pycharm. I am using Python 3.6.

When trying to import clr, it raises many errors. Mostly unavailable classes. For Example :
File "C:/Users/TOSHIBA/AppData/Roaming/JetBrains/PyCharmCE2020.1/scratches/scratch.py", line 1, in
import clr
File "C:\ProgramData\Anaconda3\envs\EnvPy36\lib\clr.py", line 702, in
class RuntimeReturnChecker(PythonTypeSlot):
NameError: name 'PythonTypeSlot' is not defined

What am I doing wrong ?

@gtalarico
Copy link
Owner

Hi @Maozerhouni

You don't need these stubs to use pycharm. PyCharm auto-generates stubs from you In fact, this project uses pycharm code to generate stubs for use in other editors (generator3.py)

You should undo any changes you did, and in pycharm use the Generate stubs feature - I think you right click the module name or something, not sure where exactly since I don't have pycharm installed

@Maozerhouni
Copy link
Author

Hi @gtalarico,
Thanks for answering. and thanks for this great work.

I corrected some SyntaxError that stop the code for running (For example, in clr, line 26 def accepts(*types,p_object=None): # real signature unknown; restored from doc should be changed to def accepts(p_object=None,*types): # real signature unknown; restored from _doc)

but after that, many classes seems to be missing. I guess I missed somepart about integrating NET Framework with pycharm, as most of the classes seems to exist in other modules or other dll files. For example ISerialization, which is used in clr and in other classes through System. But that I couldn't find. For example, IStrongbox (line 585 in clr.py), List,IList ... (line 611 in clr.py), IDisposable for Revit.py. This raises an error while running clr importation.

What I don't get is that the some tools seems to work fine in a simple IronPython console, but not in PyCharm.

I have IronPython installed. I runned pycharm with Python2.7, and Ironpython. both didn't work in pycharm.

Did you face similar issues ?

Thanks for your answer

@toothless92
Copy link

Leaving this for others that may find it useful, I have made a script to fix typing issues, see here: #35

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants