ev3 closes connection when I attempt to connect through rpyc in python - python

I installed ev3dev on my ev3 brick so I could create programs on it with python. I am trying to use the "rpyc" library for python which can be found here. However, when I try to run this basic script which is given as an example on the link above:
import rpyc
conn = rpyc.classic.connect('192.168.137.3') # host name or IP address of the EV3
ev3 = conn.modules['ev3dev.ev3'] # import ev3dev.ev3 remotely
m = ev3.LargeMotor('outA')
m.run_timed(time_sp=1000, speed_sp=600)
I get multiple errors thrown at me through the terminal followed by the connection closing. I have followed all the instructions on the page and I also started the server script on the ev3 brick beforehand. When I run the above program the errors from python are displayed:
Traceback (most recent call last):
File "C:/Python27/cooode/moottertest.py", line 2, in <module>
conn = rpyc.classic.connect('192.168.137.3') # host name or IP address of the EV3
File "C:\Python27\lib\site-packages\rpyc\utils\classic.py", line 65, in connect
return factory.connect(host, port, SlaveService, ipv6 = ipv6)
File "C:\Python27\lib\site-packages\rpyc\utils\factory.py", line 90, in connect
return connect_stream(s, service, config)
File "C:\Python27\lib\site-packages\rpyc\utils\factory.py", line 51, in connect_stream
return connect_channel(Channel(stream), service = service, config = config)
File "C:\Python27\lib\site-packages\rpyc\utils\factory.py", line 40, in connect_channel
return Connection(service, channel, config = config)
File "C:\Python27\lib\site-packages\rpyc\core\protocol.py", line 147, in __init__
self._init_service()
File "C:\Python27\lib\site-packages\rpyc\core\protocol.py", line 150, in _init_service
self._local_root.on_connect()
File "C:\Python27\lib\site-packages\rpyc\core\service.py", line 145, in on_connect
self._conn.builtin = self._conn.modules.__builtin__
File "C:\Python27\lib\site-packages\rpyc\core\service.py", line 114, in __getattr__
return self[name]
File "C:\Python27\lib\site-packages\rpyc\core\service.py", line 111, in __getitem__
self.__cache[name] = self.__getmodule(name)
File "C:\Python27\lib\site-packages\rpyc\core\netref.py", line 196, in __call__
return syncreq(_self, consts.HANDLE_CALL, args, kwargs)
File "C:\Python27\lib\site-packages\rpyc\core\netref.py", line 71, in syncreq
return conn.sync_request(handler, oid, *args)
File "C:\Python27\lib\site-packages\rpyc\core\protocol.py", line 435, in sync_request
self.serve(0.1)
File "C:\Python27\lib\site-packages\rpyc\core\protocol.py", line 383, in serve
data = self._recv(timeout, wait_for_lock = True)
File "C:\Python27\lib\site-packages\rpyc\core\protocol.py", line 341, in _recv
data = self._channel.recv()
File "C:\Python27\lib\site-packages\rpyc\core\channel.py", line 50, in recv
header = self.stream.read(self.FRAME_HEADER.size)
File "C:\Python27\lib\site-packages\rpyc\core\stream.py", line 190, in read
raise EOFError("connection closed by peer")
EOFError: connection closed by peer
>>>
Then on my SSH session, here are the errors that are displayed:
robot#ev3dev:~$ ./rpyc_server.sh
INFO:SLAVE/18812:server started on [0.0.0.0]:18812
INFO:SLAVE/18812:accepted 192.168.137.1:5725
INFO:SLAVE/18812:welcome [192.168.137.1]:5725
INFO:SLAVE/18812:goodbye [192.168.137.1]:5725
ERROR:SLAVE/18812:client connection terminated abruptly
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/rpyc/utils/server.py", line 172, in _authenticate_and_serve_client
self._serve_client(sock2, credentials)
File "/usr/lib/python3/dist-packages/rpyc/utils/server.py", line 197, in _serve_client
conn._init_service()
File "/usr/lib/python3/dist-packages/rpyc/core/protocol.py", line 154, in _init_service
self._local_root.on_connect()
File "/usr/lib/python3/dist-packages/rpyc/core/service.py", line 150, in on_connect
self._conn.builtin = self._conn.modules.builtins
File "/usr/lib/python3/dist-packages/rpyc/core/service.py", line 121, in __getattr__
return self[name]
File "/usr/lib/python3/dist-packages/rpyc/core/service.py", line 118, in __getitem__
self.__cache[name] = self.__getmodule(name)
TypeError: 'b'instancemethod'' object is not callable
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python3.4/threading.py", line 920, in _bootstrap_inner
self.run()
File "/usr/lib/python3.4/threading.py", line 868, in run
self._target(*self._args, **self._kwargs)
File "/usr/lib/python3/dist-packages/rpyc/utils/server.py", line 172, in _authenticate_and_serve_client
self._serve_client(sock2, credentials)
File "/usr/lib/python3/dist-packages/rpyc/utils/server.py", line 197, in _serve_client
conn._init_service()
File "/usr/lib/python3/dist-packages/rpyc/core/protocol.py", line 154, in _init_service
self._local_root.on_connect()
File "/usr/lib/python3/dist-packages/rpyc/core/service.py", line 150, in on_connect
self._conn.builtin = self._conn.modules.builtins
File "/usr/lib/python3/dist-packages/rpyc/core/service.py", line 121, in __getattr__
return self[name]
File "/usr/lib/python3/dist-packages/rpyc/core/service.py", line 118, in __getitem__
self.__cache[name] = self.__getmodule(name)
TypeError: 'b'instancemethod'' object is not callable
What is going wrong here in these errors?

Are you connecting python2 and python3? ev3dev uses python2.
Use pyenv to install python3 and use it so that your python version of PC and ev3 are the same.
https://gist.github.com/jaydenkieran/75b2bbc32b5b70c4fdfb161ecdb6daa2
You might need to run this command first to install through curl:
sudo apt-get install curl

Related

TypeError from pkg_resources when using static assets in Pyramid

Trying to set up static assets on a Pyramid app. I used the following call:
config.add_static_view(name='static', path='toolsofknowledge:static')
The file main.css is stored under toolsofknowledge/static/main.css, as expected. The toolsofknowledge package is installed locally with an editable link, using pip3 install -e ..
Requesting http://localhost:8080/static/main.css with curl causes this exception on the server:
amoe#cslp019129 $ PYRAMID_RELOAD_TEMPLATES=1 pserve3 --reload development.ini
Starting monitor for PID 3796.
Starting server in PID 3796.
Serving on http://localhost:8080
Serving on http://localhost:8080
ERROR:waitress:Exception when serving /static/main.css
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pyramid/tweens.py", line 13, in _error_handler
response = request.invoke_exception_view(exc_info)
File "/usr/lib/python3/dist-packages/pyramid/view.py", line 769, in invoke_exception_view
raise HTTPNotFound
pyramid.httpexceptions.HTTPNotFound: The resource could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/waitress/channel.py", line 336, in service
task.service()
File "/usr/lib/python3/dist-packages/waitress/task.py", line 175, in service
self.execute()
File "/usr/lib/python3/dist-packages/waitress/task.py", line 452, in execute
app_iter = self.channel.server.application(env, start_response)
File "/usr/lib/python3/dist-packages/pyramid/router.py", line 270, in __call__
response = self.execution_policy(environ, self)
File "/usr/lib/python3/dist-packages/pyramid/router.py", line 279, in default_execution_policy
return request.invoke_exception_view(reraise=True)
File "/usr/lib/python3/dist-packages/pyramid/view.py", line 768, in invoke_exception_view
reraise_(*exc_info)
File "/usr/lib/python3/dist-packages/pyramid/compat.py", line 179, in reraise
raise value
File "/usr/lib/python3/dist-packages/pyramid/router.py", line 277, in default_execution_policy
return router.invoke_request(request)
File "/usr/lib/python3/dist-packages/pyramid/router.py", line 249, in invoke_request
response = handle_request(request)
File "/usr/lib/python3/dist-packages/pyramid/tweens.py", line 43, in excview_tween
response = _error_handler(request, exc)
File "/usr/lib/python3/dist-packages/pyramid/tweens.py", line 17, in _error_handler
reraise(*exc_info)
File "/usr/lib/python3/dist-packages/pyramid/compat.py", line 179, in reraise
raise value
File "/usr/lib/python3/dist-packages/pyramid/tweens.py", line 41, in excview_tween
response = handler(request)
File "/usr/lib/python3/dist-packages/pyramid/router.py", line 148, in handle_request
registry, request, context, context_iface, view_name
File "/usr/lib/python3/dist-packages/pyramid/view.py", line 657, in _call_view
response = view_callable(context, request)
File "/usr/lib/python3/dist-packages/pyramid/viewderivers.py", line 401, in viewresult_to_response
result = view(context, request)
File "/usr/lib/python3/dist-packages/pyramid/static.py", line 102, in __call__
if resource_isdir(self.package_name, resource_path):
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1138, in resource_isdir
return get_provider(package_or_requirement).resource_isdir(
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 364, in get_provider
return _find_adapter(_provider_factories, loader)(module)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1392, in __init__
self.module_path = os.path.dirname(getattr(module, '__file__', ''))
File "/usr/lib/python3.7/posixpath.py", line 156, in dirname
p = os.fspath(p)
TypeError: expected str, bytes or os.PathLike object, not NoneType
Python 3.7, Pyramid 1.10.2.
Solution: add __init__.py to toolsofknowledge directory.
The problem is quite simple -- the toolsofknowledge package was not a real package, despite being installed, as it was missing an __init__.py. This causes toolsofknowledge.__loader__ to be an instance of NamespaceLoader, when it should be SourceFileLoader. Obviously, pkg_resources cannot resolve resources relative to something that's not a real package. Arguably it should handle this case more smoothly though.

WSGIServer with '0.0.0.0' error - an integer is required (got type bytes)

I'm running WSGIServer with an address '0.0.0.0'
from gevent import pywsgi
from geventwebsocket.handler import WebSocketHandler
server = pywsgi.WSGIServer(('0.0.0.0', 5002), app, handler_class=WebSocketHandler)
server.serve_forever()
Which generates the error TypeError: an integer is required (got type bytes)
If I change '0.0.0.0' to '127.0.0.1' everything works just fine.
I'm using Python 3.8 on MacOS 10.14.6
Here is the full error
Traceback (most recent call last):
File "/Users/ronharlev/Documents/MyProject/streaming_server.py", line 174, in run_process
server.serve_forever()
File "/Users/ronharlev/Documents/MyProject/venv/lib/python3.8/site-packages/gevent/baseserver.py", line 367, in serve_forever
self.start()
File "/Users/ronharlev/Documents/MyProject/venv/lib/python3.8/site-packages/gevent/baseserver.py", line 305, in start
self.init_socket()
File "/Users/ronharlev/Documents/MyProject/venv/lib/python3.8/site-packages/gevent/pywsgi.py", line 1491, in init_socket
self.update_environ()
File "/Users/ronharlev/Documents/MyProject/venv/lib/python3.8/site-packages/gevent/pywsgi.py", line 1503, in update_environ
name = socket.getfqdn(address[0])
File "/Users/ronharlev/Documents/MyProject/venv/lib/python3.8/site-packages/gevent/_socketcommon.py", line 269, in getfqdn
hostname, aliases, _ = gethostbyaddr(name)
File "/Users/ronharlev/Documents/MyProject/venv/lib/python3.8/site-packages/gevent/_socketcommon.py", line 241, in gethostbyaddr
return get_hub().resolver.gethostbyaddr(ip_address)
File "/Users/ronharlev/Documents/MyProject/venv/lib/python3.8/site-packages/gevent/resolver/thread.py", line 68, in gethostbyaddr
return self.pool.apply(_socket.gethostbyaddr, args, kwargs)
File "/Users/ronharlev/Documents/MyProject/venv/lib/python3.8/site-packages/gevent/pool.py", line 159, in apply
return self.spawn(func, *args, **kwds).get()
File "src/gevent/event.py", line 268, in gevent._event.AsyncResult.get
File "src/gevent/event.py", line 296, in gevent._event.AsyncResult.get
File "src/gevent/event.py", line 286, in gevent._event.AsyncResult.get
File "src/gevent/event.py", line 266, in gevent._event.AsyncResult._raise_exception
File "src/gevent/event.py", line 211, in gevent._event.AsyncResult.exc_info.__get__
File "/Users/ronharlev/Documents/MyProject/venv/lib/python3.8/site-packages/gevent/_tblib.py", line 371, in g
return f(a)
File "/Users/ronharlev/Documents/MyProject/venv/lib/python3.8/site-packages/gevent/_tblib.py", line 432, in load_traceback
return loads(s)
File "/Users/ronharlev/Documents/MyProject/venv/lib/python3.8/site-packages/gevent/_tblib.py", line 337, in unpickle_traceback
return ret.as_traceback()
File "/Users/ronharlev/Documents/MyProject/venv/lib/python3.8/site-packages/gevent/_tblib.py", line 202, in as_traceback
code = CodeType( TypeError: an integer is required (got type bytes)
Per https://github.com/gevent/gevent/issues/1491:
gevent 1.4 is not compatible with Python 3.8. Please use gevent >=
1.5a2 on Python 3.8. This is one of the (several) known issues of running gevent 1.4 on Python 3.8.

Celery throwing long error message

I'm trying to run the starter code for celery on their website (http://docs.celeryproject.org/en/latest/getting-started/first-steps-with-celery.html), and I'm running an instance of a RabbitMQ server in the background. However, I'm getting a long error message:
>>> from celery import Celery
>>> app = Celery('tasks', broker='pyamqp://guest#localhost//')
>>> #app.task
... def add(x, y):
... return x + y
...
>>>
>>> add.delay(4, 4)
Traceback (most recent call last):
File "C:\Users\Alexander\Anaconda3\lib\site-packages\kombu\utils\functional.py", line 36, in __call__
return self.__value__
AttributeError: 'ChannelPromise' object has no attribute '__value__'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Alexander\Anaconda3\lib\site-packages\kombu\connection.py", line 494, in _ensured
return fun(*args, **kwargs)
File "C:\Users\Alexander\Anaconda3\lib\site-packages\kombu\messaging.py", line 187, in _publish
channel = self.channel
File "C:\Users\Alexander\Anaconda3\lib\site-packages\kombu\messaging.py", line 209, in _get_channel
channel = self._channel = channel()
File "C:\Users\Alexander\Anaconda3\lib\site-packages\kombu\utils\functional.py", line 38, in __call__
value = self.__value__ = self.__contract__()
File "C:\Users\Alexander\Anaconda3\lib\site-packages\kombu\messaging.py", line 224, in <lambda>
channel = ChannelPromise(lambda: connection.default_channel)
File "C:\Users\Alexander\Anaconda3\lib\site-packages\kombu\connection.py", line 819, in default_channel
self.connection
File "C:\Users\Alexander\Anaconda3\lib\site-packages\kombu\connection.py", line 802, in connection
self._connection = self._establish_connection()
File "C:\Users\Alexander\Anaconda3\lib\site-packages\kombu\connection.py", line 757, in _establish_connection
conn = self.transport.establish_connection()
File "C:\Users\Alexander\Anaconda3\lib\site-packages\kombu\transport\pyamqp.py", line 130, in establish_connection
conn.connect()
File "C:\Users\Alexander\Anaconda3\lib\site-packages\amqp\connection.py", line 294, in connect
self.transport.connect()
File "C:\Users\Alexander\Anaconda3\lib\site-packages\amqp\transport.py", line 122, in connect
self.socket_settings, self.read_timeout, self.write_timeout,
File "C:\Users\Alexander\Anaconda3\lib\site-packages\amqp\transport.py", line 174, in _init_socket
self._set_socket_options(socket_settings)
File "C:\Users\Alexander\Anaconda3\lib\site-packages\amqp\transport.py", line 204, in _set_socket_options
self.sock.setsockopt(SOL_TCP, opt, val)
OSError: [WinError 10042] An unknown, invalid, or unsupported option or level was specified in a getsockopt or setsockopt call
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Alexander\Anaconda3\lib\site-packages\kombu\connection.py", line 414, in _reraise_as_library_errors
yield
File "C:\Users\Alexander\Anaconda3\lib\site-packages\kombu\connection.py", line 515, in _ensured
reraise_as_library_errors=False,
File "C:\Users\Alexander\Anaconda3\lib\site-packages\kombu\connection.py", line 405, in ensure_connection
callback)
File "C:\Users\Alexander\Anaconda3\lib\site-packages\kombu\utils\functional.py", line 333, in retry_over_time
return fun(*args, **kwargs)
File "C:\Users\Alexander\Anaconda3\lib\site-packages\kombu\connection.py", line 261, in connect
return self.connection
File "C:\Users\Alexander\Anaconda3\lib\site-packages\kombu\connection.py", line 802, in connection
self._connection = self._establish_connection()
File "C:\Users\Alexander\Anaconda3\lib\site-packages\kombu\connection.py", line 757, in _establish_connection
conn = self.transport.establish_connection()
File "C:\Users\Alexander\Anaconda3\lib\site-packages\kombu\transport\pyamqp.py", line 130, in establish_connection
conn.connect()
File "C:\Users\Alexander\Anaconda3\lib\site-packages\amqp\connection.py", line 294, in connect
self.transport.connect()
File "C:\Users\Alexander\Anaconda3\lib\site-packages\amqp\transport.py", line 122, in connect
self.socket_settings, self.read_timeout, self.write_timeout,
File "C:\Users\Alexander\Anaconda3\lib\site-packages\amqp\transport.py", line 174, in _init_socket
self._set_socket_options(socket_settings)
File "C:\Users\Alexander\Anaconda3\lib\site-packages\amqp\transport.py", line 204, in _set_socket_options
self.sock.setsockopt(SOL_TCP, opt, val)
OSError: [WinError 10042] An unknown, invalid, or unsupported option or level was specified in a getsockopt or setsockopt call
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\Alexander\Anaconda3\lib\site-packages\celery\app\task.py", line 412, in delay
return self.apply_async(args, kwargs)
File "C:\Users\Alexander\Anaconda3\lib\site-packages\celery\app\task.py", line 535, in apply_async
**options
File "C:\Users\Alexander\Anaconda3\lib\site-packages\celery\app\base.py", line 737, in send_task
amqp.send_task_message(P, name, message, **options)
File "C:\Users\Alexander\Anaconda3\lib\site-packages\celery\app\amqp.py", line 558, in send_task_message
**properties
File "C:\Users\Alexander\Anaconda3\lib\site-packages\kombu\messaging.py", line 181, in publish
exchange_name, declare,
File "C:\Users\Alexander\Anaconda3\lib\site-packages\kombu\connection.py", line 527, in _ensured
errback and errback(exc, 0)
File "C:\Users\Alexander\Anaconda3\lib\contextlib.py", line 77, in __exit__
self.gen.throw(type, value, traceback)
File "C:\Users\Alexander\Anaconda3\lib\site-packages\kombu\connection.py", line 419, in _reraise_as_library_errors
sys.exc_info()[2])
File "C:\Users\Alexander\Anaconda3\lib\site-packages\vine\five.py", line 175, in reraise
raise value.with_traceback(tb)
File "C:\Users\Alexander\Anaconda3\lib\site-packages\kombu\connection.py", line 414, in _reraise_as_library_errors
yield
File "C:\Users\Alexander\Anaconda3\lib\site-packages\kombu\connection.py", line 515, in _ensured
reraise_as_library_errors=False,
File "C:\Users\Alexander\Anaconda3\lib\site-packages\kombu\connection.py", line 405, in ensure_connection
callback)
File "C:\Users\Alexander\Anaconda3\lib\site-packages\kombu\utils\functional.py", line 333, in retry_over_time
return fun(*args, **kwargs)
File "C:\Users\Alexander\Anaconda3\lib\site-packages\kombu\connection.py", line 261, in connect
return self.connection
File "C:\Users\Alexander\Anaconda3\lib\site-packages\kombu\connection.py", line 802, in connection
self._connection = self._establish_connection()
File "C:\Users\Alexander\Anaconda3\lib\site-packages\kombu\connection.py", line 757, in _establish_connection
conn = self.transport.establish_connection()
File "C:\Users\Alexander\Anaconda3\lib\site-packages\kombu\transport\pyamqp.py", line 130, in establish_connection
conn.connect()
File "C:\Users\Alexander\Anaconda3\lib\site-packages\amqp\connection.py", line 294, in connect
self.transport.connect()
File "C:\Users\Alexander\Anaconda3\lib\site-packages\amqp\transport.py", line 122, in connect
self.socket_settings, self.read_timeout, self.write_timeout,
File "C:\Users\Alexander\Anaconda3\lib\site-packages\amqp\transport.py", line 174, in _init_socket
self._set_socket_options(socket_settings)
File "C:\Users\Alexander\Anaconda3\lib\site-packages\amqp\transport.py", line 204, in _set_socket_options
self.sock.setsockopt(SOL_TCP, opt, val)
kombu.exceptions.OperationalError: [WinError 10042] An unknown, invalid, or unsupported option or level was specified in a getsockopt or setsockopt call
There is an open issue on github where the same OS-error has been seen:
https://github.com/celery/py-amqp/issues/130
Someone suggested in the comments on the issue that it is temporarily resolved by downgrading the version of amqp to 2.1.3
Steps to take in order to downgrade:
Uninstall amqp using $ pip uninstall amqp.
Install amqp using $ pip install -Iv amqp==2.1.3.

Paramiko.ssh_exception.SSHException: Channel closed

I just encountered the problem with connecting the SDN switch, pica 8 3290, with ryu's of-config library and python paramiko library.
Here's the traceback msg:
=================================================================================
xdn41o71:ryu Mac$ sudo ryu-manager ryu/app/of_config.py
Password:
loading app ryu/app/of_config.py
Connected (version 2.0, client OpenSSH_6.0p1)
Authentication (password) successful!
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/bin/ryu-manager", line 9, in <module>
load_entry_point('ryu==3.20.1', 'console_scripts', 'ryu-manager')()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ryu/cmd/manager.py", line 88, in main
app_mgr.load_apps(app_lists)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ryu/base/app_manager.py", line 390, in load_apps
cls = self.load_app(app_cls_name)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ryu/base/app_manager.py", line 366, in load_app
mod = utils.import_module(name)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ryu/utils.py", line 91, in import_module
__import__(name)
File "/Users/Mac/ryu/ryu/app/of_config.py", line 9, in <module>
unknown_host_cb=lambda host, fingeprint: True)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ryu/lib/of_config/capable_switch.py", line 50, in __init__
self.netconf = connect(*self._connect_args, **self._connect_kwargs)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ryu/contrib/ncclient/manager.py", line 67, in connect_ssh
session.connect(*args, **kwds)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ryu/contrib/ncclient/transport/ssh.py", line 208, in connect
c.invoke_subsystem("netconf")
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/paramiko/channel.py", line 60, in _check
return func(self, *args, **kwds)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/paramiko/channel.py", line 254, in invoke_subsystem
self._wait_for_event()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/paramiko/channel.py", line 1086, in _wait_for_event
raise e
paramiko.ssh_exception.SSHException: Channel closed.
===============================================================================
I've googled the problem, paramiko.ssh_exception.SSHException: Channel closed.,
however, there isn't any appropriate solution to my problem.
Anyone can give me some instructions to solve this problem?

Ubuntu, Skype and Python

I am using Skype4Py and create a skype bot.
I wanted to install the bot on a linux enviroment (Ubuntu 12.04 as I recall right)
And I installed skype and the bot + dependicies.
Now whenever I ask for message.Chat.Type, it gives me a command timeout..
Any solution?
error:
Exception in thread Skype4Py MessageStatus event scheduler:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
self.run()
File "/usr/local/lib/python2.7/dist-packages/Skype4Py/utils.py", line 225, in run
handler(*self.args, **self.kwargs)
File "functions/messageProcessor.py", line 161, in processMessages
if allowed(message, "url_parse"):
File "functions/messageProcessor.py", line 62, in allowed
chatType = message.Chat.Type
File "/usr/local/lib/python2.7/dist-packages/Skype4Py/chat.py", line 405, in _GetType
return str(self._Property('TYPE'))
File "/usr/local/lib/python2.7/dist-packages/Skype4Py/chat.py", line 33, in _Property
return self._Owner._Property('CHAT', self.Name, PropName, Value, Cache)
File "/usr/local/lib/python2.7/dist-packages/Skype4Py/skype.py", line 296, in _Property
value = self._DoCommand('GET %s' % jarg, jarg)
File "/usr/local/lib/python2.7/dist-packages/Skype4Py/skype.py", line 276, in _DoCommand
self.SendCommand(command)
File "/usr/local/lib/python2.7/dist-packages/Skype4Py/skype.py", line 778, in SendCommand
self._Api.send_command(Command)
File "/usr/local/lib/python2.7/dist-packages/Skype4Py/api/posix_x11.py", line 445, in send_command
raise SkypeAPIError('Skype command timeout')
SkypeAPIError: Skype command timeout

Categories

Resources