runtime error while using Pvporcupine sdk for Picovoice python - python

I m using pvporcupine python SDK for picovoice for hot word detection, while using the below code I'm getting runtime error
import pvporcupine
access_key = "[my_acces_key]" # AccessKey obtained from Picovoice Console (https://picovoice.ai/console/)
#access key is altered for security reason
handle = pvporcupine.create(access_key=access_key, keywords=['porcupine'])
here is the error stack trace
Traceback (most recent call last):
File "c:/Users/Pjan/saa2/actions/pic_again.py", line 5, in <module>
handle = pvporcupine.create(access_key=access_key, keywords=['porcupine'])
File "C:\Users\Pjan\.conda\envs\sam_env\lib\site-packages\pvporcupine\__init__.py", line 82, in create
sensitivities=sensitivities)
File "C:\Users\Pjan\.conda\envs\sam_env\lib\site-packages\pvporcupine\porcupine.py", line 158, in __init__
raise self._PICOVOICE_STATUS_TO_EXCEPTION[status]()
pvporcupine.porcupine.PorcupineRuntimeError
here is the official site for picovoice SDK for python
any help is highly appreciated!

Well I contacted the official repository of picovoice and here I mentioned them what clearly was going on.
So anyone still facing it , then here is the solution for such behaviour https://github.com/Picovoice/porcupine/issues/617
Thanks!

Related

KeyError: AIRTABLE_API_KEY

Having some issues getting a web app up and running. You can see this project running live online at yx8dxjwh.apps.lair.io but as soon as I imported it into pyCharm I am presented with a key error for the api. Please see below:
python manage.py runserver
Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x04678078>
Traceback (most recent call last):
File "C:\Program Files (x86)\Python36-32\lib\site-packages\airtable\auth.py", line 37, in __init__
self.api_key = api_key or os.environ['AIRTABLE_API_KEY']
File "C:\Program Files (x86)\Python36-32\lib\os.py", line 669, in __getitem__
raise KeyError(key) from None
KeyError: 'AIRTABLE_API_KEY'
There is a mass of other errors too but I feel like this is the main one and could potentially solve the rest of them.
Any help would be appreciated.
You don't have the environment variable set for AIRTABLE_API_KEY. The SDK you are using leverages that environment variable by default. You can read more at: https://airtable-python-wrapper.readthedocs.io/en/master/authentication.html
And then this link can help you find your Airtable API Key if you don't have it: https://support.airtable.com/hc/en-us/articles/219046777-How-do-I-get-my-API-key-

ReadTheDocs will not autogenerate API documentation for a project that uses Matplotlib

I am able to use Sphinx to auto generate my project's API documentation locally, but I run into trouble when I try to use ReadTheDocs. When ReadTheDocs builds the documentation, the API pages are all blank (see this, for example). After I read this blog entry, I realized the solution is to mock things like numpy and matplotlib. So I added the following line to my conf.py
autodoc_mock_imports = ['numpy', 'matplotlib', 'matplotlib.pyplot', 'matplotlib.patches', 'matplotlib.path', 'matplotlib.lines', 'matplotlib.text', 'matplotlib.transforms', 'matplotlib.artist', 'cpickle']
With that addition, I cannot build the API documentation locally or on ReadTheDocs, because of the following two Sphinx issues.
Issue #1:
When I build the documentation I get the following error.
/Users/Ben/Documents/Python/clearplot/doc/source/api/clearplot.rst:19: WARNING: autodoc: failed to import module u'clearplot'; the following exception was raised:
Traceback (most recent call last):
File "/Users/Ben/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/sphinx/ext/autodoc.py", line 385, in import_object
__import__(self.modname)
File "/Users/Ben/Documents/Python/clearplot/clearplot/__init__.py", line 33, in <module>
mpl_version = _parse_version_string(_mpl.__version__)
File "/Users/Ben/Documents/Python/clearplot/clearplot/__init__.py", line 19, in _parse_version_string
v_list = v.split(".")
AttributeError: type object '__version__' has no attribute 'split'
I have confirmed that this error comes from simply doing matplotlib.__version__.split("."). I couldn't figure out how to solve this issue quickly so I commented it out.
Issue #2:
Now, I get the following error when I build the documentation.
/Users/Ben/Documents/Python/clearplot/doc/source/api/clearplot.rst:19: WARNING: autodoc: failed to import module u'clearplot'; the following exception was raised:
Traceback (most recent call last):
File "/Users/Ben/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/sphinx/ext/autodoc.py", line 385, in import_object
__import__(self.modname)
File "/Users/Ben/Documents/Python/clearplot/clearplot/__init__.py", line 45, in <module>
import params
File "/Users/Ben/Documents/Python/clearplot/clearplot/params.py", line 19, in <module>
_mpl.rcParams['backend'] = 'Qt4Agg'
TypeError: '_MockModule' object does not support item assignment
If I comment out the offending line (_mpl.rcParams['backend'] = 'Qt4Agg'), I get the same error for the next line because my params module is full of assignments to the matplotlib.rcParams dictionary.
Both of these issues look like a pain to fix. Is there a better way? If not, how should I solve Issue #1 and #2?
From reading this it looks like there is a work around for using dictionaries with mock. Should I search for a similar solution for using something as basic as the string that comes from matplotlib.__version__?
In case it helps, the code on github is here.

I am trying to create a container within azure using the python sdk getting error

I am trying to create a container within azure using the python sdk
when doing a test from the command interpreter, I ran the commands below and getting the following error:
>>> from azure.storage import BlobService
>>> blob_service = BlobService(account_name='kevtest', account_key='HFohNOxxxxxxxxxJzXao3NeSPOvozRvNFIQSVqO5yOT5+Aastl3sdcJKg+pKBk+oewM7Y6OuLDPbj7qq+7OQ==')
>>> blob_service.create_container('images')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/azure/storage/blobservice.py", line 190, in create_container
_dont_fail_on_exist(ex)
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/azure/__init__.py", line 818, in _dont_fail_on_exist
raise error
azure.WindowsAzureError
>>>
That's likely an issue with your account name/key, but without the error message, I can't say for sure. You've censored your account key for this post, and so of course I can reproduce an authentication error.
Unfortunately the console can't display the full error message, but if you run it in an IDE or console that can display unicode strings without converting to ascii, you should be able to see the error message and confirm whether or not it's a problem with your account name/key.

GSPREAD on Pi : SyntaxError: expected path separator ([)

I am experiencing a problem with accessing a google drive spreadsheet from my pi with gspread. Using the following code - I have moved the the python IDLE to try and resolve the issue.
>>> import gspread
>>> gc = gspread.login('username', 'password')
>>> spreadsheet=gc.open('Spreadsheet')
>>> Log_sheet = spreadsheet.worksheet("Sheet1")
>>> Log_sheet.acell('B1').value
'Value # B1'`
I have tried using the same code in the command line from my computer (checked versions) and it works fine with the result above. I have updated the version on my pi
The error happens on the pi after the line >>>Log_sheet = spreadsheet.worksheet("Sheet1")
so I have logged in and access the google spreadsheet - its accessing the worksheet - it does exist and I can access from my computer. I have also posted a request for help on the Raspberry Pi site.
Can anyone help? Here is the error output.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.1/dist-packages/gspread/models.py", line 123, in worksheet
self._fetch_sheets()
File "/usr/local/lib/python3.1/dist-packages/gspread/models.py", line 62, in _fetch_sheets
self._sheet_list.append(Worksheet(self, elem))
File "/usr/local/lib/python3.1/dist-packages/gspread/models.py", line 168, in __init__
self.version = element.find(_ns("link[#rel='edit']")).attrib['href'].split('/')[-1]
File "/usr/lib/python3.1/xml/etree/ElementTree.py", line 305, in find
return ElementPath.find(self, path)
File "/usr/lib/python3.1/xml/etree/ElementPath.py", line 186, in find
return _compile(path).find(element)
File "/usr/lib/python3.1/xml/etree/ElementPath.py", line 176, in _compile
p = Path(path)
File "/usr/lib/python3.1/xml/etree/ElementPath.py", line 93, in __init__
"expected path separator (%s)" % (op or tag)
SyntaxError: expected path separator ([)
I have also tried reinstalling elementtree, as I saw this could be a possibility on my search for an answer, I have also tried python 3.1 on the pi, still no joy.
please can anyone help? I think its something really easy but I am not seeing it
It is related to incompatible use of ElementTree API in gspread itself and it is fixed in 0.1.0.

Accessing the Atlassian Crowd SOAP API with Suds (python SOAP library)

Has anybody had any recent success with accessing the Crowd SOAP API via the Suds Python library?
I've found a few people successfully doing it in the past but Atlassian seems to have changed their WSDL since then to make the existing advice not entirely helpful.
Below is the simplest example I've been trying:
from suds.client import Client
url = 'https://crowd.hugeinc.com/services/SecurityServer?wsdl'
client = Client(url)
Unfortunately that generates the following error:
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/Users/soconnor/.virtualenvs/hugeface/lib/python2.6/site-packages/suds/client.py", line 116, in __init__
sd = ServiceDefinition(self.wsdl, s)
File "/Users/soconnor/.virtualenvs/hugeface/lib/python2.6/site-packages/suds/servicedefinition.py", line 58, in __init__
self.paramtypes()
File "/Users/soconnor/.virtualenvs/hugeface/lib/python2.6/site-packages/suds/servicedefinition.py", line 137, in paramtypes
item = (pd[1], pd[1].resolve())
File "/Users/soconnor/.virtualenvs/hugeface/lib/python2.6/site-packages/suds/xsd/sxbasic.py", line 63, in resolve
raise TypeNotFound(qref)
TypeNotFound: Type not found: '(AuthenticatedToken, http://authentication.integration.crowd.atlassian.com, )'
I've tried to both binding and doctors to fix this problem to no avail. Neither approach resulted in any change. Any further recommendations or suggestions would be incredibly helpful.
There is a patch for the Crowd WSDL here:
http://jira.atlassian.com/browse/CWD-159

Categories