Tkinter install python 3

Tkinter install python 3

How can I install tkinter for both python 3.4 and python 3.5?

How can I install tkinter for both python 3.4 and python 3.5?

Currently, tkinter is installed for python 3.4 (i.e., runs fine in the python 3.4 interpreter). However I don't know how to install tkinter for python 3.5.

doesn't work: it says is already installed (which is unsurprising since it is installed for python 3.4).

I use Ubuntu 14.04.4 LTS x64.


python3.4:

python3.5:

As a side note, restinstalling the package doesn't change the situation (i.e., afterward tkinter works in python 3.4 and not in python 3.5):

Python 3.4.1 2014 Download Release Notes. Python 3.4.0 March 17, 2014 Download Release Notes. Python 3.3.5 March 9, 2014 Download Release Notes. Python 3.3.4. 2019 · Install Tkinter for Python (for Windows): Firstly download the Community Edition of ActivePython for Windows and make sure you're downloading a 3.1 or newer version, not a 2.x version. After downloading run the installer, and follow along. This will end up with a fresh install of ActivePython, located in, e.g. C:\python32. Go to the Windows.

install tkinter for python 3.7.3 in Ubuntu 18.04

When I import tinker in python 3.7.3 on Ubuntu 18.04:

I got:

Then I install tk using both of the following:

It didn't work.

I also did all the things in Tkinter module not found on Ubuntu, still didn't work. I noticed that when I do:

It says:

Is tk automatically installed under python 3.6.9? How can I fix this?

I also saw a solution from https://wiki.python.org/moin/TkInter:

If it fails with "No module named _tkinter", your Python configuration needs to be modified to include this module (which is an extension module implemented in C). Do not edit Modules/Setup (it is out of date). You may have to install Tcl and Tk (when using RPM, install the -devel RPMs as well) and/or edit the setup.py script to point to the right locations where Tcl/Tk is installed. If you install Tcl/Tk in the default locations, simply rerunning "make" should build the _tkinter extension.

Could someone explain to do how to do the steps mentioned in this paragraph?

Swampy: Installation Instructions

These instructions are no longer up to date. Here is the updated page.
Tkinter Install Python 3
Subscribe to RSS
Tkinter Install Python 3
If you have Python and Tkinter, you can install Swampy from the Python Package Index.

If you need help installing Swampy, Tkinter or Python, see the detailed instructions below. These instructions are a work in progress; if you have suggestions for improvement, let me know.

The following instructions are for Python 2. Swampy for Python 3 is available (see the bottom of this page), but it is not supported.

Once you have Swampy installed, try out some of the examples is this tutorial.

Linux

  1. Install Python

    To see if you already have Python, open a terminal (Applications->Accessories->Terminal) and type on the Linux command line. You should see something like this:

    Python 2.6.4 (r264:75706, Dec 7 2009, 18:45:15) >>>

    If so, you have Python. If the version number starts with 2, you have Python 2, which is the version of Python used in Think Python. If the version number starts with 3, you have Python 3. You will not be able to use Swampy with Python 3.

    To install Python on Ubuntu, run

    sudo apt-get install python python-tk

    Or for Python 3

    sudo apt-get install python python3-tk

    Or use the Synaptic Package Manager to install "python" and "python-tk".

    For other distributions, you can find instructions at python.org. You should install the latest version of Python 2 (but anything after 2.4 should work).

  2. Install Tkinter

    To see if you have Tkinter, type on the Linux command line. Then at the Python prompt, type

    >>> import Tkinter

    Or in Python 3

    >>> import tkinter

    If you have Tkinter, Python will not print an error message and you can go on to the next section.

    Otherwise you will see something like this:

    ImportError: No module named Tkinter

    In that case, you have to install Tkinter. On Ubuntu, you can run

    sudo apt-get install python-tk

    Or for Python 3

    sudo apt-get install python python3-tk Or use the Synaptic Package Manager to install "python-tk".

    For other distributions, you can get more information from the Tkinter wiki.

  3. Install Swampy

    To see if you have Swampy, type on the Linux command line. Then at the Python prompt, type

    >>> import swampy.TurtleWorld If you have Swampy, Python will not print an error message and you are all set. Enjoy the book!

    Otherwise you will see something like this:

    ImportError: No module named swampy.TurtleWorld

    In that case, you have to install it. If you have pip installed, you can install swampy like this:

    sudo pip install swampy

    If that doesn't work, or you don't have pip, you can download the zip file from the Cheese Shop and and unzip it. Cd into the directory it creates and run this command:

    sudo python setup.py install

    If that doesn't work, try the instructions for installing packages from the Cheese Shop here.

    If you follow their instructions for Distutils, you might need to know how to "extract the distribution." Download the zip file. Make sure you are in the directory where you downloaded the file and type

    unzip swampy-*.zip Then cd into the directory it creates: cd swampy-x.x.x You have to replace the x's with the version number, or use tab-completion to avoid typing it.

    Finally, run the installer according to the instructions in the tutorial.

Macintosh

  1. Install Python

    According to python.org,

    Python comes pre-installed on Mac OS X, but due to Apple's release cycle, it's often one or even two years old. The overwhelming recommendation of the "MacPython" community is to upgrade your Python by downloading and installing a newer version from the Python standard release page.
    Follow these instructions to install a current version of Python. You should install the latest version of Python 2 (but anything after 2.4 should work).
  2. Install Tkinter

    To see if you have Tkinter, launch ; then at the Python prompt, type

    >>> import Tkinter

    Or in Python 3

    >>> import tkinter

    If you have Tkinter, Python will not print an error message and you can go on to the next section.

    Otherwise you will see something like this:

    ImportError: No module named Tkinter

    In that case, you have to install Tkinter. You can follow these instructions from python.org.

  3. Install Swampy

    To see if you have Swampy, launch ; then at the Python prompt, type

    >>> import swampy.TurtleWorld If you have Swampy, Python will not print an error message and you are all set. Enjoy the book!

    Otherwise you will see something like this:

    ImportError: No module named swampy.TurtleWorld

    In that case, you have to install it. If you have pip installed, you can install Swampy in a command terminal like this:

    pip install swampy Or if that doesn't work, try: sudo pip install swampy

    If that doesn't work, or you don't have pip, you can download the zip file from the Cheese Shop and and unzip it. In a command terminal,

    cd into the directory it creates and run this command: sudo python setup.py install

    If that doesn't work, try the instructions for installing packages from the Cheese Shop here.

    If you follow their instructions for Distutils, you might need to know how to "extract the distribution." Download the zip file. Make sure you are in the directory where you downloaded the file and type

    unzip swampy-*.zip Then cd into the directory it creates: cd swampy-x.x.x You have to replace the x's with the version number, or use tab-completion to avoid typing it.

    Finally, run the installer according to the instructions in the tutorial.

Windows

Thanks to Jaymie for help improving these instructions. If you have suggestions for additional improvements, please let me know.
  1. Install Python

    For instructions on running Python under Windows, see the Python Windows FAQ.

    To run Python from the Command Prompt, you need to add the folder that contains Python to the list of folders Windows searches for commands. The name of the folder is probably or .

    To add this folder to the search path, select Control panel -> system -> advanced -> Environmental Variables -> system variables -> Path. Add or to the end of the list (with a semi-colon as a separator).

    Now if you restart the command window, you should be able to type at the prompt and launch Python.

  2. Install Tkinter

    To see if you have Tkinter, launch ; then at the Python prompt, type

    >>> import Tkinter

    Or in Python 3

    >>> import tkinter

    If you have Tkinter, Python will not print an error message and you can go on to the next section.

    Otherwise you will see something like this:

    ImportError: No module named Tkinter

    In that case, you have to install Tkinter. You can download the ActiveTcl Community Edition from ActiveState, which should provide Tkinter. If that doesn't work, there is more general information about Tkinter here.

  3. Install Swampy

    To see if you have Swampy, launch ; then at the Python prompt, type

    >>> import swampy.TurtleWorld If you have Swampy, Python will not print an error message and you are all set. Enjoy the book!

    Otherwise you will see something like this:

    ImportError: No module named swampy.TurtleWorld

    In that case, you have to install it. If you have pip installed, you can install swampy like this:

    cd C:/Python/Scripts/ pip.exe install swampy

    If you don't have pip, I recommend that you install it. There are instructions here.

    If you still don't have pip, you can download the Swampy zip file from the Cheese shop. Unzip it, then cd into the directory it creates and run:

    python setup.py install

    Again, launch Python and see if you can import swampy.TurtleWorld. If so, you are all set. If not, let me know what went wrong and I will continue to improve these instructions.

    Additional instructions for installing packages from PyPI are here.

Python 3

Swampy for Python 3 is not available as a package. But the source code is available in a zip file:

Swampy source for Python 3: swampy-2.1.5.python3.zip

The simplest way to use this code is to unzip it in your home directory, cd into the unzipped directory and work there. Or you can put it any place you like, then add the new directory to the Python search path.

Either way, you should be able to import Swampy modules, but instead of specifying the package and module like this:

from swampy.TurtleWorld import * You would just specify the module, like this: from TurtleWorld import * Swampy for Python 3 is relatively new, so please let me know if you run into problems.

Back to the Swampy Home Page

Tkinter Install Python 3
Tkinter Install Python 3

Are you using Swampy in a class?

We'd like to know about it. Please consider filling out this short survey.

Think DSP

Tkinter Install Python 3

Tkinter Install Python 3
Tkinter Install Python 3

Think Java

Tkinter Install Python 3

Tkinter Install Python 3
Tkinter Install Python 3

Think Bayes

Think Python 2e

Think Stats 2e

Think Complexity

Share this post: