Réussir à installer "gcalcli" sur Raspberry

Forum dédié aux questions concernant la configuration de votre serveur sous Linux
ricorico94
Messages : 57
Inscription : 01 nov. 2015, 18:29

Re: Réussir à installer "gcalcli" sur Raspberry

Message par ricorico94 »

Bonjour,

J'avais réinstallé mon domoticz en août (et ça avait marché avec quelques ajustements, car j'avais dû rajouter des étapes: sudo pip install pyasn1 --upgrade puis pip install cachetools ) et j'ai dû le refaire aujourd'hui suite à un plantage (coupure électrique...). Sauf qu'en suivant le même process qu'en août, je n'arrive pas à réinstaller GCALCLI. J'ai vu d'ailleurs que GCALCLI a eu une msie à jourd ébut eptembre (passage de 4.1.1 à .2). J'ai une erreur similaire au post plus haut ("ImportError: cannot import name get_terminal_size"), mais même en suivant les conseils de Neutrino, je conserve le même problème..
Voici ce que j'ai fait (je découpe le code en blocs pour aider à la lecture des étapes):

Code : Tout sélectionner

pi@raspberrypi:~/gcalcli $ sudo python setup.py install
Warning: No long description generated.
/usr/local/lib/python2.7/dist-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-armv7l/egg
running install_lib
running build_py
creating build/bdist.linux-armv7l/egg
creating build/bdist.linux-armv7l/egg/gcalcli
copying build/lib.linux-armv7l-2.7/gcalcli/validators.py -> build/bdist.linux-armv7l/egg/gcalcli
copying build/lib.linux-armv7l-2.7/gcalcli/__init__.py -> build/bdist.linux-armv7l/egg/gcalcli
copying build/lib.linux-armv7l-2.7/gcalcli/cli.py -> build/bdist.linux-armv7l/egg/gcalcli
copying build/lib.linux-armv7l-2.7/gcalcli/gcal.py -> build/bdist.linux-armv7l/egg/gcalcli
copying build/lib.linux-armv7l-2.7/gcalcli/deprecations.py -> build/bdist.linux-armv7l/egg/gcalcli
copying build/lib.linux-armv7l-2.7/gcalcli/argparsers.py -> build/bdist.linux-armv7l/egg/gcalcli
copying build/lib.linux-armv7l-2.7/gcalcli/exceptions.py -> build/bdist.linux-armv7l/egg/gcalcli
copying build/lib.linux-armv7l-2.7/gcalcli/utils.py -> build/bdist.linux-armv7l/egg/gcalcli
copying build/lib.linux-armv7l-2.7/gcalcli/printer.py -> build/bdist.linux-armv7l/egg/gcalcli
byte-compiling build/bdist.linux-armv7l/egg/gcalcli/validators.py to validators.pyc
byte-compiling build/bdist.linux-armv7l/egg/gcalcli/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-armv7l/egg/gcalcli/cli.py to cli.pyc
byte-compiling build/bdist.linux-armv7l/egg/gcalcli/gcal.py to gcal.pyc
byte-compiling build/bdist.linux-armv7l/egg/gcalcli/deprecations.py to deprecations.pyc
byte-compiling build/bdist.linux-armv7l/egg/gcalcli/argparsers.py to argparsers.pyc
byte-compiling build/bdist.linux-armv7l/egg/gcalcli/exceptions.py to exceptions.pyc
byte-compiling build/bdist.linux-armv7l/egg/gcalcli/utils.py to utils.pyc
byte-compiling build/bdist.linux-armv7l/egg/gcalcli/printer.py to printer.pyc
installing package data to build/bdist.linux-armv7l/egg
running install_data
creating build/bdist.linux-armv7l/egg/share
creating build/bdist.linux-armv7l/egg/share/man
creating build/bdist.linux-armv7l/egg/share/man/man1
copying docs/man1/gcalcli.1 -> build/bdist.linux-armv7l/egg/share/man/man1
creating build/bdist.linux-armv7l/egg/EGG-INFO
copying gcalcli.egg-info/PKG-INFO -> build/bdist.linux-armv7l/egg/EGG-INFO
copying gcalcli.egg-info/SOURCES.txt -> build/bdist.linux-armv7l/egg/EGG-INFO
copying gcalcli.egg-info/dependency_links.txt -> build/bdist.linux-armv7l/egg/EGG-INFO
copying gcalcli.egg-info/entry_points.txt -> build/bdist.linux-armv7l/egg/EGG-INFO
copying gcalcli.egg-info/requires.txt -> build/bdist.linux-armv7l/egg/EGG-INFO
copying gcalcli.egg-info/top_level.txt -> build/bdist.linux-armv7l/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-armv7l/egg' to it
removing 'build/bdist.linux-armv7l/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 six==1.12.0
Best match: six 1.12.0
Adding six 1.12.0 to easy-install.pth file

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

Using /usr/local/lib/python2.7/dist-packages/parsedatetime-2.4-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.9.2
Best match: httplib2 0.9.2
Adding httplib2 0.9.2 to easy-install.pth file

Using /usr/lib/python2.7/dist-packages
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.5.3
Best match: python-dateutil 2.5.3
Adding python-dateutil 2.5.3 to easy-install.pth file

Using /usr/lib/python2.7/dist-packages
Searching for future==0.18.1
Best match: future 0.18.1
Processing future-0.18.1-py2.7.egg
future 0.18.1 is already the active version in easy-install.pth
Installing pasteurize script to /usr/local/bin
Installing futurize script to /usr/local/bin

Using /usr/local/lib/python2.7/dist-packages/future-0.18.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
Adding pyasn1 0.4.7 to easy-install.pth file

Using /usr/local/lib/python2.7/dist-packages
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==1.6.3
Best match: google-auth 1.6.3
Processing google_auth-1.6.3-py2.7.egg
google-auth 1.6.3 is already the active version in easy-install.pth

Using /usr/local/lib/python2.7/dist-packages/google_auth-1.6.3-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 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
pi@raspberrypi:~/gcalcli $ gcalcli --noauth_local_webserver agenda
Traceback (most recent call last):
  File "/usr/local/bin/gcalcli", line 11, in <module>
    load_entry_point('gcalcli==4.2.0', 'console_scripts', 'gcalcli')()
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2852, in load_entry_point
    return ep.load()
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2443, in load
    return self.resolve()
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2449, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "build/bdist.linux-armv7l/egg/gcalcli/cli.py", line 30, in <module>
  File "build/bdist.linux-armv7l/egg/gcalcli/argparsers.py", line 8, in <module>
ImportError: cannot import name get_terminal_size

Code : Tout sélectionner

pi@raspberrypi:~/gcalcli $ sudo pip uninstall backports.shutil_get_terminal_sizeDEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
WARNING: Skipping backports.shutil-get-terminal-size as it is not installed.

Code : Tout sélectionner

pi@raspberrypi:~/gcalcli $ sudo pip install --upgrade backports.shutil_get_terminal_size
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting backports.shutil_get_terminal_size
  Downloading https://www.piwheels.org/simple/backports-shutil-get-terminal-size/backports.shutil_get_terminal_size-1.0.0-py2.py3-none-any.whl
Installing collected packages: backports.shutil-get-terminal-size
Successfully installed backports.shutil-get-terminal-size-1.0.0

Code : Tout sélectionner

pi@raspberrypi:~/gcalcli $ gcalcli --noauth_local_webserver agenda
Traceback (most recent call last):
  File "/usr/local/bin/gcalcli", line 11, in <module>
    load_entry_point('gcalcli==4.2.0', 'console_scripts', 'gcalcli')()
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2852, in load_entry_point
    return ep.load()
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2443, in load
    return self.resolve()
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2449, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "build/bdist.linux-armv7l/egg/gcalcli/cli.py", line 30, in <module>
  File "build/bdist.linux-armv7l/egg/gcalcli/argparsers.py", line 8, in <module>
ImportError: cannot import name get_terminal_size

Code : Tout sélectionner

pi@raspberrypi:~/gcalcli $ sudo pip install --upgrade setuptools pip
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already up-to-date: setuptools in /usr/local/lib/python2.7/dist-packages (41.4.0)
Requirement already up-to-date: pip in /usr/local/lib/python2.7/dist-packages (19.3.1)

Code : Tout sélectionner

pi@raspberrypi:~/gcalcli $ gcalcli --noauth_local_webserver agenda
Traceback (most recent call last):
  File "/usr/local/bin/gcalcli", line 11, in <module>
    load_entry_point('gcalcli==4.2.0', 'console_scripts', 'gcalcli')()
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2852, in load_entry_point
    return ep.load()
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2443, in load
    return self.resolve()
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2449, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "build/bdist.linux-armv7l/egg/gcalcli/cli.py", line 30, in <module>
  File "build/bdist.linux-armv7l/egg/gcalcli/argparsers.py", line 8, in <module>
ImportError: cannot import name get_terminal_size

Code : Tout sélectionner

pi@raspberrypi:~/gcalcli $ gcalcli --noauth_local_webserver
Traceback (most recent call last):
  File "/usr/local/bin/gcalcli", line 11, in <module>
    load_entry_point('gcalcli==4.2.0', 'console_scripts', 'gcalcli')()
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2852, in load_entry_point
    return ep.load()
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2443, in load
    return self.resolve()
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2449, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "build/bdist.linux-armv7l/egg/gcalcli/cli.py", line 30, in <module>
  File "build/bdist.linux-armv7l/egg/gcalcli/argparsers.py", line 8, in <module>
ImportError: cannot import name get_terminal_size
pi@raspberrypi:~/gcalcli $
Je précise que je suis parti d'une installation propre avec Stretch Lite, puis install de domoticz.

Là, maintenant je ne sais plus quoi faire. Je n'ai pas compris comment désinstaller ce 4.2 pour réinstaller la 4.1.1 (je ne suis pas assez bon en linux, malheureusement). J'avais trouvé une commande PIP pour installer la 4.1.1 et ça semblait s'installer, mais après que je lance le setup, je revois des 4.2 et le même message d'erreur persiste.. donc je ne dois pas vraiment désinstaller)
Sur ce sujet, j'ai vu dan sle premier post de ce fil des recommandations de nettoyage:
Dernière chose: si vous avez déjà installé gcalcli et que ça n'avait pas marché, effacer les traces de gcalcli (repertoire, fichiers de conf...). Profitez-en pour faire un petit nettoyage avant de vous lancer dans l'installation:

Code : Tout sélectionner

sudo apt-get autoclean
sudo apt-get clean
sudo apt-get autoremove
Est-ce qu'il faut enlever les répertoires et fichiers avant ces commandes ou après ? Et y-a-t-il autre chose que le répertoire gcalcli au même niveau que domoticz à enlever ?

Merci de votre aide,
Ricorico94
Neutrino
Messages : 2662
Inscription : 10 juil. 2015, 15:42
Localisation : Les Herbiers(85)

Re: Réussir à installer "gcalcli" sur Raspberry

Message par Neutrino »

Et sinon, pourquoi ne pas tout simplement faire

Code : Tout sélectionner

sudo apt install gcalcli
;)
Ma maison à plein d'IP ! :mrgreen:
SAV Bonjour. Vous avez vidé le cache ?
ErwaN_89
Messages : 12
Inscription : 19 oct. 2019, 17:56

Re: Réussir à installer "gcalcli" sur Raspberry

Message par ErwaN_89 »

Merci,

Après avoir installer gcalcli avec apt et lancer la commande

Code : Tout sélectionner

 sudo gcalcli list --noauth_local_webserver

J'obtiens ce message d'erreur :

Code : Tout sélectionner

Unknown command line flag 'noauth_local_webserver'
Donc je comprends vraiment pas :-(
Neutrino
Messages : 2662
Inscription : 10 juil. 2015, 15:42
Localisation : Les Herbiers(85)

Re: Réussir à installer "gcalcli" sur Raspberry

Message par Neutrino »

Essaye en replaçant list par agenda.
Sinon, désinstalle via pip et apt et réinstalle via apt seulement.
Ma maison à plein d'IP ! :mrgreen:
SAV Bonjour. Vous avez vidé le cache ?
ErwaN_89
Messages : 12
Inscription : 19 oct. 2019, 17:56

Re: Réussir à installer "gcalcli" sur Raspberry

Message par ErwaN_89 »

Déjà fait, sans succès.
ricorico94
Messages : 57
Inscription : 01 nov. 2015, 18:29

Re: Réussir à installer "gcalcli" sur Raspberry

Message par ricorico94 »

hello,
J'ai réussi à bidouiller pour faire tourner gcalcli. Je ne suis pas sûr que ma méthode soit très orthodoxe ni "propre", car je ne maîtrise pas linux.. mais voici ce que j'ai fait si ça peut aider quelqu'un:

sudo pip uninstall gcalcli
sudo rm -rf gcalcli (note: pour enlever le réeprtoire où gcalcli avait été installé par la commande git clone et le setup.py)
sudo pip install gcalcli==4.1.1
gcalcli --noauth_local_webserver agenda

et pour info, au cas où ça serve aussi.. parmi le scommandes que j'avais utilisé cette fois-ci ou la précédente fois où j'avais installé gcalcli, j'avais dû faire:
sudo apt-get install python-gflags python-dateutil python-httplib2
sudo apt-get install python-pip
et si en appelant gcalcli, il n'y a pas de lien mais un message de type « raise VersionConflict(dist, req).with_context(dependent_req) pkg_resources.ContextualVersionConflict: (pyasn1 0.1.9 (/usr/lib/python2.7/dist-packages), Requirement.parse('pyasn1<0.5.0,>=0.4.6'), set(['pyasn1-modules'])) » alors :
• lancer : sudo pip install pyasn1 --upgrade
• Puis relancer
• Si encore erreur à propos de cachetools, il faut lancer : pip install cachetools

voilà...
Ricorico94
Wolfen38
Messages : 1983
Inscription : 19 oct. 2017, 14:49

Re: Réussir à installer "gcalcli" sur Raspberry

Message par Wolfen38 »

L'install du lien avec l'agenda google m'intéresse on ne peut plus avec le planning tordu de ma femme.

Mais au final, je viens de lire les 3 pages, ca marche, ca marche pas... enfin du coup c'est pas très clair au fil des pages.

Quelqu'un aurait une procédure qui fonctionne du début à la fin ? Un résumé en somme.

Merci.
Neutrino
Messages : 2662
Inscription : 10 juil. 2015, 15:42
Localisation : Les Herbiers(85)

Re: Réussir à installer "gcalcli" sur Raspberry

Message par Neutrino »

Code : Tout sélectionner

sudo apt install gcalcli
Testé à l'instant sur une nouvelle installation.
A fonctionné directement. ;)
Ma maison à plein d'IP ! :mrgreen:
SAV Bonjour. Vous avez vidé le cache ?
Wolfen38
Messages : 1983
Inscription : 19 oct. 2017, 14:49

Re: Réussir à installer "gcalcli" sur Raspberry

Message par Wolfen38 »

Ca serait trop bien un truc si simple, j'essaie ce soir.
Merci.
sphinxou
Messages : 231
Inscription : 03 déc. 2016, 13:37

Re: Réussir à installer "gcalcli" sur Raspberry

Message par sphinxou »

bonjour

après passage à buster et dernière version stable de domoticz

en suivant le tuto j'ai cette erreur

Code : Tout sélectionner

pi@raspberrypi:~ $ sudo gcalcli agenda --noauth_local_webserver
Traceback (most recent call last):
  File "/usr/local/bin/gcalcli", line 11, in <module>
    load_entry_point('gcalcli==4.2.0', 'console_scripts', 'gcalcli')()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2793, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2411, in load
    return self.resolve()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2417, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "build/bdist.linux-armv7l/egg/gcalcli/cli.py", line 30, in <module>
  File "build/bdist.linux-armv7l/egg/gcalcli/argparsers.py", line 8, in <module>
ImportError: cannot import name get_terminal_size
Domoticz 4.9700/ rfxcom /sonde diy/raspberry pi3+HDD/cirusms/contact de porte diy
Répondre