question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'Tcl wasn't installed properly' on python test workflow

See original GitHub issue

I got a couple of workflow running on a matrix of (windows, macOS, ubuntu) with python (3.7, 3.8, 3.9, 3.10). Randomly, some of the windows tests will fail when trying to show matplotlib figures with the error message:

self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
E       _tkinter.TclError: Can't find a usable init.tcl in the following directories: 
E           {C:\hostedtoolcache\windows\Python\3.7.9\x64\tcl\tcl8.6}
E       
E       C:/hostedtoolcache/windows/Python/3.7.9/x64/tcl/tcl8.6/init.tcl: couldn't read file "C:/hostedtoolcache/windows/Python/3.7.9/x64/tcl/tcl8.6/init.tcl": No error
E       couldn't read file "C:/hostedtoolcache/windows/Python/3.7.9/x64/tcl/tcl8.6/init.tcl": No error
E           while executing
E       "source C:/hostedtoolcache/windows/Python/3.7.9/x64/tcl/tcl8.6/init.tcl"
E           ("uplevel" body line 1)
E           invoked from within
E       "uplevel #0 [list source $tclfile]"
E       
E       
E       This probably means that Tcl wasn't installed properly.

Any idea how to solve this and make it work 100% of the time? It looks to me like Python is not always correctly setup by:

- task: UsePythonVersion@0
  inputs:
    versionSpec: '$(python.version)'
  displayName: 'Use Python $(python.version)'

For x-ref: https://github.com/vferat/pycrostates/pull/41

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
kirill-ivlevcommented, Oct 31, 2022

@mscheltienne it seems that it was fixed in the 3rd party library, and was not directly related to the task itself. Please feel free to re-open the issue if it still exits.

1reaction
janoshcommented, Oct 25, 2022

This discussion suggests setting the matplotlib backend prior to plotting helps:

jobs:
  tests:
    strategy:
      matrix:
        os: [ubuntu-latest, windows-latest]
    runs-on: ${{ matrix.os }}
    env:
      MPLBACKEND: Agg  # https://github.com/orgs/community/discussions/26434
     ...
Read more comments on GitHub >

github_iconTop Results From Across the Web

Python tcl is not installed properly - Stack Overflow
This probably means that Tcl wasn't installed properly. What does it mean? What can I do? PS: I am using Eclipse (PyDev) for...
Read more >
Tcl wasn't installed properly - Google Groups
I'm a frequent user of matplotlib on my Windows XP machine. I recently attempted to install a program that modified my Tcl installation,...
Read more >
List of messages - Python tracker
I'll give ActiveTcl a try to see if theirs is more stable. ... I'm not sure if it's intended to be a supported...
Read more >
Python Virtual Environments: A Primer
In this tutorial, you'll learn how to work with Python's venv module to create and manage separate virtual environments for your Python ......
Read more >
Azure pipeline is failing randomly when using `plt.subplots ...
tcl ": No error E while executing E "uplevel #0 [list source $tclfile]" E E ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found