Autocomplete for compiled extensions? Follow
I would like to know how to get PyCharm's autocomplete working for a third-party library that I have only the .pyc file for. The sole other example I've found references the .pyc, .py and.pyd files.
I apologize if this is a newbie and/or silly question. I am trying to learn Python specifically so I can use this third-party library (it's the new Python interface for Lightwave 3d.) This library is huge and not well documented, so code completion would save me a HUGE amount of pain.
I've tried dropping the .pyc file in the "site-packages" folder, but no luck. Can anyone tell me what I'm doing wrong, or if this is even possible?
I apologize if this is a newbie and/or silly question. I am trying to learn Python specifically so I can use this third-party library (it's the new Python interface for Lightwave 3d.) This library is huge and not well documented, so code completion would save me a HUGE amount of pain.
I've tried dropping the .pyc file in the "site-packages" folder, but no luck. Can anyone tell me what I'm doing wrong, or if this is even possible?
Please sign in to leave a comment.
After you put the .pyc in site-packages, please try to open Settings | Python Interpreters and press the "Reload" button in the Paths tab. Then PyCharm should generate a .py stub for your .pyc file.
Clicking on the "Details" link I got this "Skeleton Generation Problems" dialog box: "Python 2.7.3 virtualenv at C:\Users\tomw\test2\test1 - lwsdk - Generation of skeletons for the modules above will be tried again when the modules are updated or a new version of generator is available."
It looks like this issue: http://youtrack.jetbrains.com/issue/PY-7691
Is there anything else I can try at this point or am I pretty much dead in the water?
idea.log (15KB)
Here's the log file. I apologize for being such a Python noob. I have installed both the 32 and 64 bit Python 2.7.3 packages (don't know if that is important). Some additional interesting information:
The module I actually want to import is "lwsdk". I tried dropping it into the global site-packages and importing it into IDLE, and got the following complaint:
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import lwsdk
File "lwsdk.py", line 10, in <module>
ImportError: No module named pcore
So I added the "pcore.pyc" module. That led to this:
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
import lwsdk
File "lwsdk.py", line 10, in <module>
File "pcore.py", line 26, in <module>
File "pcore.py", line 18, in swig_import_helper
ImportError: No module named _pcore
Sure enough, I found a module called "_pcore.pyd" and dropped that one in as well. That led to this mysterious message:
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
import lwsdk
File "lwsdk.py", line 10, in <module>
File "pcore.py", line 26, in <module>
File "pcore.py", line 22, in swig_import_helper
ImportError: DLL load failed: The specified module could not be found.
Now I'm not sure what to do. If you can help me in any way with this I would appreciate it. Thanks.
Thank you for your time and your patience.