티스토리 뷰
Stack Overflow에 자주 검색, 등록되는 문제들과 제가 개발 중 찾아 본 문제들 중에서 나중에도 찾아 볼 것 같은 문제들을 정리하고 있습니다.
Stack Overflow에서 가장 먼저 확인하게 되는 가장 높은 점수를 받은 Solution과 현 시점에 도움이 될 수 있는 가장 최근에 업데이트(최소 점수 확보)된 Solution을 각각 정리하였습니다.
아래 word cloud를 통해 이번 포스팅의 주요 키워드를 미리 확인하세요.
How to pip or easy_install tkinter on Windows
Windows에서 tkinter를 pip 또는 easy_install로 어떻게 설치하는가?
문제 내용
My Idle is throwing errors that and says tkinter
can't be imported.
내 Idle에서는 tkinter를 가져올 수 없다는 오류가 발생합니다.
Is there a simple way to install tkinter
via pip
or easy_install
?
pip 또는 easy_install을 사용하여 tkinter를 간단하게 설치하는 방법이 있을까요?
There seem to be a lot of package names flying around for this...
이에 대한 많은 패키지 이름이 존재하는 것 같습니다.
This and other assorted variations with tkinter-pypy
aren't working.
하지만 tkinter-pypy 등의 여러 변형들은 작동하지 않습니다.
pip install python-tk
I'm on Windows with Python 2.7 and I don't have apt-get
or other system package managers.
저는 Python 2.7을 사용하는 Windows에서 작업하고 있으며, apt-get이나 기타 시스템 패키지 관리자를 사용할 수 없습니다.
높은 점수를 받은 Solution
The Tkinter library is built-in with every Python installation. And since you are on Windows, I believe you installed Python through the binaries on their website?
Tkinter 라이브러리는 Python 설치와 함께 내장되어 있습니다. 그리고 Windows에서 Python을 바이너리로 설치한 것 같은데요?
If so, Then most probably you are typing the command wrong. It should be:
그렇다면, 아마도 명령어를 잘못 입력하신 것 같습니다.
import Tkinter as tk
Note the capital T at the beginning of Tkinter.
아래와 같이 대문자 T로 시작해야 합니다.
For Python 3,
파이썬 3의 경우,
import tkinter as tk
가장 최근 달린 Solution
I came here looking for an answer to this same question and none of the answers above actually answer the question at all!
저 또한 이 질문에 대한 답변을 찾아 이곳에 왔지만, 위 답변들은 질문에 대한 답변이 아닌 것 같습니다!
So after some investigation I found out: there is a package (for python 3.x at least):
그래서 제가 조사한 결과, 3.x용 패키지가 있습니다:
pip3 install pytk
The problem is, it is only the python part of the equation and doesn't install the tkinter libraries in your OS, so the answer is that you can't install it completely via pip https://tkdocs.com/tutorial/install.html
문제는, 이것은 OS에 tkinter 라이브러리를 설치하지 않고도 Python 부분만 설치한다는 것입니다. 따라서, pip를 통해 tkinter를 완전하게 설치할 수 없다는 것입니다.
https://tkdocs.com/tutorial/install.html
Personally I find this very annoying as i'm packaging a python application to be installed via pip that uses tkinter and I was looking for a way to have pip ensure that tkinter is installed and the answer is I can't I have to instruct users to install it if it's not installed already, a very poor experience for end users who should not need to know or care what tkinter is to use my application.
개인적으로, tkinter를 사용하는 Python 응용 프로그램을 패키징하여 pip를 통해 설치하는 경우에 tkinter가 설치되어 있는지 확인하도록 pip에 지시하는 방법을 찾고 있었는데, tkinter를 사용하지 않는 일반 사용자도 제 애플리케이션을 사용하기 위해서 tkinter를 설치해야 한다는 것은 매우 불편한 경험이라고 생각합니다.
출처 : https://stackoverflow.com/questions/20044559/how-to-pip-or-easy-install-tkinter-on-windows
'개발 > 파이썬' 카테고리의 다른 글
파이썬 판다스에서 데이터프레임을 두 개 이상의 열(column)로 정렬하기 (0) | 2023.02.20 |
---|---|
groupby를 사용하여 그룹 내에서 최대 값을 가진 행을 가져오는 방법 (0) | 2023.02.20 |
pip를 사용하여 Scipy 설치할 때 오류 수정하기 (0) | 2023.02.19 |
두 개의 딕셔너리를 연결하여 새로운 딕셔너리를 만들기 (0) | 2023.02.18 |
파이썬에서 문자열을 파일로 래핑하기 (0) | 2023.02.18 |