John Lavelle
John Lavelle

Reputation: 87

How do I install tkinter on Ubuntu for two separate versions of Python 3?

I have two versions of Python 3 installed on Ubuntu 14.04, 3.4 and 3.5, I'd like to install tkinter for both.

When I use apt-get install python3-tk, tkinter is only installed for Python 3.4 and an error is raised in 3.5 when I attempt to import the module.

Can I force python3-tk to install to Python 3.5?

Upvotes: 2

Views: 650

Answers (2)

furas
furas

Reputation: 142641

I use Linux Mint (based on Ubuntu) and I use unofficial Python repositorium for Ubuntu.

https://launchpad.net/~fkrull/+archive/ubuntu/deadsnakes

It gives me python3.5-tk

apt-get install python3.5-tk

See how to add this repo: https://askubuntu.com/a/682875/177036

Upvotes: 2

OttavioMonzione
OttavioMonzione

Reputation: 123

Have a look at Miniconda. You can create different "environments" and run different versions of Python on the same machine and/or different packages on different python version. Like conda create -n python3_5 python=3.5 then source activate python3_5 and finally conda install -y -n python3_5 python3-tk.

Upvotes: 2

Related Questions