How do I add Binary Skeleton for external library permanently

已回答

I'm trying to get PyCharm to permanently add the python stubs for Gimp to my project.  I have now wasted hours trying to figure out something that should be trivial.

I have a project with the following imports:

import os
import gi
from gi.repository import Gimp
from gi.repository import GObject
from gi.repository import GLib
from gi.repository import Gtk
import sys

PyCharm then suggests that I build stubs for some of the imports which I do.  It builds the stubs for all but Gimp.  So I thought that like for VS Code or Sublime I could just manually add the stubs, and be done with things.

So I expanded External Libraries →Binary Skeletons

I then found the location of the parent folder for the Gimp stubs, got the absolute path to the folder and added the Gimp folder.

This works, but then when I restart PyCharm it deletes the Gimp folder I added.  How do I permanently add stubs such that they are always available?

Thanks in advance.

Jordan

0

Have you tried to add the Stub Directory to Your Interpreter’s Paths? 

Check out https://www.jetbrains.com/help/pycharm/installing-uninstalling-and-reloading-interpreter-paths.html#view for additional details

0

This works in so much as it PyCharm will not mark it as an unresolved reference and autocomplete works.  But that adds the stubs to the compile path and any module that imports the module with the reference will fail when they try to import the stubs, breaking any scripts that reference scripts that use those stubs.

 

0

请先登录再写评论。