Giter Club home page Giter Club logo

Comments (4)

rdbende avatar rdbende commented on September 27, 2024 1

The version of tkinter provided in macOS is probably outdated. If the following code:

import tkinter
print(tkinter.TkVersion)

gives anything below 8.6, you should update it somehow. There instructions on it on the internet.

from ttkbootstrap.

1337haxx0r avatar 1337haxx0r commented on September 27, 2024 1

Alright.
So I did update tkinter to 8.6 following this answer: https://stackoverflow.com/a/61879759

Done these steps:

brew install tcl-tk
export PATH="/usr/local/opt/tcl-tk/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/tcl-tk/lib"
export CPPFLAGS="-I/usr/local/opt/tcl-tk/include"
export PKG_CONFIG_PATH="/usr/local/opt/tcl-tk/lib/pkgconfig"
brew reinstall python

make sure version is updated:

brew info tcl-tk

Then created new environment

python3 -m venv myenv

Activate it

source myenv/bin/activate

and run the *.py test file with:

import tkinter
print(tkinter.TkVersion)

So, I moved my projects files into the new environment and issue with not recognizing image data was solved.
Thank you @rdbende for showing which way to dig =)

from ttkbootstrap.

1337haxx0r avatar 1337haxx0r commented on September 27, 2024

Yup, same issue here.
Possibly any solutions?

Traceback (most recent call last):
File "/Users/{user}/Documents/{app}/main.py", line 472, in
root = ttk.Window(themename="journal") # Create a new window with the "journal" theme
File "/Users/{user}/Documents/{app}/venv/lib/python3.9/site-packages/ttkbootstrap/window.py", line 231, in init
self._icon = tkinter.PhotoImage(master=self, data=Icon.icon)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/tkinter/init.py", line 4064, in init
Image.init(self, 'photo', name, cnf, master, **kw)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/tkinter/init.py", line 4009, in init
self.tk.call(('image', 'create', imgtype, name,) + options)
_tkinter.TclError: couldn't recognize image data

It works on Win10, as well

from ttkbootstrap.

1337haxx0r avatar 1337haxx0r commented on September 27, 2024

The version of tkinter provided in macOS is probably outdated. If the following code:

import tkinter
print(tkinter.TkVersion)

gives anything below 8.6, you should update it somehow. There instructions on it on the internet.

Appreciate your response. indeed, it is 8.5. I'll work on updating it

from ttkbootstrap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.