Open prjemian opened 1 year ago
This came up before. One of the packages caused this. Which?
not sure any of these will help this problem
Particularly: https://stackoverflow.com/a/64554305/1046449
A possible reason a user may believe that autocomplete is not working may be that autocomplete is just taking too long. Circa 2020-11-27 this is particularly true for Pandas when operating with jedi in a Jupyter notebook environment.
The issue can be solved by using the following magic which deactivates jedi
%config Completer.use_jedi = False
See the SO link for more details.
Maybe also version specific with jedi: pip install --upgrade jedi==0.17.2
(earlier versions presented this failure)
Install today (total anaconda installation) has:
(base) [bcda-rhel9 /APSshare/anaconda3] conda list jedi
# packages in environment at /APSshare/anaconda3/x86_64:
#
# Name Version Build Channel
jedi 0.18.1 py310h06a4308_1
Also, in same SO page:
For anyone arriving here with an "older" version of ipython, there was a bug with the Jedi dependency, (0.18.0 doesn't work, 0.17.2 does).
pin jedi <0.18
installed 0.17.2 -- Same problem still.
pin jedi >=0.18.2
installed 0.18.2 -- same problem still
conclusion: failing tab completion is not due to jedi version
On suggestion, disable jedi in the IPython session altogether: %config Completer.use_jedi = False
-- Same problem still
readline
(bluesky_2023_2) prjemian@zap:~/training$ conda list readline
# packages in environment at /home/prjemian/.conda/envs/bluesky_2023_2:
#
# Name Version Build Channel
readline 8.2 h8228510_1 conda-forge
That's the most recent conda-forge package, last update a month ago. Reports (undocumented) of this problem started before that. Try pinning older versions from conda-forge channel.
pin | installed | result |
---|---|---|
readline ==8.1.2 |
8.1.2 | ImportError: cannot import name 'file_log_handler' from 'apstools.utils' |
readline ==8.1.0 |
8.1.0 | Still same problem (no tab completion after second . ) |
Conclusion: failing tab completion is not due to readline version
This issue seems related, but to older IPython 7. This issue involves IPython 8.13.2.
Test this out in a very clean environment, such as a fresh OS install inside a Docker container. No extra environment variables and such.
Use a simple test code with no import requirements:
class Data:
thing = [1, 2, 3]
that = dict(a="a", b="b"*8)
class Thing1:
ying = "one"
yang = "two"
data = Data()
class Thing2:
appen = 3
zell = 4
seuss = Thing1()
ogden = Thing2()
>>> ogden.<TAB>
ogden.appen ogden.seuss ogden.zell
>>> ogden.seuss.<TAB>
ogden.seuss.data ogden.seuss.yang ogden.seuss.ying
>>> ogden.seuss.data<TAB>
ogden.seuss.data
>>> ogden.seuss.data.th<TAB>
ogden.seuss.data.that ogden.seuss.data.thing
>>> ogden.seuss.data.that<CR>
{'a': 'a', 'b': 'bbbbbbbb'}
>>> ogden.seuss.data.thing<CR>
[1, 2, 3]
Response of this configuration is shown above. Result: tab completion working at all levels tested.
Starting from Dockerfile above: conda install -y ipython
In [2]: ogden<TAB> ()
In [2]: ogden.<TAB> (appen, seuss, zell)
In [2]: ogden.seuss.<TAB> (data, yang, ying)
In [2]: ogden.seuss.data.<TAB> (that, thing)
Out[2]: [1, 2, 3]
Result: tab completion working at all levels tested.
same results
Result: tab completion working at all levels tested.
Test 3: use bluesky_2023_2
environment and IPython
Then, in the container:
conda activate bluesky_2023_2
ipython
same results
Result: tab completion working at all levels tested.
Summary (so far) with testing in Docker container: No problem observed.
Test 4: use bluesky_2023_2
environment and run blueskyStarter.sh
same results
Result: tab completion working at all levels tested.
Look at user account's environment setup in problematic configurations.
Continue with modifications to Dockerfile.
Test 5: same conda environment on new linuxmint user account with minimal environment configuration
same results
Result: tab completion working at all levels tested.
Still not obvious what will resolve this.
With current environment, tab completion is failing for requests after the second
.
. How to fix?