Runing the sample code for google assistant sdk giving SyntaxErorr: invalid syntax - raspberry-pi

I'm trying to run the following code for starting my google assistant with the raspbery pi:
googlesamples-assistant-pushtotalk --project-id my-dev-project --device-model-id my-model
But I get the following error:
Traceback (most recent call last):
File "/home/pi/env/bin/googlesamples-assistant-pushtotalk", line 5, in <module>
from googlesamples.assistant.grpc.pushtotalk import main
File "/home/pi/env/lib/python3.9/site-packages/googlesamples/assistant/grpc/pushtotalk.py", line 29, in <module>
from tenacity import retry, stop_after_attempt, retry_if_exception
File "/home/pi/env/lib/python3.9/site-packages/tenacity/__init__.py", line 292
from tenacity.async import AsyncRetrying
^
SyntaxError: invalid syntax

Just use:
pip install -U tenacity
Solve for me...

Related

SyntaxError: invalid syntax EngineerIO.py", line 133 running simulation on IBM Cloud

Works locally on mac. Gives syntax error below running on IBM Cloud using:
python-3.5.6
Requirements.txt
Flask==0.10.1
requests==2.12.4
flask-restful-swagger==0.19
flask-restplus==0.9.2
watson-developer-cloud>=1.3.5
python-dotenv==0.8.2
cloudant==2.12.0
UliEngineering==0.3.3
scipy>=0.5
toolz==0.10.0
numpy>=1.5
Error
Traceback (most recent call last): File "skill.py", line 16, in <module> from UliEngineering.SignalProcessing.Simulation import sine_wave File "/home/vcap/deps/0/python/lib/python3.5/site-packages/UliEngineering/SignalProcessing/Simulation.py", line 8, in <module> from UliEngineering.EngineerIO import normalize_numeric File "/home/vcap/deps/0/python/lib/python3.5/site-packages/UliEngineering/EngineerIO.py", line 133 self.unit_prefix_re = re.compile(f'({__unitprefix_set})+$') # $: Matched at end of numeric part ^ SyntaxError: invalid syntax
Any ideas how I might be able to fix this?

Running canopy-script.pyw gives traceback "No module named canopy.app.bootstrap"

I am trying to follow instruction from Enthought support website To test of what I have done i run line:
_python.exe canopy-script.pyw -d
Unfortunately this gives Traceback:
Traceback (most recent call last):
File "canopy-script.pyw", line 776, in <module>
File "canopy-script.pyw", line 336, in bootstrap
File "canopy-script.pyw", line 363, in chainload
File "canopy-script.pyw", line 762, in _chainload
File "C:\Users\User\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.7.4.3348.win-x86_64\Canopy-script.pyw", line 7, in <module>
from canopy.app.bootstrap import main
ImportError: No module named canopy.app.bootstrap
After "Search" I can see many of bootstrap.py files on the disc.
What would be the solution for this problem?
The current version of Canopy is 2.1.9. (You are running v 1.7.4).
To update Canopy, and for a link to release notes, please see "Installing a new Canopy version".
After you update, see:
https://support.enthought.com/hc/en-us/articles/360021798791--UnresolvableRequirements-or-Conflicting-requirements-when-installing-or-updating-packages

Aws Cloudwatch Logs agent throws an error

I'm setting up awslogs agent on ec2 instance, When i run the python script of awslogs. I'm getting below message.
Downloading the latest CloudWatch Logs agent bits ... ERROR: Failed to create virtualenv. Try manually installing with pip and adding it to the sudo user's PATH before running this script.
And awslogs-agent-setup.log show below error.
Environment: CentOS 6.10 and Python 2.6
Traceback (most recent call last):
File "/usr/bin/pip", line 7, in <module>
from pip._internal import main
File "/usr/lib/python2.6/site-packages/pip-19.0.3-py2.6.egg/pip/_internal/__init__.py", line 19, in <module>
from pip._vendor.urllib3.exceptions import DependencyWarning
File "/usr/lib/python2.6/site-packages/pip-19.0.3-py2.6.egg/pip/_vendor/urllib3/__init__.py", line 8, in <module>
from .connectionpool import (
File "/usr/lib/python2.6/site-packages/pip-19.0.3-py2.6.egg/pip/_vendor/urllib3/connectionpool.py", line 92
_blocking_errnos = {errno.EAGAIN, errno.EWOULDBLOCK}
^
SyntaxError: invalid syntax
/usr/bin/virtualenv
Traceback (most recent call last):
File "/usr/bin/virtualenv", line 7, in <module>
from virtualenv import main
File "/usr/lib/python2.6/site-packages/virtualenv.py", line 51, in <module>
print("ERROR: {}".format(sys.exc_info()[1]))
ValueError: zero length field name in format
Basically, this error is due to your python version 2.6. Could you please update your python version from 2.6 to 2.7 or 3.1.
This should help.

Google Cloud SDK installation - gsutil error

I have installed Google Cloud SDK but having an issue running "gsutil". Here are the error I'm getting:
~/gcloud/google-cloud-sdk#> gsutil
Traceback (most recent call last):
File "/Users/gonyi/Desktop/gonyyi/gcloud/google-cloud-sdk/bin/bootstrapping/gsutil.py", line 13, in <module>
import bootstrapping
File "/Users/gonyi/Desktop/gonyyi/gcloud/google-cloud-sdk/bin/bootstrapping/bootstrapping.py", line 40, in <module>
from googlecloudsdk.core import execution_utils
File "/Users/gonyi/Desktop/gonyyi/gcloud/google-cloud-sdk/lib/googlecloudsdk/core/execution_utils.py", line 33, in <module>
from googlecloudsdk.core import log
File "/Users/gonyi/Desktop/gonyyi/gcloud/google-cloud-sdk/lib/googlecloudsdk/core/log.py", line 810, in <module>
_log_manager = _LogManager()
File "/Users/gonyi/Desktop/gonyyi/gcloud/google-cloud-sdk/lib/googlecloudsdk/core/log.py", line 526, in __init__
self._file_formatter = _LogFileFormatter()
File "/Users/gonyi/Desktop/gonyyi/gcloud/google-cloud-sdk/lib/googlecloudsdk/core/log.py", line 315, in __init__
super(_LogFileFormatter, self).__init__(fmt=_LogFileFormatter.FORMAT)
TypeError: must be type, not classobj
~/gcloud/google-cloud-sdk#>
I have Python 2.7 installed, also tried to install this with "brew cask" as well as download it directly from Google Cloud site and install, but no luck either.
I googled this error but it seems like I'm the only one with this error..
"gcloud" command works just fine; but it's just "gsutil" that's not working.
Thank you

Error while installing Flutter in Linux

I set the path variable and echo the path and it give me expected output
uttu#Lore-UK:~/flutter$ export PATH=`pwd`/flutter/bin:$PATH
uttu#Lore-UK:~/flutter$ echo $PATH
/home/uttu/flutter/flutter/bin:/home/uttu/home/flutter/bin:/home/uttu/flutter/flutter/bin:/home/uttu/home/flutter/bin:/home/uttu/.local/share/umake/bin:/home/uttu/bin:/home/uttu/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
but when I ran flutter doctor it show
$ flutter doctor
Traceback (most recent call last):
File "/usr/lib/python3.5/dbm/gnu.py", line 4, in <module>
from _gdbm import *
ImportError: No module named '_gdbm'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 7, in <module>
import dbm.gnu as gdbm
File "/usr/lib/python3.5/dbm/gnu.py", line 6, in <module>
raise ImportError(str(msg) + ', please install the python3-gdbm package')
ImportError: No module named '_gdbm', please install the python3-gdbm package
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/command-not-found", line 27, in <module>
from CommandNotFound.util import crash_guard
File "/usr/lib/python3/dist-packages/CommandNotFound/__init__.py", line 3, in <module>
from CommandNotFound.CommandNotFound import CommandNotFound
File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 9, in <module>
import gdbm
ImportError: No module named 'gdbm'
I am not able to understand why I am getting this error and how to solve it
Thank you in advance
As you can see in your error message you are missing the module 'gdbm' as it says here:
please install the python3-gdbm package
Try installing this module and running flutter doctor again.
Other people have had the same problem Here