You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cannot complete namespace packages (was Where did %rehash go?) #8875
Either %rehash was mistakenly removed, or the doc of %rehashx
In [9]: %rehashx?
Docstring:
Update the alias table with all executable files in $PATH.
This version explicitly checks that every entry in $PATH is a file
with execute access (os.X_OK), so it is much slower than %rehash.
Under Windows, it checks executability as a match against a
'|'-separated string of extensions, stored in the IPython config
variable win_exec_ext. This defaults to 'exe|com|bat'.
This function also resets the root module cache of module completer,
used on slow filesystems.
File: /usr/lib/python3.5/site-packages/IPython/core/magics/osm.py
In [10]: %rehash?
Object `%rehash` not found.
As a side note I noticed this when I realized that import mpl_ would not complete mpl_toolkits and tried to %rehash my cache; I still don't know how to get this to complete properly.
Wow, that's an out-of-date docstring. The last version with %rehash was 0.10 about five years ago. %rehashx is all that we have now. Does it not clear your module completer cache?
Hm. What's your Python, IPython and OS version? And what do you get for get_ipython().db.get('rootmodules_cache')? It only caches imports when it takes a long time to compute them, otherwise it computes them on the fly.
Could it be related to mpl_toolkits being a namespace package? Something that we (mpl developers that is) should perhaps change in the future due to other issues.
@jenshnielsen yes, it's possible, however I do find mpl_toolkits in my import completions, so I'm trying to figure out what is different between the two environments.
@minrk I can reproduce the issue on OSX 10.11 with my pip installed dev ca .1.5.rc2 version of matplotlib but not in a Conda env on the same machine. Not sure what the difference is
If on Python 3 it's a PEP 420 namespace package, I don't think there's any simple way to identify it as a package for tab completion. The normal indicator of a package is that it contains an __init__.py file, and PEP 420 namespace packages don't have that. I don't think we should assume any directory could be a namespace package.
Activity
minrk commentedon Oct 7, 2015
Wow, that's an out-of-date docstring. The last version with
%rehashwas 0.10 about five years ago.%rehashxis all that we have now. Does it not clear your module completer cache?anntzer commentedon Oct 7, 2015
At least I still can't complete
import mpl_intoimport mpl_toolkits.minrk commentedon Oct 9, 2015
Hm. What's your Python, IPython and OS version? And what do you get for
get_ipython().db.get('rootmodules_cache')? It only caches imports when it takes a long time to compute them, otherwise it computes them on the fly.jenshnielsen commentedon Oct 9, 2015
Could it be related to
mpl_toolkitsbeing a namespace package? Something that we (mpl developers that is) should perhaps change in the future due to other issues.minrk commentedon Oct 9, 2015
@jenshnielsen yes, it's possible, however I do find
mpl_toolkitsin my import completions, so I'm trying to figure out what is different between the two environments.anntzer commentedon Oct 9, 2015
Arch Linux standard packages, on a clean (new) profile.
get_ipython().db.get('rootmodules_cache')returns None.jenshnielsen commentedon Oct 9, 2015
@minrk I can reproduce the issue on OSX 10.11 with my pip installed dev ca .1.5.rc2 version of matplotlib but not in a Conda env on the same machine. Not sure what the difference is
minrk commentedon Oct 10, 2015
@jenshnielsen thanks for narrowing it down. It may have something to do with namespace packages.
Remove mention to rehash
[-]Where did %rehash go?[/-][+]Cannot complete namespace packages (was Where did %rehash go?)[/+]Carreau commentedon Jan 19, 2016
Rename to reflect remaining issue about completion of namespace packages.
And bump to 5.0
takluyver commentedon Jan 19, 2016
If on Python 3 it's a PEP 420 namespace package, I don't think there's any simple way to identify it as a package for tab completion. The normal indicator of a package is that it contains an
__init__.pyfile, and PEP 420 namespace packages don't have that. I don't think we should assume any directory could be a namespace package.Carreau commentedon May 18, 2016
Bumping to 6.0 as there are few change we can actually so've it for 5.0 if we don't know the reason.
Carreau commentedon Feb 9, 2017
Fixed by #10182 (Reintegrate Jedi), Jedi is able to find this and tell it's a module.
--jedi/ipython--is just a visual delimiter between the 2 sources of completions.Closing, feel free to reopen if it's still failing on master for you.
anntzer commentedon Aug 19, 2017
This is still failing for me as of 6.1.0 and as of master (just pulled). Could the issue be reopened? Thanks.
takluyver commentedon Aug 21, 2017
Jupytercon starts tomorrow, so it may be a while before @Carreau can investigate.