Ghost.py - what does this stack trace mean? [closed] - python

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
How do I go about debugging this stack trace?
Traceback (most recent call last):
File "<string>", line 73, in execInThread
File "C:\Program Files (x86)\PyScripter\Lib\rpyc.zip\rpyc\core\netref.py", line 196, in __call__
File "C:\Program Files (x86)\PyScripter\Lib\rpyc.zip\rpyc\core\netref.py", line 71, in syncreq
File "C:\Program Files (x86)\PyScripter\Lib\rpyc.zip\rpyc\core\protocol.py", line 431, in sync_request
File "C:\Program Files (x86)\PyScripter\Lib\rpyc.zip\rpyc\core\protocol.py", line 379, in serve
File "C:\Program Files (x86)\PyScripter\Lib\rpyc.zip\rpyc\core\protocol.py", line 337, in _recv
File "C:\Program Files (x86)\PyScripter\Lib\rpyc.zip\rpyc\core\channel.py", line 50, in recv
File "C:\Program Files (x86)\PyScripter\Lib\rpyc.zip\rpyc\core\stream.py", line 166, in read
EOFError: [Errno 10054] An existing connection was forcibly closed by the remote host
The stack trace does not refer to a line in my code, which is too long to reproduce here. However, the key component other than the standard python library is Ghost.py.
Thanks!

This means the server closed the connection unexpectedly, usually because it crashed for some reason. In this case, it looks like the client is pyscripter and the server is a subprocess running your app, and it sounds like the subprocess crashed so hard that it did not gracefully close the connection or send back a meaningful traceback. So, either there is a bug in pyscripter or a bug in your code. My advice is to run your app without the IDE and see if you can reproduce the issue and get a meaningful traceback.

Related

Problem making python program into an exe

I have been working on a program that shows the weather using python and thought I would try setting it up as an exe for easy installation on other devices. However every time I put in a location to search for using the exe GUI, I get this in the terminal window that opens with the program window:
Exception in Tkinter callback
Traceback (most recent call last):
File "tkinter\__init__.py", line 1892, in __call__
File "getWeather.py", line 132, in <lambda>
File "getWeather.py", line 45, in open_weather
File "requests\api.py", line 75, in get
File "requests\api.py", line 61, in request
File "requests\sessions.py", line 529, in request
File "requests\sessions.py", line 645, in send
File "requests\adapters.py", line 417, in send
File "requests\adapters.py", line 228, in cert_verify
OSError: Could not find a suitable TLS CA certificate bundle, invalid path: C:\Users\pcusername\AppData\Local\Temp\_MEI118802\certifi\cacert.pem
I have been trying to figure out what the problem is, but haven't been able to find anything to get it working. If anyone can help figure this out I would appreciate it. Also, let me know if any more context/code is needed or if I did anything wrong regarding the post, as it is my first time having to post on stack overflow.
Note, this is using:
windows 11,
python 3.9,
pycharm 2021.2.2,
pyinstaller for exe creation
Ok ended up figuring it out:
This method does work: (The top answer) python requests can't find a folder with a certificate when converted to .exe
I was however missing the cacert.pem file still, which gave the error when I tried this fix initially. What ended up working is finding the cacert.pem in the mypycharmproject\venv\Lib\site-packages\certifi folder and then copying it to the dist folder where the exe is located.
Thank you for your help everyone!

Why does Dash throw a TypeError when debugging through PyCharm? [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 1 year ago.
Improve this question
When I try to run a Dash app from PyCharm in debug mode I keep getting the below TypeError. What can I do to fix this so that I can break on breakpoints in PyCharm?
I'm using: Dash 2.0.0, Python 3.9.6, PyCharm Community Edition 2021.1.3, Windows 10.
Connected to pydev debugger (build 212.4746.96)
Traceback (most recent call last):
File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 2021.1.3\plugins\python-ce\helpers\pydev\pydevd.py", line 1483, in _exec
pydev_imports.execfile(file, globals, locals) # execute the script
File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 2021.1.3\plugins\python-ce\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "C:/redacted/dashboard/dashboard.py", line 170, in <module>
_app = dash.Dash(__name__, external_stylesheets=[dbc.themes.DARKLY])
File "C:\redacted\.venv\lib\site-packages\dash\dash.py", line 304, in __init__
self.server = flask.Flask(name) if server else None
File "C:\redacted\.venv\lib\site-packages\flask\app.py", line 406, in __init__
instance_path = self.auto_find_instance_path()
File "C:\redacted\.venv\lib\site-packages\flask\app.py", line 638, in auto_find_instance_path
prefix, package_path = find_package(self.import_name)
File "C:\redacted\.venv\lib\site-packages\flask\scaffold.py", line 850, in find_package
package_path = _find_package_path(root_mod_name)
File "C:\redacted\.venv\lib\site-packages\flask\scaffold.py", line 801, in _find_package_path
return os.path.dirname(next(iter(spec.submodule_search_locations)))
TypeError: 'NoneType' object is not iterable
python-BaseException
Process finished with exit code 1
Here's how I've setup my PyCharm run configuration:
Likely a bug in PyCharm. Solved by upgrading PyCharm to 2021.2.3.

I am using fabric python library using that I create the 50 times ssh connection I need it but I get following error [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 3 years ago.
Improve this question
While using fabric library in python and forming ssh connection I am getting following error
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/paramiko/transport.py", line 1923, in run
<type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'error'
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
File "/usr/local/lib/python2.7/dist-packages/paramiko/transport.py", line 1923, in run
<type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'error'
solve the issue by using connections in fabric python library .store all the ip in cache by default then at end of script disconnect from all remote machine by using disconnect_all() method.

USB missile launcher on Linux

I came across a page on Hacking the Kinect. It was discussing how to interface with the system. The code I used is as follows.
The script comes from Lady ada in her post on hacking the connect.
I would love get this working. I am using python
This is a link to that code
http://learn.adafruit.com/hacking-the-kinect/fuzzing
The errors I get are as follow
sudo python UsbFuzzer.py
Traceback (most recent call last):
File "UsbFuzzer.py", line 14, in <module>
dev.set_configuration()
File "/usr/local/lib/python2.7/dist-packages/usb/core.py", line 554, in set_configuration
self._ctx.managed_set_configuration(self, configuration)
File "/usr/local/lib/python2.7/dist-packages/usb/core.py", line 92, in managed_set_configuration
self.backend.set_configuration(self.handle, cfg.bConfigurationValue)
File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb1.py", line 503, in set_configuration
_check(_lib.libusb_set_configuration(dev_handle, config_value))
File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb1.py", line 403, in _check
raise USBError(_str_error[ret], ret, _libusb_errno[ret])
usb.core.USBError: [Errno 16] Resource busy
The main problem here is that libusb is returning an error code, "Resource busy". This could be a permissions problem. Try running your program with sudo and see if that fixes it. This link looks promising, because it talks about how to set up a udev rule so you don't have to run as root:
pyusb: cannot set configuration
If that does not help, you could Google around for "libusb resource busy".

Audio/Video streaming fails using SimpleHTTPServer [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I share files in a folder to other devices by invoking a server using python -m SimpleHTTPServer.
I just tried to stream videos/audio (standard mp4 & mp3, both under 20MB) to another computer using this & it WORKS (but by throwing the errors (listed down) in the terminal).
Somehow, the video/audio fails (except very small mp3 files) to play with Safari in iPhone/iPad. It is definitely not related to the media files, as I streamed them successfully using Apache in iPhone.
Any idea why it happens?
Exception happened during processing of request from ('192.168.1.2', 51775)
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 284, in _handle_request_noblock
self.process_request(request, client_address)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 310, in process_request
self.finish_request(request, client_address)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 323, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 641, in __init__
self.finish()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 694, in finish
self.wfile.flush()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 303, in flush
self._sock.sendall(view[write_offset:write_offset+buffer_size])
error: [Errno 32] Broken pipe
As sugested either use python alternatives, What is a faster alternative to Python's http.server (or SimpleHTTPServer)? or use full blown web serwer altogether. Quick google suggests that Mac supports both Nignx and Apache2.

Categories