autocompletion on subpackages not working
See original GitHub issueHi, I cannot get autocompletion to work on some custom python packages. I have added my custom package path in user sublime settings as:
"python_package_paths": [
// path for package
"/home/ilias/modules/lib/python2.7/site-packages/moduleA",
],
Autocompletion works fine for the functions declared in the __init__.py
file of moduleA
by writing:
import ModuleA as MA
MA.read_files()
In the same directory however, I also have some other .py subpackages (e.g. mergefunct.py
) which include additional functions. In my main code, I can normally import and call these as:
import ModuleA.mergefunct as mergefunct
mergefunct.perform_merging()
Autocomplete locates the package mergefunct
under ModuleA
, but as soon as I press ‘dot’ to use the functions inside it, it doesn’t detect the functions at all. Furthermore, after this autocompletion no longer works even for normal python functions as math
or numpy
etc. and I need to restart sublime to get it working again.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:12 (8 by maintainers)
Top Results From Across the Web
Sub-packages and auto-completion
So I can provide some clarification and a workaround. Clarification. First off, this only triggers on the EndPackage :.
Read more >Sub-packages and auto-completion - Wolfram Community
Wolfram Community forum discussion about Sub-packages and auto-completion. Stay on top of important topics and build connections by joining Wolfram ...
Read more >r/learnpython - Autocomplete for packages and "sub ... - Reddit
Autocomplete for packages and "sub-packages" works in Spyder and Jupyter/IPython, but not ... In case anyone else has the same problem:.
Read more >How to enable autocomplete (IntelliSense) for python package ...
I've found a solution, but I would appreciate some explanation from someone more experienced with Python: import package.module as module.
Read more >Code autocomplete does not recognize custom packages
It seems that custom packages are not still handled properly by the code editor as the code editor does not offer my sub-packages,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@iliasptr about example that you provided. Yes, this all about how python discovers packages and modules. When I tried to complete package name in
othermodule.py
on import linefrom
python (and jedi) I were unable to seemypackage
, becausemypackage
is not in python path.For this, specific, case, I have changed
example.sublime-project
in next wayAnd restarted sublime text (!) to restart completion daemon with new settings (yeah, restart required when new extra package appears in settings).
And completion works (:
We pointed python to a directory when it should looks for packages.
@iliasptr please reopen the issue if you still have a problem with this.