This probably means that tcl wasn t installed properly

This probably means that tcl wasn t installed properly

Сбой PyInstaller в Windows 7: «Не удается найти пригодный файл init.tcl»

У меня есть базовый скрипт Python, который использует Tkinter.

После компиляции сценария с помощью PyInstaller я попытался запустить свою программу на компьютере с Windows 7 (64-разрядная версия), на котором не установлен Python.

Это подняло эту ошибку:

Почему мой скрипт не может найти init.tcl после компиляции с PyInstaller?

3 ответа

Это известная проблема с PyInstaller и Tkinter на 64-битных машинах Windows 7. В репозитории PyInstaller на GitHub есть отчет о проблеме.

В нижней части этой проблемы упоминалась другая проблема, а именно эта, которая говорит, что переход на PyInstaller 3.1.0 помогает другим людям решить проблему.

Я сам смог подтвердить это с помощью виртуальной машины.

Как упоминал RedPhantom, у PyInstaller есть известная проблема с приложениями Tkinter в Windows 7 и Windows XP.

Поскольку эта проблема не устранена в течение двух лет, я пошел вперед и учредил награду за Bountysource. Пока проблема не будет устранена, есть несколько обходных путей, которые вы можете попробовать:

Как упоминалось в связанной проблеме, вы можете вручную скопировать недостающие файлы из локального Python установка.

Однако обратите внимание, что запуск в режиме одного файла увеличит время запуска.

Согласно ugoertz, снижение до PyInstaller 3.1.0 решило проблему.

Понижение до 3.1.0 (а также понижение setuptools до 19.2 из-за проблемы, описанной в # 1941 ) исправил проблему для меня.

В вашем случае вы обнаружите, что в каталоге python есть папка Tcl8.X, которая находится в месте, которое не упомянуто в [списке каталогов], о котором вы упоминали в своем вопросе. Просто выберите любой из путей из этих списков каталогов (предпочтительно / lib).

Это позволит Python находить файлы библиотеки Tcl, и это будет работать.

Примечание: НЕ ПЕРЕМЕЩАЙТЕ ФАЙЛЫ, ПРОСТО КОПИРУЙТЕ ИХ.

This probably means that tcl wasn’t installed properly. #5969

Comments

pokemonchw commented Jul 5, 2021

Description of the issue

The windows environment of the user is windows10(Traditional Chinese), currently, in the feedback received, if and only if the packaged program runs in the environment of this part of users, there will be «This probably means that Tcl wasn‘t installed properly»

Context information (for bug reports)

Version of Python: 3.9.5

Platform: Windows Server 2019

How you installed Python: githun action virtual-env

Did you also try this on another platform? Does it work there?
No other feedback has been received so far. It works well in simplified Chinese, English, Japanese and other language areas.

try the latest development version, using the following command:

Make sure everything is packaged correctly

A minimal example program which shows the error

Stacktrace / full error message`

The text was updated successfully, but these errors were encountered:

bwoodsend commented Jul 5, 2021 •

Can we have an example workflow? I see a tkinter onefile application which is presumably hitting unicode issues.

rokm commented Jul 5, 2021 •

This indeed looks like filesystem encoding issue with username containing Chinese characters.

But I’m not sure the problem is on PyInstaller’s side (e.g., bootloader mangling the path), because if that was the case, the _tkinter rthook would have errored out (due to «missing» tcl or tk dirs) before the entry-point script is ran. So considering the program made it to Tcl initialization, this could also be a problem with Tcl/Tk itself.

@pokemonchw, can you set up a Traditional Chinese machine where the frozen application fails, and then install python (make sure it is installed in user’s directory) and then check if the original unfrozen application works? In particular, we want you to test whether Python, tkinter, and Tcl/Tk themselves work on a Traditional Chinese system, when installed in a path that contains those Chinese characters.

Tcl wasn’t installed properly

Steve

I’m a frequent user of matplotlib on my Windows XP machine. I
recently attempted to install a program that modified my Tcl
installation, and I now get an error message when I attempt to plot
anything in matplotlib. Here is the error message:

Traceback (most recent call last):
File » «, line 1, in
File «C:\Python25\lib\lib-tk\Tkinter.py», line 3758, in _test
root = Tk()
File «C:\Python25\lib\lib-tk\Tkinter.py», line 1647, in __init__
self.tk = _tkinter.create(screenName, baseName, className,
interactive, want
objects, useTk, sync, use)
_tkinter.TclError: Can’t find a usable init.tcl in the following
directories:
\tcl8.3> ram Files/Tcl/lib/tcl8.4> C:/Python25/lib/tcl8.4 C:/lib/tcl8.4 C:/
library

This probably means that Tcl wasn’t installed properly.

Advertisements

I’m a frequent user of matplotlib on my Windows XP machine. I
recently attempted to install a program that modified my Tcl
installation, and I now get an error message when I attempt to plot
anything in matplotlib. Here is the error message:

Traceback (most recent call last):
File » «, line 1, in
File «C:\Python25\lib\lib-tk\Tkinter.py», line 3758, in _test
root = Tk()
File «C:\Python25\lib\lib-tk\Tkinter.py», line 1647, in __init__
self.tk = _tkinter.create(screenName, baseName, className,
interactive, want
objects, useTk, sync, use)
_tkinter.TclError: Can’t find a usable init.tcl in the following
directories:
\tcl8.3> ram Files/Tcl/lib/tcl8.4> C:/Python25/lib/tcl8.4 C:/lib/tcl8.4 C:/
library

This probably means that Tcl wasn’t installed properly.

I attempted a complete reinstall of python (hoping it would reinstall
Tcl with correct file paths), but I get the same error. Any
suggestions would be appreciated.
Thanks!

Steve

Steve

anurikaokoli

I figured out the solution. The program I installed must have changed
my windows path names. I changed TCL_LIBRARY and TK_LIBRARY to the
location of my tcl installation, and it works fine now.

Python Tkinter throwing Tcl error

I am learning basic GUI in Python, and I came across a sample example to read file name from file explorer on Stack Overflow.

This particular script is working fine when I am trying to run it in IDLE, but the same is not running if I am trying from command prompt in windows 7.

Python Version: 2.7. Here is the output error which I get.

Any pointer to what I am missing here can be of great help.

8 Answers 8

Trending sort

Trending sort is based off of the default sorting method — by highest score — but it boosts votes that have happened recently, helping to surface more up-to-date answers.

It falls back to sorting by highest score if no posts are trending.

Switch to Trending sort

You just need to copy two folders from tcl folder to the Lib folder

In case you are using Virtualenv on Windows I found a solution here: https://github.com/pypa/virtualenv/issues/93

I copied the «tcl» folder from C:\Python27\ over to the root of the new Virtualenv, Tkinter.Tk() shows a new window without throwing an exception.

I am running Python 2.7 on Windows 7.

I hit the same problem on Ubuntu 17.04 with virtualenvwrapper for 64 bit Python 2.7

I add tk and tcl library paths in local postactivate script

Locate tk and tcl library paths. In postactivate script, export TK_LIBRARY and TCL_LIBRARY with appropriate paths. Add this lines to your script with modified paths:

TK_LIBRARY=/home/kamil/anaconda2/pkgs/tk-8.5 TKPATH=/home/kamil/anaconda2/pkgs/tk-8.5 TCL_LIBRARY=/home/kamil/anaconda2/lib/tcl8.5 export TCL_LIBRARY TK_LIBRARY TKPATH

Python tcl is not installed properly

I just installed graphics.py for python. But when I tried to run the following code:

my interpreter gave me this strange information:

This probably means that Tcl wasn’t installed properly.

What does it mean? What can I do?

PS: I am using Eclipse (PyDev) for coding.

This probably means that tcl wasn t installed properly. Смотреть фото This probably means that tcl wasn t installed properly. Смотреть картинку This probably means that tcl wasn t installed properly. Картинка про This probably means that tcl wasn t installed properly. Фото This probably means that tcl wasn t installed properly

9 Answers 9

Trending sort

Trending sort is based off of the default sorting method — by highest score — but it boosts votes that have happened recently, helping to surface more up-to-date answers.

It falls back to sorting by highest score if no posts are trending.

Switch to Trending sort

I sloved by modifying my activate script:

This probably means that tcl wasn t installed properly. Смотреть фото This probably means that tcl wasn t installed properly. Смотреть картинку This probably means that tcl wasn t installed properly. Картинка про This probably means that tcl wasn t installed properly. Фото This probably means that tcl wasn t installed properly

If editing the file does not work for you, you can download and install the latest Tcl from:

Regarding what it means, without more information, I can only make conjectures right now. I had the reverse problem; I will tell you about it in hopes that it gives you some insight into what it might mean.

My guess is that the 8.5.2 requirement came from the regular python install (which is apparently less grepable), or some package I installed later. Running the ActiveState msi in repair mode does not fix the issue, nor does running the Python msi in repair mode.

P.S If this isn’t timely, why did I still answer? Crafting a decent answer for you helped me understand my issue better.

Источники информации:

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *