Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mscheltienne opened this issue Jun 7, 2022 · 6 comments
Closed

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

mscheltienne opened this issue Jun 7, 2022 · 6 comments
Assignees
Labels
Area: ABTT Akvelon Build Tasks Team area of work Task: UsePythonVersion

Comments

@mscheltienne
Copy link

mscheltienne commented Jun 7, 2022

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: vferat/pycrostates#41

@max-zaytsev max-zaytsev added Area: ABTT Akvelon Build Tasks Team area of work Task: UsePythonVersion and removed triage route labels Jun 8, 2022
@kirill-ivlev kirill-ivlev self-assigned this Jun 17, 2022
@hodgestar
Copy link

We see the same in QuTiP's builds on Windows, e.g. https://github.com/qutip/qutip/runs/7696687924. It's mysterious to me how its possible that only some workers don't have Python Tcl installed correctly.

@janosh
Copy link

janosh commented Oct 25, 2022

Having the same problem over at https://github.com/janosh/pymatviz (CI run). Curious if anyone has a hypothesis why this is flaky.

@janosh
Copy link

janosh commented 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
     ...

@wpbonelli
Copy link

similar solution worked for me @janosh, resolved Tcl-related flakiness on mac by selecting a non-interactive backend

@kirill-ivlev
Copy link
Contributor

@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.

@leoniewgnr
Copy link

I encounter the same problem in our test pipeline: https://github.com/ourownstory/neural_prophet/actions/runs/5626902294/job/15248585543?pr=1377
What can I do to resolve this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: ABTT Akvelon Build Tasks Team area of work Task: UsePythonVersion
Projects
None yet
Development

No branches or pull requests

7 participants