[РЕШЕНО] ImportError: No module named ImageTk

vasek
Поставь кавычки в line 71 - print(Tkinter are not installed! for linux use: "sudo apt-get install python-tk")

Так мы далеко зайдем - в оригинале прописано так:

print 'Tkinter are not installed! for linux use: "sudo apt-get install python-tk"'

т.е. кавычки стоят. Если апостроф заменить на кавычки, али другие комбинации замен, все равно ругается на SyntaxError: Missing parentheses in call to 'print'.

Если строку грохнуть целиком, то переходит к следуещему вызову print, коих там не мало.
vasek
wau
сам модуль image-to-gcode требует модуль, на нем и падает
Написано же явно - SyntaxError: Missing parentheses in call to 'print'. Did you mean print …. (Отсутствуют скобки при вызове «print» ….)

Точно. Если все взять в скобки = переходит к следующему вызову. Странно. Ведь и без скобок print выполянется. И с чего вдруг скобки потребовались?!
Один раз описался - вместо скобки написал кавычки - Поставь кавычки в line 71 виноват, описался в 1-ый раз
Ошибки не исчезают с опытом - они просто умнеют
wau
Ведь и без скобок print выполянется
В разных версиях (2.7 и др.) по разному

Написал то кавычки вместо скобок, но в примере то поставил скобки
wau
vasek
Поставь кавычки в line 71 - print(Tkinter are not installed! for linux use: "sudo apt-get install python-tk")
Ошибки не исчезают с опытом - они просто умнеют
Бог с ними, со скобками - в программе три тыщи строк, в части заменил, но суть-то по-прежнему в (вариант программки из состава LinuxCNC, которая хотябы запускается, но падает при выборе файла) -

image-to-gcode2
Traceback (most recent call last):
  File "/usr/sbin/image-to-gcode2", line 828, in <module>
    main()
  File "/usr/sbin/image-to-gcode2", line 764, in main
    options = ui(im, nim, im_name)
  File "/usr/sbin/image-to-gcode2", line 498, in ui
    import ImageTk
  File "/usr/bin/ImageTk.py", line 31, in <module>
    from . import Image
ValueError: Attempted relative import in non-package

помимо прочего еще и сравнение с ненулем изменилось -


File "/usr/sbin/image-to-gcode", line 344
    if n2.min() <> 0 and prn_detail > -1: print ("( Error(): n2=",n2," )")
                 ^
SyntaxError: invalid syntax

Проблема с модулями, навскидку вряд ли кто ответит, нужно ставит и пробовать, а так гадания. Лучше обращайся напрямую к автору
Ошибки не исчезают с опытом - они просто умнеют
Уже обратился. Буду ждать ответа.
wau
в программе три тыщи строк, в части заменил
Вообще то 2версию указать если у вас по умолчанию третий питон
#!/usr/bin/python2 вместо #!/usr/bin/python
проверил скрипт с https://github.com/robomechs/image-to-gcode
нормально отрабатывает на картинке из примера (yoda_example.png)надо только поменять на #!/usr/bin/python2
[oleg@vs220 1]$ yay -Qs python2
local/ccsm-gtk3 0.8.16-1 (compiz-fusion)
    Compizconfig Settings Manager in Python2
local/python-dbus-common 1.2.8-2
    Common dbus-python files shared between python-dbus and python2-dbus
local/python2 2.7.16-1
    A high-level scripting language
local/python2-appdirs 1.4.3-2
    A small Python module for determining appropriate platform-specific dirs, e.g. a "user data dir".
local/python2-asn1crypto 0.24.0-2
    Python ASN.1 library with a focus on performance and a pythonic API
local/python2-attrs 19.1.0-1
    Attributes without boilerplate.
local/python2-automat 0.7.0-2
    Self-service finite-state machines for the programmer on the go.
local/python2-cachecontrol 0.12.5-4
    httplib2 caching for requests
local/python2-cairo 1.18.1-1
    Python2 bindings for the cairo graphics library
local/python2-cffi 1.12.3-1
    Foreign Function Interface for Python calling C code
local/python2-chardet 3.0.4-2
    Python2 module for character encoding auto-detection
local/python2-click 7.0-1
    A simple wrapper around optparse for powerful command line utilities
local/python2-colorama 0.4.1-1
    Python API for cross-platform colored terminal text.
local/python2-constantly 15.1.0-3
    Symbolic constants in Python
local/python2-cryptography 2.7-1
    A package designed to expose cryptographic recipes and primitives to Python developers
local/python2-dbus 1.2.8-2
    Python2 bindings for DBUS
local/python2-distlib 0.2.9-1
    Low-level components of distutils2/packaging
local/python2-distro 1.4.0-1
    Linux OS platform information API
local/python2-enum34 1.1.6-2
    Python 3.4 Enum backported
local/python2-gconf 2.28.1-12
    Python bindings for interacting with GConf
local/python2-gobject2 2.28.7-2
    Python2 bindings for GObject (legacy)
local/python2-gtkglext 1.1.0-8
    Python language bindings for GtkGLExt
local/python2-html5lib 1.0.1-3
    A Python2 HTML parser/tokenizer based on the WHATWG HTML5 spec
local/python2-hyperlink 19.0.0-1
    A featureful, correct URL for Python
local/python2-idna 2.8-1
    Internationalized Domain Names in Applications (IDNA)
local/python2-incremental 17.5.0-2
    A small library that versions your Python projects
local/python2-ipaddress 1.0.22-1
    IPv4/IPv6 manipulation library
local/python2-libappindicator 12.10.0-13
    Allow applications to extend a menu via Ayatana indicators in Unity, KDE or Systray
local/python2-lockfile 0.12.2-4
    Platform-independent file locking module
local/python2-msgpack 0.6.1-1
    MessagePack serializer implementation for Python2
local/python2-notify 0.1.1-14
    Python bindings for libnotify
local/python2-numpy 1.16.4-1
    Scientific tools for Python
local/python2-opengl 3.1.0-4
    The cross platform Python binding to OpenGL and related APIs
local/python2-packaging 19.0-1
    Core utilities for Python packages
local/python2-pep517 0.5.0-1
    Wrappers to build Python packages using PEP 517 hooks
local/python2-pillow 6.1.0-1
    Python Imaging Library (PIL) fork. Python2 version.
local/python2-pip 19.0.3-1
    The PyPA recommended tool for installing Python packages
local/python2-ply 3.11-2
    Implementation of lex and yacc parsing tools
local/python2-progress 1.5-1
    Easy to use progress bars for Python
local/python2-pycparser 2.19-1
    C parser and AST generator written in Python
local/python2-pygame 1.9.5-1
    Python game library
local/python2-pyhamcrest 1.9.0-3
    Hamcrest framework for matcher objects
local/python2-pyopenssl 19.0.0-1
    Python3 wrapper module around the OpenSSL library
local/python2-pyparsing 2.4.0-1
    General parsing module for Python
local/python2-pytoml 0.1.21-1
    A TOML-0.4.0 parser/writer for Python.
local/python2-requests 2.22.0-1
    Python HTTP for Humans
local/python2-retrying 1.3.3-4
    A general purpose Python retyring library
local/python2-setuptools 1:41.0.1-1
    Easily download, build, install, upgrade, and uninstall Python packages
local/python2-six 1.12.0-1
    Python 2 and 3 compatibility utilities
local/python2-twisted 19.2.1-1
    Asynchronous networking framework written in Python
local/python2-urllib3 1.25.3-1
    HTTP library with thread-safe connection pooling and file post support
local/python2-webencodings 0.5.1-2
    This is a Python implementation of the WHATWG Encoding standard.
local/python2-xdg 0.26-2
    Python library to access freedesktop.org standards
local/python2-xlib 0.24-1
    A fully functional X client library for Python programs
local/python2-zope-interface 4.6.0-1
    Zope Interfaces for Python 2.x
Точно, спасибо - указав 2.7 процесс двинулся аж до -

Traceback (most recent call last):
File "/usr/sbin/image-to-gcode", line 61, in <module>
from author import Gcode
ImportError: No module named author
строка выглядит как
from author import Gcode
 
Зарегистрироваться или войдите чтобы оставить сообщение.