sieht aus wie die beste Option zu VNC aus Python ist VNCDOTOOL-Modul. Ich benutze es mit Python2 ohne Probleme. Jetzt gehe ich zu Python3. Es scheint überhaupt nicht auf meinem Mac zu funktionieren. Hier ist das Problem.vncdotool Unterstützung auf Python3?
nach dem Erstellen von venv und installieren Sie pip3 installieren vncdotool. Beim Ausführen des vncdo-Befehls wird sofort ein Fehler angezeigt. Es heißt "Daten drucken". sieht aus wie es Python2 Code "print 'xxx' vs print ('xxx')"
(vnc) mac:vnc user$ vncdo
Traceback (most recent call last):
File "/Users/user/Documents/code/vnc/bin/vncdo", line 11, in <module>
load_entry_point('vncdotool==0.10.0', 'console_scripts', 'vncdo')()
File "/Users/user/Documents/code/vnc/lib/python3.6/site-packages/pkg_resources/__init__.py", line 565, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/Users/user/Documents/code/vnc/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2631, in load_entry_point
return ep.load()
File "/Users/user/Documents/code/vnc/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2291, in load
return self.resolve()
File "/Users/user/Documents/code/vnc/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2297, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/Users/user/Documents/code/vnc/lib/python3.6/site-packages/vncdotool/command.py", line 79
print data
^
SyntaxError: Missing parentheses in call to 'print'
(vnc) Mac:vnc user$
wenn ich laufe python3 im interaktiven Modus, und versuchen, die api-Modul zu importieren läuft. Ich habe einen weiteren Fehler, der besagt, dass die Warteschlange nicht verfügbar ist.
(vnc) Mac:vnc user$ python
Python 3.6.1 (default, Apr 4 2017, 09:40:21)
[GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.38)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from vncdotool import api
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/user/Documents/code/rdpvnc/lib/python3.6/site- packages/vncdotool/api.py", line 8, in <module>
import Queue
ModuleNotFoundError: No module named 'Queue'
>>>
Ich habe die github page sehen, dass es in der Tat Unterstützung python3 ist. Es gibt jedoch nicht viele Informationen im Internet.
Mögliche Duplikate von [Python 2 und Python 3 Dual-Entwicklung] (https://stackoverflow.com/questions/11372190/python-2-and-python-3-dual-development) –
Ivan - Python2 ist aus dem Stand Macos Paket. Ich installiere Python3 mit Homebrew auf meinem Mac. Meinst du Python2 und Python3 können nicht nebeneinander existieren? –
Das vorgeschlagene Duplikat enthält Hinweise, wie dieses Modul repariert werden kann, sodass es sowohl in py2 als auch in py3 ausgeführt wird. –