I wrote a program that takes data and plots it via matplotlib. It works no problem on one computer but on the other I get the error:
TypeError: Couldn't find foreign struct converter for 'cairo.Context'
Traceback (most recent call last):
File "/usr/lib/python3.5/idlelib/run.py", line 125, in main
seq, request = rpc.request_queue.get(block=True, timeout=0.05)
File "/usr/lib/python3.5/queue.py", line 172, in get raise Empty queue.Empty
what can I do to get a cairo.Context converter?
Related
1) python newbie
2) tasked with getting a script together that would compile various stats from our brocade switches
trying to run this script
https://github.com/zapman449/brocade_switchshow_aliases
3) get it set up per the Readme. Config file is set up (I think) properly)
4) BUT - I get the following errors - and not sure why. Any help would be appreciated
[someguy#myserver SAN_Scripts]$ ./get-brocade.py fcr_fd_41
<function parse_switch_line at 0x1429578>
Switch Username: someguy
Switch password for user someguy:
Traceback (most recent call last):
File "./get-brocade.py", line 265, in <module>
main()
File "./get-brocade.py", line 261, in main
get_switchshow(conn, switch)
File "./get-brocade.py", line 198, in get_switchshow
if len(words) == 3 :
TypeError: object of type 'NoneType' has no len()
Exception in thread Thread-1 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
File "/usr/lib64/python2.6/threading.py", line 532, in __bootstrap_inner
File "/usr/lib/python2.6/site-packages/paramiko/transport.py", line 1609, in run
<type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'error'
[someguy#myserverSAN_Scripts]$
I am trying to set up the ChirpSDK, but every time I configure and run the code, I get this error:
Traceback (most recent call last):
File "test.py", line 3, in <module>
chirp = ChirpSDK()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/chirpsdk/chirpsdk.py", line 395, in __init__
self.read_chirprc(block)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/chirpsdk/chirpsdk.py", line 501, in read_chirprc
raise IOError('Could not find a ~/.chirprc file')
OSError: Could not find a ~/.chirprc file
Exception ignored in: <function ChirpSDK.__del__ at 0x10fa31af0>
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/chirpsdk/chirpsdk.py", line 422, in __del__
self.close()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/chirpsdk/chirpsdk.py", line 470, in close
if self._sdk:
AttributeError: 'ChirpSDK' object has no attribute '_sdk'
I realize that the error is saying that my .chirprc file is not being recognized, but I have no idea how to remedy this. I created a .chirprc file in my /Users/username/ path, and named it c.chirprc (as the Chirp getting started article suggests), but I am still getting this error. Is there another part that I am missing? Am I reading the instructions wrong?
Thanks
The Chirp configuration file should be placed at /Users/<username>/.chirprc on macOS.
If you run ls -l ~/.chirprc in the terminal, do you get any results? If it displays no such file or directory then you have not created the file correctly.
I am trying to write some code to perform some packet sniffing with python
using pyshark.I have the following piece of code:
import pyshark
print('Pyshark demo')
capture = pyshark.LiveCapture(interface='enp0s8')
However when I try to run this script I get the following stack trace:
Pyshark demo
Exception ignored in: <bound method BaseEventLoop.__del__ of <_UnixSelectorEventLoop running=False closed=True debug=False>>
Traceback (most recent call last):
File "/usr/lib/python3.5/asyncio/base_events.py", line 431, in __del__
File "/usr/lib/python3.5/asyncio/unix_events.py", line 58, in close
File "/usr/lib/python3.5/asyncio/unix_events.py", line 139, in remove_signal_handler
File "/usr/lib/python3.5/signal.py", line 47, in signal
TypeError: signal handler must be signal.SIG_IGN, signal.SIG_DFL, or a callable object
I have install pyshark.Do you have any idea what is causing this problem?
I run this on an ubuntu server 16.04
It is related to python issues:
https://bugs.python.org/issue26133
https://bugs.python.org/issue23548
https://bugs.python.org/issue28628?#ok_message=file%2045378%20created%0Amsg%20280182%20created%0Aissue%2028628%20created&#template=item
also see:
Trigger catkin build process from within python
I have read this and wanted to comment on one of the answers with another question. So i want to make a label clickable in Teamspeak 3 using my script for pyTson
python
07.11.2016 14:16:48 pyTSon.PluginHost.onMenuItemEvent Error Error calling onMenuItemEvent of python plugin Better Server Browser: Traceback (most recent call last):
File "C:/Users/blusc_000/AppData/Roaming/TS3Client/plugins/pyTSon/scripts\ts3plugin.py", line 337, in onMenuItemEvent
plugin.onMenuItemEvent(schid, atype, locid, selectedItemID)
File "C:/Users/blusc_000/AppData/Roaming/TS3Client/plugins/pyTSon/scripts\serverBrowser.py", line 62, in onMenuItemEvent
self.dlg = ServersDialog(self)
File "C:/Users/blusc_000/AppData/Roaming/TS3Client/plugins/pyTSon/scripts\serverBrowser.py", line 136, in __init__
self.setupList()
File "C:/Users/blusc_000/AppData/Roaming/TS3Client/plugins/pyTSon/scripts\serverBrowser.py", line 153, in setupList
self.pageLabel.mousePressEvent = self.on_pageLabel_clicked
AttributeError: Slot 'mousePressEvent' can not be overwritten on QLabel object
I'm trying to open a music track and add it to a queue for a player in Pyglet.
def QueueAudio(self):
self.musicpath=filedialog.askopenfilename()
print(self.musicpath)
Player.queue(pyglet.resource.media(r"self.musicpath"))
The musicpath variable works fine as the print statement prints the filename. The error comes when the player tries to queue the track. Error below.
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Python33\lib\site-packages\pyglet\resource.py", line 605, in media
location = self._index[name]
KeyError: 'self.musicpath'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Python33\lib\tkinter\__init__.py", line 1475, in __call__
return self.func(*args)
File "C:\Users\Rob\Google Drive\Coursework\Part 2\music player tests\test5.py", line 99, in QueueAudio
self.playerpath=pyglet.resource.media(r"self.musicpath")
File "C:\Python33\lib\site-packages\pyglet\resource.py", line 615, in media
raise ResourceNotFoundException(name)
pyglet.resource.ResourceNotFoundException: Resource "self.musicpath" was not found on the path. Ensure that the filename has the correct captialisation.
Does anyone know why this is, and what may fix it?
This line looks to be the culprit:
self.playerpath=pyglet.resource.media(r"self.musicpath")
You are passing a string "self.musicpath" to a function, when you should be passing in the contents of a variable named self.musicpath. You need to call it like this:
self.playerpath = pyglet.resource.media(self.musicpath)