insanum / gcalcli

Google Calendar Command Line Interface
MIT License
3.3k stars 311 forks source link

gcalcli: error: argument command: invalid choice: '[gcalcli]' #496

Closed Scoob79 closed 1 day ago

Scoob79 commented 4 years ago

Hello,

after the installation of gcalcli, when i run a test command style 'gcalcli agenda' or any other command it shows me the help sitematically.

Do you have an idea ?

Cordially.

jcrowgey commented 4 years ago

I don't think we can help without more details. In general, if you're seeing the help message but not asking for --help, it means that your didn't invoke gcalcli with an extant subcommand.

Scoob79 commented 4 years ago

Hello,

here is an example of an order :

hades@CHARON:~$ gcalcli --client-secret AIza*****rks6I list usage: gcalcli [-h] [--auth_host_name AUTH_HOST_NAME] [--noauth_local_webserver] [--auth_host_port [AUTH_HOST_PORT [AUTH_HOST_PORT ...]]] [--logging_level {DEBUG,INFO,WARNING,ERROR,CRITICAL}] [--version] [--client-id CLIENT_ID] [--client-secret CLIENT_SECRET] [--config-folder CONFIG_FOLDER] [--noincluderc] [--calendar CALENDAR] [--default-calendar DEFAULTCALENDAR] [--locale LOCALE] [--refresh] [--nocache] [--conky] [--nocolor] [--lineart {fancy,unicode,ascii}] {list,search,edit,delete,agenda,calw,calm,quick,add,import,remind} ... gcalcli: error: argument command: invalid choice: '[gcalcli]' (choose from 'list', 'search', 'edit', 'delete', 'agenda', 'calw', 'calm', 'quick', 'add', 'import', 'remind ')

Thank

jcrowgey commented 4 years ago

I'm not sure what version of gcalcli you're on. Copy-pasting that exact line you posted works fine for me (to list my calendars). Now, I already have a .gcalcli_oath token present so it may be that you're experiencing some bug which regards interaction with the auth system. In any case, we still need more details. I'll reopen this as needs-repro to see if anyone else can corroborate or help.

Scoob79 commented 4 years ago

Version linux : Linux CHARON 5.0.0-36-generic #39-Ubuntu SMP Tue Nov 12 09:46:06 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Installation log : `Warning: No long description generated. /home/hades/.local/lib/python2.7/site-packages/setuptools/dist.py:475: UserWarning: Normalizing 'v4.2.0' to '4.2.0' normalized_version, running install running bdist_egg running egg_info writing requirements to gcalcli.egg-info/requires.txt writing gcalcli.egg-info/PKG-INFO writing top-level names to gcalcli.egg-info/top_level.txt writing dependency_links to gcalcli.egg-info/dependency_links.txt writing entry points to gcalcli.egg-info/entry_points.txt reading manifest file 'gcalcli.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' writing manifest file 'gcalcli.egg-info/SOURCES.txt' installing library code to build/bdist.linux-x86_64/egg running install_lib running build_py creating build/bdist.linux-x86_64/egg creating build/bdist.linux-x86_64/egg/gcalcli copying build/lib.linux-x86_64-2.7/gcalcli/printer.py -> build/bdist.linux-x86_64/egg/gcalcli copying build/lib.linux-x86_64-2.7/gcalcli/validators.py -> build/bdist.linux-x86_64/egg/gcalcli copying build/lib.linux-x86_64-2.7/gcalcli/init.py -> build/bdist.linux-x86_64/egg/gcalcli copying build/lib.linux-x86_64-2.7/gcalcli/gcal.py -> build/bdist.linux-x86_64/egg/gcalcli copying build/lib.linux-x86_64-2.7/gcalcli/cli.py -> build/bdist.linux-x86_64/egg/gcalcli copying build/lib.linux-x86_64-2.7/gcalcli/exceptions.py -> build/bdist.linux-x86_64/egg/gcalcli copying build/lib.linux-x86_64-2.7/gcalcli/argparsers.py -> build/bdist.linux-x86_64/egg/gcalcli copying build/lib.linux-x86_64-2.7/gcalcli/utils.py -> build/bdist.linux-x86_64/egg/gcalcli copying build/lib.linux-x86_64-2.7/gcalcli/deprecations.py -> build/bdist.linux-x86_64/egg/gcalcli byte-compiling build/bdist.linux-x86_64/egg/gcalcli/printer.py to printer.pyc byte-compiling build/bdist.linux-x86_64/egg/gcalcli/validators.py to validators.pyc byte-compiling build/bdist.linux-x86_64/egg/gcalcli/init.py to init.pyc byte-compiling build/bdist.linux-x86_64/egg/gcalcli/gcal.py to gcal.pyc byte-compiling build/bdist.linux-x86_64/egg/gcalcli/cli.py to cli.pyc byte-compiling build/bdist.linux-x86_64/egg/gcalcli/exceptions.py to exceptions.pyc byte-compiling build/bdist.linux-x86_64/egg/gcalcli/argparsers.py to argparsers.pyc byte-compiling build/bdist.linux-x86_64/egg/gcalcli/utils.py to utils.pyc byte-compiling build/bdist.linux-x86_64/egg/gcalcli/deprecations.py to deprecations.pyc installing package data to build/bdist.linux-x86_64/egg running install_data creating build/bdist.linux-x86_64/egg/share creating build/bdist.linux-x86_64/egg/share/man creating build/bdist.linux-x86_64/egg/share/man/man1 copying docs/man1/gcalcli.1 -> build/bdist.linux-x86_64/egg/share/man/man1 creating build/bdist.linux-x86_64/egg/EGG-INFO copying gcalcli.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO copying gcalcli.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying gcalcli.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying gcalcli.egg-info/entry_points.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying gcalcli.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying gcalcli.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO zip_safe flag not set; analyzing archive contents... creating 'dist/gcalcli-4.2.0-py2.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it removing 'build/bdist.linux-x86_64/egg' (and everything under it) Processing gcalcli-4.2.0-py2.7.egg Removing /usr/local/lib/python2.7/dist-packages/gcalcli-4.2.0-py2.7.egg Copying gcalcli-4.2.0-py2.7.egg to /usr/local/lib/python2.7/dist-packages gcalcli 4.2.0 is already the active version in easy-install.pth Installing gcalcli script to /usr/local/bin

Installed /usr/local/lib/python2.7/dist-packages/gcalcli-4.2.0-py2.7.egg Processing dependencies for gcalcli==4.2.0 Searching for parsedatetime Reading https://pypi.org/simple/parsedatetime/ Downloading https://files.pythonhosted.org/packages/4e/26/7612745a21452f6d822c0868ff7168dd8cf592645b2a553a177e1de43901/parsedatetime-2.5-py2-none-any.whl#sha256=3b835fc54 e472c17ef447be37458b400e3fefdf14bb1ffdedb5d2c853acf4ba1 Best match: parsedatetime 2.5 Processing parsedatetime-2.5-py2-none-any.whl Installing parsedatetime-2.5-py2-none-any.whl to /usr/local/lib/python2.7/dist-packages Adding parsedatetime 2.5 to easy-install.pth file

Installed /usr/local/lib/python2.7/dist-packages/parsedatetime-2.5-py2.7.egg Searching for six==1.13.0 Best match: six 1.13.0 Processing six-1.13.0-py2.7.egg six 1.13.0 is already the active version in easy-install.pth

Using /usr/local/lib/python2.7/dist-packages/six-1.13.0-py2.7.egg Searching for oauth2client==4.1.3 Best match: oauth2client 4.1.3 Processing oauth2client-4.1.3-py2.7.egg oauth2client 4.1.3 is already the active version in easy-install.pth

Using /usr/local/lib/python2.7/dist-packages/oauth2client-4.1.3-py2.7.egg Searching for httplib2==0.14.0 Best match: httplib2 0.14.0 Processing httplib2-0.14.0-py2.7.egg httplib2 0.14.0 is already the active version in easy-install.pth

Using /usr/local/lib/python2.7/dist-packages/httplib2-0.14.0-py2.7.egg Searching for google-api-python-client==1.7.11 Best match: google-api-python-client 1.7.11 Processing google_api_python_client-1.7.11-py2.7.egg google-api-python-client 1.7.11 is already the active version in easy-install.pth

Using /usr/local/lib/python2.7/dist-packages/google_api_python_client-1.7.11-py2.7.egg Searching for python-dateutil==2.8.1 Best match: python-dateutil 2.8.1 Processing python_dateutil-2.8.1-py2.7.egg python-dateutil 2.8.1 is already the active version in easy-install.pth

Using /usr/local/lib/python2.7/dist-packages/python_dateutil-2.8.1-py2.7.egg Searching for rsa==4.0 Best match: rsa 4.0 Processing rsa-4.0-py2.7.egg rsa 4.0 is already the active version in easy-install.pth Installing pyrsa-encrypt script to /usr/local/bin Installing pyrsa-verify script to /usr/local/bin Installing pyrsa-sign script to /usr/local/bin Installing pyrsa-priv2pub script to /usr/local/bin Installing pyrsa-decrypt script to /usr/local/bin Installing pyrsa-keygen script to /usr/local/bin

Using /usr/local/lib/python2.7/dist-packages/rsa-4.0-py2.7.egg Searching for pyasn1==0.4.7 Best match: pyasn1 0.4.7 Processing pyasn1-0.4.7-py2.7.egg pyasn1 0.4.7 is already the active version in easy-install.pth

Using /usr/local/lib/python2.7/dist-packages/pyasn1-0.4.7-py2.7.egg Searching for pyasn1-modules==0.2.7 Best match: pyasn1-modules 0.2.7 Processing pyasn1_modules-0.2.7-py2.7.egg pyasn1-modules 0.2.7 is already the active version in easy-install.pth

Using /usr/local/lib/python2.7/dist-packages/pyasn1_modules-0.2.7-py2.7.egg Searching for uritemplate==3.0.0 Best match: uritemplate 3.0.0 Processing uritemplate-3.0.0-py2.7.egg uritemplate 3.0.0 is already the active version in easy-install.pth

Using /usr/local/lib/python2.7/dist-packages/uritemplate-3.0.0-py2.7.egg Searching for google-auth-httplib2==0.0.3 Best match: google-auth-httplib2 0.0.3 Processing google_auth_httplib2-0.0.3-py2.7.egg google-auth-httplib2 0.0.3 is already the active version in easy-install.pth

Using /usr/local/lib/python2.7/dist-packages/google_auth_httplib2-0.0.3-py2.7.egg Searching for google-auth==1.7.1 Best match: google-auth 1.7.1 Processing google_auth-1.7.1-py2.7.egg google-auth 1.7.1 is already the active version in easy-install.pth

Using /usr/local/lib/python2.7/dist-packages/google_auth-1.7.1-py2.7.egg Searching for setuptools==41.6.0 Best match: setuptools 41.6.0 setuptools 41.6.0 is already the active version in easy-install.pth Installing easy_install script to /usr/local/bin Installing easy_install-3.6 script to /usr/local/bin

Using /home/hades/.local/lib/python2.7/site-packages Searching for cachetools==3.1.1 Best match: cachetools 3.1.1 Processing cachetools-3.1.1-py2.7.egg cachetools 3.1.1 is already the active version in easy-install.pth

Using /usr/local/lib/python2.7/dist-packages/cachetools-3.1.1-py2.7.egg Finished processing dependencies for gcalcli==4.2.0`

jcrowgey commented 4 years ago

It looks like you're installing on python2.7, which is no longer supported. We probably need to update our docs and scripts to make that more clear.

Scoob79 commented 4 years ago

Hello,

While python3 is well installed by cons it appears that it is the versio 2 which prevails. I test by removing the V2 and I'll let you know.

cordially

Scoob79 commented 4 years ago

Here is the result :

/usr/bin/python3 gcalcli /usr/bin/python3: can not find 'main' module in 'gcalcli'

jcrowgey commented 4 years ago

You need to pip uninstall then pip3 install gcalcli (or pip install in an environment where python3 is the default python.

Scoob79 commented 4 years ago

Hello,

so I created an exclusive Python3 environment and then I ran gcalcli and here is the result :

(gcalcli) root@*****:/home/hades/gcalcli/bin/venv# gcalcli
Traceback (most recent call last):
  File "/usr/local/bin/gcalcli", line 6, in <module>
    from pkg_resources import load_entry_point
ModuleNotFoundError: No module named 'pkg_resources'
(gcalcli) root@*****:/home/hades/gcalcli/bin/venv# python -V
Python 3.7.3
jcrowgey commented 4 years ago

Your environment seems funny. This is installing via pip? Seems like you don't have setuptools in your venv or somesuch.

jpcaldwell30 commented 2 years ago

Revisiting this in case someone else runs into this issue. I was able to resolve it by changing my command order. I originally typed the command in the order: gcalcli --client-id=xxxxxxxxxxxxxxx.apps.googleusercontent.com --client-secret=xxxxxxxxxxxxxxxxx --noauth_local_webserver which gave the above error. When I changed the order to be gcalcli --client-id=xxxxxxxxxxxxxxx.apps.googleusercontent.com --client-secret=xxxxxxxxxxxxxxxxx --noauth_local_webserver then I was able to get it to work without issue. Notice the change is the location of

robbat2 commented 1 year ago

@jpcaldwell30 seems like part of your response was missing?

FloKTC commented 11 months ago

same problem here under linux mint , but it seems to work fine on Ubuntu maybe my bad ? idk

FloKTC commented 11 months ago

gcalcli: error: argument command: invalid choice: '[calcli]' (choose from 'list', 'search', 'edit', 'delete', 'agenda', 'updates', 'conflicts', 'calw', 'calm', 'quick', 'add', 'import', 'remind')

scainimatteo commented 10 months ago

I had the same error, but i fixed it appending a list commmand after the client id and secret (like specified in the installation guide from the README.md). This is the command:

gcalcli --client-id=xxxxxxxxxxxxxxx.apps.googleusercontent.com --client-secret=xxxxxxxxxxxxxxxxx list
dbarnett commented 3 weeks ago

Can anyone here still repro and if so want to help me troubleshoot further?

dbarnett commented 1 day ago

At this point I think a fresh report would be helpful, if anyone is still seeing issues and can clarify exactly what they're seeing. I'm going to close this as not reproducible, but for reference here are a few hypotheses: