sudo apt-get install python3-tk
[sudo] password for lts:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
blt libtk8.6 tk8.6-blt2.5
Suggested packages:
blt-demo tk8.6 tix python3-tk-dbg
The following NEW packages will be installed:
blt libtk8.6 python3-tk tk8.6-blt2.5
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,523 kB of archives.
After this operation, 4,968 kB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://us.archive.ubuntu.com/ubuntu lunar/main amd64 libtk8.6 amd64 8.6.13-2 [776 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu lunar/main amd64 tk8.6-blt2.5 amd64 2.5.3+dfsg-4.1build2 [643 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu lunar/main amd64 blt amd64 2.5.3+dfsg-4.1build2 [4,838 B]
Get:4 http://us.archive.ubuntu.com/ubuntu lunar/main amd64 python3-tk amd64 3.11.2-2 [100 kB]
Fetched 1,523 kB in 1s (1,828 kB/s)
Selecting previously unselected package libtk8.6:amd64.
(Reading database ... 152816 files and directories currently installed.)
Preparing to unpack .../libtk8.6_8.6.13-2_amd64.deb ...
Unpacking libtk8.6:amd64 (8.6.13-2) ...
Selecting previously unselected package tk8.6-blt2.5.
Preparing to unpack .../tk8.6-blt2.5_2.5.3+dfsg-4.1build2_amd64.deb ...
Unpacking tk8.6-blt2.5 (2.5.3+dfsg-4.1build2) ...
Selecting previously unselected package blt.
Preparing to unpack .../blt_2.5.3+dfsg-4.1build2_amd64.deb ...
Unpacking blt (2.5.3+dfsg-4.1build2) ...
Selecting previously unselected package python3-tk:amd64.
Preparing to unpack .../python3-tk_3.11.2-2_amd64.deb ...
Unpacking python3-tk:amd64 (3.11.2-2) ...
Setting up libtk8.6:amd64 (8.6.13-2) ...
Setting up tk8.6-blt2.5 (2.5.3+dfsg-4.1build2) ...
Setting up blt (2.5.3+dfsg-4.1build2) ...
Setting up python3-tk:amd64 (3.11.2-2) ...
Processing triggers for libc-bin (2.37-0ubuntu2) ...
debug used to work with visual studio code after installing all the right files
pip install tk
Requirement already satisfied: tk in ./venv/lib/python3.10/site-packages (0.1.0)
2
Answers
Am also having the problem on archlinux also so I know it not the operating system I would love to get this resolve or is there a bug in the visual studio please
python3-tk
is being installed for Python 3.11 (based on its version number 3.11.2-2), but VSCode is using Python 3.10. You can see that in the bottom right of your screenshots as well as thepip
output. You can either:Switch the Python interpreter VSCode is using
Install Tkinter in your Python 3.10 environment
How to do that depends on your Python 3.10 setup. You might be able to use APT:
Secondly, PyPI’s
tk
package is not Tkinter, it’s "TensorKit". I don’t think Tkinter is even on PyPI since it’s in the standard library.