1

私はグーグルで試してみましたが、あまり/何も見つかりませんでした。以下もまったく役に立ちません...

https://ipython.org/ipython-doc/3/interactive/magics.html

典型的なユースケースは次のとおりです。

In [31]: from sqlalch<TAB>  
Caching the list of root modules, please wait!
(This will only be done once - type '%rehashx' to reset cache!)

em
Caching the list of root modules, please wait!
(This will only be done once - type '%rehashx' to reset cache!)


Caching the list of root modules, please wait!
(This will only be done once - type '%rehashx' to reset cache!)


                        sqlalchemy 

また、単独で実行%rehashxすることも役に立ちません。私も pip をインストールしpyreadlineました。

何がうまくいかないのですか?情報はどこに%rehashx保存されますか?

編集

からの出力get_ipython().db['rootmodules_cache']は次のとおりです。

for key in d.keys(): print key
# /usr/local/bin
# /usr/lib/python3/dist-packages
# /usr/lib/python3.5
# /usr/local/lib/python3.5/dist-packages <- should be in here
# /usr/lib/python3.5/lib-dynload
# /usr/lib/python35.zip
# /usr/local/lib/python3.5/dist-packages/IPython/extensions
# /usr/lib/python3.5/plat-x86_64-linux-gnu
# /home/user/.ipython

import sqlalchemy
sqlalchemy.__file__
# /user/local/lib/python3.5/dist-packages/sqlalchemy/__init__.py

ただし、sqlalchemy はリストにありません

d = get_ipython().db['rootmodules_cache']
'sqlalchemy' in d['/user/local/lib/python3.5/dist-packages']
# False
4

1 に答える 1