swift
swift copied to clipboard
Swift environment doesn't start on Windows 10
Hello everyone.
I've installed the package with pip install roboticstoolbox-python
and checked that all the dependencies have indeed been installed. Everything works fine until i try to use the Swift backend; this is what i got with the following bit of code:
import roboticstoolbox as rp
panda = rp.models.Panda()
panda.plot(q=panda.qr)
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 59165)
Traceback (most recent call last):
File "C:\Program Files\Python36\lib\socketserver.py", line 320, in _handle_request_noblock
self.process_request(request, client_address)
File "C:\Program Files\Python36\lib\socketserver.py", line 351, in process_request
self.finish_request(request, client_address)
File "C:\Program Files\Python36\lib\socketserver.py", line 364, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "C:\Program Files\Python36\lib\site-packages\swift\SwiftRoute.py", line 222, in __init__
*args, directory=str(root_dir), **kwargs
TypeError: __init__() got an unexpected keyword argument 'directory'
----------------------------------------
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 59166)
Traceback (most recent call last):
File "C:\Program Files\Python36\lib\socketserver.py", line 320, in _handle_request_noblock
self.process_request(request, client_address)
File "C:\Program Files\Python36\lib\socketserver.py", line 351, in process_request
self.finish_request(request, client_address)
File "C:\Program Files\Python36\lib\socketserver.py", line 364, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "C:\Program Files\Python36\lib\site-packages\swift\SwiftRoute.py", line 222, in __init__
*args, directory=str(root_dir), **kwargs
TypeError: __init__() got an unexpected keyword argument 'directory'
----------------------------------------
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 59167)
Traceback (most recent call last):
File "C:\Program Files\Python36\lib\socketserver.py", line 320, in _handle_request_noblock
self.process_request(request, client_address)
File "C:\Program Files\Python36\lib\socketserver.py", line 351, in process_request
self.finish_request(request, client_address)
File "C:\Program Files\Python36\lib\socketserver.py", line 364, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "C:\Program Files\Python36\lib\site-packages\swift\SwiftRoute.py", line 222, in __init__
*args, directory=str(root_dir), **kwargs
TypeError: __init__() got an unexpected keyword argument 'directory'
----------------------------------------
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 59171)
Traceback (most recent call last):
File "C:\Program Files\Python36\lib\socketserver.py", line 320, in _handle_request_noblock
self.process_request(request, client_address)
File "C:\Program Files\Python36\lib\socketserver.py", line 351, in process_request
self.finish_request(request, client_address)
File "C:\Program Files\Python36\lib\socketserver.py", line 364, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "C:\Program Files\Python36\lib\site-packages\swift\SwiftRoute.py", line 222, in __init__
*args, directory=str(root_dir), **kwargs
TypeError: __init__() got an unexpected keyword argument 'directory'
----------------------------------------
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 59172)
Traceback (most recent call last):
File "C:\Program Files\Python36\lib\socketserver.py", line 320, in _handle_request_noblock
self.process_request(request, client_address)
File "C:\Program Files\Python36\lib\socketserver.py", line 351, in process_request
self.finish_request(request, client_address)
File "C:\Program Files\Python36\lib\socketserver.py", line 364, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "C:\Program Files\Python36\lib\site-packages\swift\SwiftRoute.py", line 222, in __init__
*args, directory=str(root_dir), **kwargs
TypeError: __init__() got an unexpected keyword argument 'directory'
----------------------------------------
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 59173)
Traceback (most recent call last):
File "C:\Program Files\Python36\lib\socketserver.py", line 320, in _handle_request_noblock
self.process_request(request, client_address)
File "C:\Program Files\Python36\lib\socketserver.py", line 351, in process_request
self.finish_request(request, client_address)
File "C:\Program Files\Python36\lib\socketserver.py", line 364, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "C:\Program Files\Python36\lib\site-packages\swift\SwiftRoute.py", line 222, in __init__
*args, directory=str(root_dir), **kwargs
TypeError: __init__() got an unexpected keyword argument 'directory'
----------------------------------------
Could not connect to the Swift simulator
Traceback (most recent call last):
File "D:\mattia.torta\Downloads\robotics.py", line 4, in <module>
panda.plot(q=panda.qr)
File "C:\Program Files\Python36\lib\site-packages\roboticstoolbox\robot\Robot.py", line 1577, in plot
env.launch(self.name + " Plot", limits=limits, fig=fig)
File "C:\Program Files\Python36\lib\site-packages\swift\Swift.py", line 159, in launch
dev=self._dev,
File "C:\Program Files\Python36\lib\site-packages\swift\SwiftRoute.py", line 86, in start_servers
inq.get(timeout=10)
queue.Empty
The web page (i've already tried to use different browsers and also clearing the cache) just shows the error ERR_EMPTY_RESPONSE
. Does anyone have any idea on how to fix this?
Thank you in advance. Mattia
I am facing the same issue. I have installed roboticstoolbox with pip 21.3.1 for python 3.6.8 and I get exactly the same error messages. Is there already a solution for this?
Edit: with diving a bit in the code, I see that class MyHttpRequestHandler
inherits http.server.SimpleHTTPRequestHander
(SwiftRoute.py, line 222), in which the directory
argument is added in python3.7. That means that the Swift library is not compatible with python3.6, or changes in the library have to be made.
I solved by upgrading to Python 3.9.
Hi Mattia, thanks for your reply! Indeed a solution, but unfortunately I need to run it on python3.6.
I solved it by implementing a directory
parameter in the SimpleHTTPRequestHandler
class from the http.server
module. Not the correct way, but that's fine by me.
MyHttpRequestHandler
Hi, suitendall, i am facing the same issue, too, but i am new to ubuntu, can you tell me your specific solution? I'd appreciate it.
i am using the ubuntu, i have the exactly the same error repo:$ python holistic_mm_non_holonomic.py ATTENTION: default value of option mesa_glthread overridden by environment. ATTENTION: default value of option mesa_glthread overridden by environment. ATTENTION: default value of option mesa_glthread overridden by environment. ATTENTION: default value of option mesa_glthread overridden by environment.
Exception happened during processing of request from ('127.0.0.1', 45358) Traceback (most recent call last): File "/usr/lib/python3.6/socketserver.py", line 320, in _handle_request_noblock self.process_request(request, client_address) File "/usr/lib/python3.6/socketserver.py", line 351, in process_request self.finish_request(request, client_address) File "/usr/lib/python3.6/socketserver.py", line 364, in finish_request self.RequestHandlerClass(request, client_address, self) File "/home/hwww/.local/lib/python3.6/site-packages/swift/SwiftRoute.py", line 222, in init *args, directory=str(root_dir), **kwargs TypeError: init() got an unexpected keyword argument 'directory'
Exception happened during processing of request from ('127.0.0.1', 45372) Traceback (most recent call last): File "/usr/lib/python3.6/socketserver.py", line 320, in _handle_request_noblock self.process_request(request, client_address) File "/usr/lib/python3.6/socketserver.py", line 351, in process_request self.finish_request(request, client_address) File "/usr/lib/python3.6/socketserver.py", line 364, in finish_request self.RequestHandlerClass(request, client_address, self) File "/home/hwww/.local/lib/python3.6/site-packages/swift/SwiftRoute.py", line 222, in init *args, directory=str(root_dir), **kwargs TypeError: init() got an unexpected keyword argument 'directory'
Exception happened during processing of request from ('127.0.0.1', 45380) Traceback (most recent call last): File "/usr/lib/python3.6/socketserver.py", line 320, in _handle_request_noblock self.process_request(request, client_address) File "/usr/lib/python3.6/socketserver.py", line 351, in process_request self.finish_request(request, client_address) File "/usr/lib/python3.6/socketserver.py", line 364, in finish_request self.RequestHandlerClass(request, client_address, self) File "/home/hwww/.local/lib/python3.6/site-packages/swift/SwiftRoute.py", line 222, in init *args, directory=str(root_dir), **kwargs TypeError: init() got an unexpected keyword argument 'directory'
Exception happened during processing of request from ('127.0.0.1', 45390) Traceback (most recent call last): File "/usr/lib/python3.6/socketserver.py", line 320, in _handle_request_noblock self.process_request(request, client_address) File "/usr/lib/python3.6/socketserver.py", line 351, in process_request self.finish_request(request, client_address) File "/usr/lib/python3.6/socketserver.py", line 364, in finish_request self.RequestHandlerClass(request, client_address, self) File "/home/hwww/.local/lib/python3.6/site-packages/swift/SwiftRoute.py", line 222, in init *args, directory=str(root_dir), **kwargs TypeError: init() got an unexpected keyword argument 'directory'
Exception happened during processing of request from ('127.0.0.1', 45394) Traceback (most recent call last): File "/usr/lib/python3.6/socketserver.py", line 320, in _handle_request_noblock self.process_request(request, client_address) File "/usr/lib/python3.6/socketserver.py", line 351, in process_request self.finish_request(request, client_address) File "/usr/lib/python3.6/socketserver.py", line 364, in finish_request self.RequestHandlerClass(request, client_address, self) File "/home/hwww/.local/lib/python3.6/site-packages/swift/SwiftRoute.py", line 222, in init *args, directory=str(root_dir), **kwargs TypeError: init() got an unexpected keyword argument 'directory'
Exception happened during processing of request from ('127.0.0.1', 45408) Traceback (most recent call last): File "/usr/lib/python3.6/socketserver.py", line 320, in _handle_request_noblock self.process_request(request, client_address) File "/usr/lib/python3.6/socketserver.py", line 351, in process_request self.finish_request(request, client_address) File "/usr/lib/python3.6/socketserver.py", line 364, in finish_request self.RequestHandlerClass(request, client_address, self) File "/home/hwww/.local/lib/python3.6/site-packages/swift/SwiftRoute.py", line 222, in init *args, directory=str(root_dir), **kwargs TypeError: init() got an unexpected keyword argument 'directory'
Exception happened during processing of request from ('127.0.0.1', 45410) Traceback (most recent call last): File "/usr/lib/python3.6/socketserver.py", line 320, in _handle_request_noblock self.process_request(request, client_address) File "/usr/lib/python3.6/socketserver.py", line 351, in process_request self.finish_request(request, client_address) File "/usr/lib/python3.6/socketserver.py", line 364, in finish_request self.RequestHandlerClass(request, client_address, self) File "/home/hwww/.local/lib/python3.6/site-packages/swift/SwiftRoute.py", line 222, in init *args, directory=str(root_dir), **kwargs TypeError: init() got an unexpected keyword argument 'directory'
Exception happened during processing of request from ('127.0.0.1', 45412) Traceback (most recent call last): File "/usr/lib/python3.6/socketserver.py", line 320, in _handle_request_noblock self.process_request(request, client_address) File "/usr/lib/python3.6/socketserver.py", line 351, in process_request self.finish_request(request, client_address) File "/usr/lib/python3.6/socketserver.py", line 364, in finish_request self.RequestHandlerClass(request, client_address, self) File "/home/hwww/.local/lib/python3.6/site-packages/swift/SwiftRoute.py", line 222, in init *args, directory=str(root_dir), **kwargs TypeError: init() got an unexpected keyword argument 'directory'
Exception happened during processing of request from ('127.0.0.1', 45418) Traceback (most recent call last): File "/usr/lib/python3.6/socketserver.py", line 320, in _handle_request_noblock self.process_request(request, client_address) File "/usr/lib/python3.6/socketserver.py", line 351, in process_request self.finish_request(request, client_address) File "/usr/lib/python3.6/socketserver.py", line 364, in finish_request self.RequestHandlerClass(request, client_address, self) File "/home/hwww/.local/lib/python3.6/site-packages/swift/SwiftRoute.py", line 222, in init *args, directory=str(root_dir), **kwargs TypeError: init() got an unexpected keyword argument 'directory'
Exception happened during processing of request from ('127.0.0.1', 45432) Traceback (most recent call last): File "/usr/lib/python3.6/socketserver.py", line 320, in _handle_request_noblock self.process_request(request, client_address) File "/usr/lib/python3.6/socketserver.py", line 351, in process_request self.finish_request(request, client_address) File "/usr/lib/python3.6/socketserver.py", line 364, in finish_request self.RequestHandlerClass(request, client_address, self) File "/home/hwww/.local/lib/python3.6/site-packages/swift/SwiftRoute.py", line 222, in init *args, directory=str(root_dir), **kwargs TypeError: init() got an unexpected keyword argument 'directory'
Exception happened during processing of request from ('127.0.0.1', 45440) Traceback (most recent call last): File "/usr/lib/python3.6/socketserver.py", line 320, in _handle_request_noblock self.process_request(request, client_address) File "/usr/lib/python3.6/socketserver.py", line 351, in process_request self.finish_request(request, client_address) File "/usr/lib/python3.6/socketserver.py", line 364, in finish_request self.RequestHandlerClass(request, client_address, self) File "/home/hwww/.local/lib/python3.6/site-packages/swift/SwiftRoute.py", line 222, in init *args, directory=str(root_dir), **kwargs TypeError: init() got an unexpected keyword argument 'directory'
[ERROR glean_core] Error setting metrics feature config: Json(Error("EOF while parsing a value", line: 1, column: 0))
Could not connect to the Swift simulator
Traceback (most recent call last):
File "holistic_mm_non_holonomic.py", line 92, in