i know there have already been many such questions asked on this forum but i couldnt find any that helped my particular case.
i am trying to install tkinter(and some other packages) using pip install on windows 10 cmd. but it gives the error
pip install tkinter
Could not find a version that satisfies the requirement tkinter (from
versions: )
No matching distribution found for tkinter
how do i install it? i get the same error for some other packages too. what is the solution that works for any and all future packages i install?
asked Feb 27, 2019 at 12:45
1
When installing packages with pip
, it automatically collects any dependencies of these packages, if they aren’t already installed. For example, if you install SciPy
and you haven’t installed NumPy
, pip will automatically install NumPy
, because it is listed in SciPy
‘s dependencies.
The error you got happens, when one of the listed requirements of the package you want to install is not availible. This can have a number of causes:
-
The required package is not availible on PyPi.
-
The required package or the package you want to install is not compatible with your version of python.
-
You typed the wrong package name.
When i try pip install tkinter
, i get the same error. The reason for that is that tkinter is already included in the python standard library (at least for python 3.x). You shouldn’t have to install it. You can verify that tkinter is working by a simple example like
import tkinter as tk
root = tk.Tk()
root.mainloop()
answered Feb 27, 2019 at 12:49
4
если версия python 2.7 к примеру то там надо писать Tkinter а не tkinter
- Ссылка
по дефолту он всегда есть, какая версия python то?
- Ссылка
плюсую товарища выше — ты установил python-tk, а он для второго питона. python3-tk нужно
gnunixon ★★★
(27.10.20 23:10:30 MSK)
- Показать ответ
- Ссылка
На будущее. Что бы не возникало казусов вроде смешивания пакетов python-tk и python3-tk, устанавливай питоновские пакеты через pip, а не через системный менеджер пакетов.
Aswed ★★★★★
(28.10.20 11:26:30 MSK)
- Показать ответ
- Ссылка
Ответ на:
комментарий
от fsb4000 27.10.20 22:59:05 MSK
Спасибо вам большое! Работает!!!!!!
mike15
(28.10.20 14:43:57 MSK)
- Ссылка
Ответ на:
комментарий
от Aswed 28.10.20 11:26:30 MSK
устанавливай питоновские пакеты через pip, а не через системный менеджер пакетов.
Совет от debiloida и полнейшего idiotes.
anonymous
(28.10.20 15:20:28 MSK)
- Показать ответ
- Ссылка
Ответ на:
комментарий
от anonymous 28.10.20 15:20:28 MSK
Куда уж мне до анонимусов на лоре. Смотри не увлекайся коментами, а то на математику опоздаешь.
Aswed ★★★★★
(29.10.20 12:22:12 MSK)
- Ссылка
Ответ на:
комментарий
от gnunixon 27.10.20 23:10:30 MSK
$ sudo python3 -m pip install python3-tk
...
ERROR: Could not find a version that satisfies the requirement python3-tk (from versions: none)
ERROR: No matching distribution found for python3-tk
Можете подсказать, ЧЯДНТ?
zad1ra
(29.10.20 17:35:26 MSK)
Последнее исправление: zad1ra 29.10.20 17:35:56 MSK
(всего
исправлений: 1)
- Показать ответ
- Ссылка
29 июля 2022 г.
Ответ на:
комментарий
от zad1ra 29.10.20 17:35:26 MSK
Аналогичная проблема. Линукс вот какой:
root@porteus:/tmp# uname -a
Linux porteus 4.9.0-porteus #1 SMP PREEMPT Sun Dec 18 16:24:27 Local time zone must be set-- i686 Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz GenuineIntel GNU/Linux
Как это лечить?
- Показать ответ
- Ссылка
Ответ на:
комментарий
от senglory 29.07.22 19:29:47 MSK
Ответ на:
комментарий
от vvn_black 29.07.22 21:30:59 MSK
Неа, не помогло:
root@porteus:/tmp# pip install tk
Collecting tk
Downloading tk-0.1.0-py3-none-any.whl (3.9 kB)
Installing collected packages: tk
Successfully installed tk-0.1.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
root@porteus:/tmp# pip install python3-tk
ERROR: Could not find a version that satisfies the requirement python3-tk (from versions: none)
ERROR: No matching distribution found for python3-tk
root@porteus:/tmp#
- Показать ответ
- Ссылка
Ответ на:
комментарий
от senglory 29.07.22 23:30:13 MSK
Ответ на:
комментарий
от vvn_black 29.07.22 23:31:21 MSK
Но python3-tk как не ставился , так и сейчас не ставится. Что у меня неправильно сделано?
- Показать ответ
- Ссылка
Ответ на:
комментарий
от senglory 29.07.22 23:35:53 MSK
Извинения, я затупил. Дистрибутивный python должен быть собран с поддержкой tk.
vvn_black ★★★★★
(29.07.22 23:48:40 MSK)
Последнее исправление: vvn_black 29.07.22 23:56:57 MSK
(всего
исправлений: 1)
- Ссылка
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.
Sometimes you get an error when you’re trying to install a Python package
using pip. It looks like this:
Could not find a version that satisfies the requirement (from versions:)
No matching distribution found for
Some probable reasons for this error are:
-
PyPI server isn’t responding to your requests. It can happen either because
the PyPI server is down or because it has blacklisted your IP address. This
happened to me once when I was trying installing packages on a server.
This can be fixed by using a proxy with pip. See the solution below. -
You’re running an older pip (especially on Mac). This can be fixed by
upgrading your pip.
See this post on Stack Overflow.
Thanks to Anupam Jain who pointed this in a comment. -
The package you’re trying to install is not available for your Python version.
-
The package is not available for your operating system. This is a rare case
and only happens when the package is not pure-Python, i.e. it’s been
partially written in C or Cython. Such a package needs to be compiled for
every operating system (Windows/Mac/Linux) and architecture (32-bit/64-bit).
Suppose a package has only been compiled for Windows 64-bit, then you’ll get
this error if you try to install it on Windows 32-bit, or any other
OS. -
The package is not present on PyPI server. In this case pip will not work. So
you’ll have to download and install the package manually from Github or wherever
it is available.
Solution¶
I had this issue because PyPI server had blacklisted the IP
of my hosting provider, the obvious solution was to make pip
install via a proxy.
But to see if that’s also the case with you, you can test it like this:
$ curl https://pypi.org
The requestors Network has been blacklisted due to excessive request volume.
If you are a hosting customer, please contact your hosting company's support.
If you are the hosting company, please contact infrastructure-staff@python.org to resolve
If you see the message similar to above, that means your IP has also been
blacklisted by https://pypi.org.
If you don’t see this message then the reason for the pip error could be that you’re using
an older version. See this post on Stack Overflow
for a solution.
Anyways, this can be fixed by using a proxy with pip.
Supplying a proxy address to pip
is easy:
$ pip install -r requirements.txt --proxy address:port
Above, address
and port
are IP address and port of the proxy.
To find proxies, just search Google for proxy list.
Other things that I tried¶
These are some other things that I tried to get rid of this issue.
Although they didn’t work for me, but they might work for you.
- Changing DNS resolver of my server.
This makes sense if your server’s DNS resolver can’t find PyPI servers. - Reconfiguring SSL, reinstalling CA certificates.
This makes sense if you don’t have updated CA certificates which are used by
PyPI servers. - Downloading packages using
wget
.
This is an alternative way to install Python packages. Download them viawget
and then install them usingpython setup.py install
. In my case, the server was
blacklisted by PyPI so I was getting a 403 Forbidden error. - Downloading packages using
curl
.
Alternative towget
. In my case I didn’t get a 403 error but rather it just
created invalid tarball files, instead of actually downloading them. - Downloading packages using
git
orhg
.
If your desired packages havegit
orhg
repositories that you can clone, this
is a good workaround.
Posts: 382
Threads: 94
Joined: Mar 2017
Reputation:
-12
© 2017 Microsoft Corporation. All rights reserved.
C:WINDOWSsystem32>pip install tkinter
Collecting tkinter
Could not find a version that satisfies the requirement tkinter (from versions: )
No matching distribution found for tkinter
C:WINDOWSsystem32>
Hi all ! Is there somebody that can help me. The file worked well with linux, and I should like it does the same with windows. Windows does not find the module tkinter. As you see above, I cannot install tkinter. I use Pycharm, my interpreter is python 3.6.
Posts: 3,885
Threads: 56
Joined: Jan 2018
Reputation:
307
I think tkinter is included in python, you don’t need to install it. Try the statement import tkinter
in the python interpreter. If there is no error message, it means that you already have tkinter.
Posts: 7,842
Threads: 148
Joined: Sep 2016
Reputation:
572
tkinter is included by default in the windows python distribution
sylas
Minister of Silly Walks
Posts: 382
Threads: 94
Joined: Mar 2017
Reputation:
-12
I found tkinter in C:Program FilesPython36Libtkinter…………….and I tried to import it. I got this message:
The project at C:Program FilesPython36Libtkinter uses a non-standard layout and cannot be attached to this project. Would you like to open it in a new window? …y/n ?
What do I reply ? yes or no ? Thanks
Posts: 7,842
Threads: 148
Joined: Sep 2016
Reputation:
572
(Feb-14-2018, 09:03 AM)sylas Wrote: I tried to import it.
how do you try to import it?
try to run this minimal application
import tkinter as tk class Application(tk.Frame): def __init__(self, master=None): super().__init__(master) self.pack() self.create_widgets() def create_widgets(self): self.hi_there = tk.Button(self) self.hi_there["text"] = "Hello Worldn(click me)" self.hi_there["command"] = self.say_hi self.hi_there.pack(side="top") self.quit = tk.Button(self, text="QUIT", fg="red", command=root.destroy) self.quit.pack(side="bottom") def say_hi(self): print("hi there, everyone!") root = tk.Tk() app = Application(master=root) app.mainloop()
https://docs.python.org/3/library/tkinter.html#a-simple-hello-world-program
Posts: 11,566
Threads: 446
Joined: Sep 2016
Reputation:
444
run python3 from command line and see if you can import tkinter.
Your python may be defaulting to python 2.7
in 2.7 it’s import Tkinter with capital ‘T’
You might have messed up your version by running pip.
Also, I believe there are still some versions of python that
don’t automatically install it.
Posts: 7,842
Threads: 148
Joined: Sep 2016
Reputation:
572
OP clearly has python 3.6 with tkinter, based on path C:Program FilesPython36Libtkinter
based on error The project at C:Program FilesPython36Libtkinter uses a non-standard layout and cannot be attached to this project I think when OP says he is trying to import tkinter they are actually trying to include tkinter folder to PyCharm project, but that is just wild guess
sylas
Minister of Silly Walks
Posts: 382
Threads: 94
Joined: Mar 2017
Reputation:
-12
I tried Buran’s file. Always my PC cannot find the module tkinter. All my projects come from my 32bits old PC. I put the project from the USB key into my 64bits PC.First I create a new Project with a name about the same as my old project. Then I import my ancient project with just : File>Open>OK. All files are there,ready to go, and all of them work well, except those with tkinter and pygame….Something I don’t like: when I choose the interpreter I have about 10 different python3.6, all of them with the suffix venv. As i know nothing about vitual environment it is not pleasant to choose a venv, but I cannot do otherwise.
Posts: 7,842
Threads: 148
Joined: Sep 2016
Reputation:
572
Don’t try it from within PyCharm. Just open Notepad, paste my code, save the file as hello.py, then open command prompt, change CWD to folder where hello.py is and type in cmd prompt python hello.py
sylas
Minister of Silly Walks
Posts: 382
Threads: 94
Joined: Mar 2017
Reputation:
-12
Thanks Buran. I opened Notepad, I saved «hello.py», after that I am lost. «Open command prompt», do you mean terminal ? «Change CWD to folder», there I don’t know «CWD». Explain please.
-
#4
Проблема возникла на windows 10
Я ввел import tkinter as tk но это не помогло и выдало ошибку:
Traceback (most recent call last):
File «C:PYTHONTkinterCourse.py», line 9, in <module>
window = tk()
TypeError: ‘module’ object is not callable
вот сам код если что:
Python:
# My Project
import tkinter as tk
from tkinter import *
#key down function
##### main:
window = tk()
сам модуль у меня действительно установлен
версия python 3.8
Последнее редактирование: Апр 19, 2020
-
#7
спасибо огромное! очень помогли
Tkinter
Tkinter – это графическая библиотека на основе Tk, которая входит в стандартную библиотеку Python. Tk является библиотекой базовых элементов графического интерфейса для языка Tcl.
python-scripts.com
хорошо расписанные уроки по tkinter, можете еще их посмотреть
Люди: у меня похожая проблема — не устанавливается «tkinter»:
Кликните здесь для просмотра всего текста
pip install tkinter
ERROR: Could not find a version that satisfies the requirement tkinter (from versions: none)
ERROR: No matching distribution found for tkinter
Я занялся изучением «Python», и пробуя установить среду использовал следующие варианты:
«Anaconda» — «tkinter» не ставится.
«python-3.6.0» (для моей Windows 7) — в командной строке отказался устанавлявать библиотеки, «почитав» выяснил — что нужно виндовую командную строку (FarComander не прокатил)(а «Anaconda» нормально в своей строке ставила); и здесь получил ошибки на «pip install pyautogui»:
Кликните здесь для просмотра всего текста
***Running setup.py install for pyautogui … done
ERROR: pip’s dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
mouseinfo 0.1.3 requires Pillow<=3.4.2,>=2.0.0; python_version == «3.2», but you have pillow 8.3.2 which is incompatible.
mouseinfo 0.1.3 requires Pillow<=4.3.0,>=2.0.0; python_version == «3.3», but you have pillow 8.3.2 which is incompatible.
mouseinfo 0.1.3 requires Pillow<=5.4.1,>=2.5.0; python_version == «3.4», but you have pillow 8.3.2 which is incompatible.
Successfully installed Pillow***
и ту-же ошибку на «pip install tkinter».
— Может этого пакета вообще нету? Может его переименовали? Или мне пакет для игр ставить ?
Добавлено через 14 минут
Вычитал что «tkinter» уже установлен в системе (у меня семёрка) и инсталлировать его не надо — а просто подключить:
import tkinter
Анаконда
на это выдала:
Кликните здесь для просмотра всего текста
Имя «import» не распознано как имя командлета, функции, файла скрипта или выпол
няемой программы. Проверьте правильность написания имени, а также наличие и пра
вильность пути, после чего повторите попытку.
строка:1 знак:7
+ import <<<< tkinter
+ CategoryInfo : ObjectNotFound: (import:String) [], CommandNotFo
undException
+ FullyQualifiedErrorId : CommandNotFoundException
— что это значит?