Comments (11)
After a lot of internal discussion, we've deprecated tab completion starting in conda 4.4. I guess argcomplete also isn't built for python 3.6. At some point in the future if we switch our python argparse for a better library, we can consider bringing back tab completion.
from conda-docs.
Apparently I'm not the only one who likes tab completion. I did this hack.
- Installed argcomplete:
conda install --channel conda-forge argcomplete
activate-global-python-argcomplete
- Created an executable file named "tonda" (for tab-completing conda) in my
PATH
with these contents:
#!/anaconda3/anaconda/bin/python
# PYTHON_ARGCOMPLETE_OK
import re
import sys
import argcomplete
from conda.cli import main
from conda.cli.main import generate_parser
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
parser = generate_parser()
argcomplete.autocomplete(parser)
sys.exit(main())
You would need to use a shebang matching your anaconda or miniconda Python.
- Added this to my
.bashrc
:
# Location generated by activate-global-python-argcomplete
source /usr/local/etc/bash_completion.d/python-argcomplete.sh
You would need to update the location in step 3 based on the output of step 1.
This hack depends on two implementation details of conda. The generate_parser
function gives me an argparse
parser that I can pass to argcomplete.autocomplete
. After giving tab completion a chance to run, I just delegate to conda.cli.main
, which is another implementation detail.
Read here to understand how argcomplete
combines argparse
and bash
to automatically generate completions:
https://github.com/kislyuk/argcomplete
Since this is a hack, consider it good for a developer but bad for production.
from conda-docs.
Hmm, this is a bit old (and I haven't used conda for awhile so not sure if this is common knowledge or better way for this, seems misleading to even have that in the docs still if its not supported on 3.6) but thought I'd comment.
Argcomplete works fine with python3.6 atm but the official conda one is only built up to 3.5. Im not sure why the official conda repo hasn't updated the argcomplete package but the conda-forge channel has a working one and works fine w/ 3.6. @kalefranz seems like it would be straightforward and helpful to update either docs or the conda package itself
https://github.com/conda-forge/argcomplete-feedstock
from conda-docs.
I am running into the exact same problem on macOS.
from conda-docs.
Same problem here, the anaconda distributions with python 3.6+ do not have argcomplete included. We use a company wide installation here so it's not trivial to just add it back in. All scripts use argcomplete so we have to stick with an older anaconda release... painful.
from conda-docs.
argcomplete is now available for python 3.6 in the official repositories (see ContinuumIO/anaconda-issues#7517), although tab completion for conda doesn't work for me. It seems to be loaded correctly, but typing conda ins<tab>
doesn't do anything instead of completing to conda install
as expected.
$ conda -V
conda 4.4.8
$ complete -p | grep -i conda
complete -o default -o nospace -F _python_argcomplete conda
Is tab completion now completely removed? If so, it should be clearly stated in the documention. It's quite annoying have a doc title saying "Enabling tab completion" and then finding out it doesn't work for some unexplained reason.
from conda-docs.
Yeah, I still have the same problem, I checked several versions of anaconda after version 4.0.0_py3 and none of them include argcomplete, (4.1.1_py3, 4.2.0_py3, 4.3.1_py3, 4.4.0_py3, 5.0.1_py3) very frustrating.
I thought it was a basic well used module. I don't see any replacement or discussion why it was removed. It's only 131KB...
from conda-docs.
Same problem here! I've just updated my conda from 4.4.10 to 4.5.4, but the problem seems to be consistent. I'm running ubuntu 14.04 if that helps. However, in my case there doesn't seem to be any kind of error, it simply does nothing!
from conda-docs.
Guys, I am new to all this. So, please bear with my question.
I am trying to enable tab completion as mentioned here. But I don't exactly understand the what I need to do in the step 2.
I tried to add this command to my .bashrc file, tried running this command in my bash shell, but nothing works. Could anyone help me out with this. It is really annoying to type the full name of the environments. Tab completion will help a lot.
Thanks,
Naman
from conda-docs.
I'm facing the same. (Tab completion not working)
from conda-docs.
Hi there, thank you for your contribution!
This issue has been automatically locked because it has not had recent activity after being closed.
Please open a new issue if needed.
Thanks!
from conda-docs.
Related Issues (20)
- error in ciao install HOT 1
- Ammending CLAs signed for organizations HOT 1
- Rework Miniconda docs
- miniconda install error 404: Not Found HOT 2
- Small bug in documentation HOT 1
- Prepare Miniconda docs for repo transition
- MiniConda incompatible with MacOS 13.5.1 HOT 2
- Implement conda-sphinx-theme for conda-docs
- Explore using goat counter for conda documentation website analytics
- Investigate general SEO improvements to make for conda documentation HOT 1
- Landing pages for conda and conda-docs look similar HOT 1
- Startmenu Windows Anconda Prompt & Powershell Prompt are broken after installing Miniconda or Miniforge 3 HOT 2
- update "Help and support"
- ImportError: Pandas requires version '3.1.0' or newer of 'openpyxl' HOT 1
- CLA document link needs update HOT 3
- Is the docs warning still accurate? HOT 1
- Improve API reference documentation HOT 3
- Docstring format decision and advertisement HOT 1
- Guidance on rst vs md for documentation
- What should be included in the API reference documentation?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from conda-docs.