You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey,
I've been using the lua version of this package and it's awesome, really great work!
Now I'm trying out the python version, but am having this error:
>>> import display
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/zhang/.local/lib/python2.7/site-packages/display/__init__.py", line 5, in <module>
import urllib.request
ImportError: No module named request
Then I found out that hereurllib.request is a package for python3 but I'm using python2.7, so I modified the following lines of __init__.py:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/me/.local/lib/python2.7/site-packages/display/__init__.py", line 76, in image
'width': opts.get('width'),
File "/home/me/.local/lib/python2.7/site-packages/display/__init__.py", line 38, in pane
send(command='pane', type=panetype, id=win, title=title, content=content)
File "/home/me/.local/lib/python2.7/site-packages/display/__init__.py", line 29, in send
resp = urllib2.urlopen(req)
File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 404, in open
response = self._open(req, data)
File "/usr/lib/python2.7/urllib2.py", line 422, in _open
'_open', req)
File "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 1214, in http_open
return self.do_open(httplib.HTTPConnection, req)
File "/usr/lib/python2.7/urllib2.py", line 1184, in do_open
raise URLError(err)
urllib2.URLError: <urlopen error [Errno 111] Connection refused>
So I guess I cannot just simply replace urllib.request.Request(URL, method='POST') also just to urllib2.Request(URL), so can you give me some ideas as how to modify the code to work under python2.7?
Thanks in advance!
The text was updated successfully, but these errors were encountered:
So I actually find the solution to this problem.
Just have to run "th -ldisplay.start 8000 0.0.0.0" before you call display.image
Before in the lua version, the package will work without it, but here in the python version somehow this won't work. This would be an issue if I want to run my code for a relatively long period of time cos I found that the th -ldisplay.start breaks from time to time...
How should the code be modified to solve this issue?
Thanks!
Hey,
I've been using the lua version of this package and it's awesome, really great work!
Now I'm trying out the python version, but am having this error:
Then I found out that here
urllib.request
is a package forpython3
but I'm usingpython2.7
, so I modified the following lines of__init__.py
:but then I get this error:
So I guess I cannot just simply replace
urllib.request.Request(URL, method='POST')
also just tourllib2.Request(URL)
, so can you give me some ideas as how to modify the code to work underpython2.7
?Thanks in advance!
The text was updated successfully, but these errors were encountered: