Build matplotlib dependencies for both python2 and python3
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9GURib1T8z7lCwjOGLQaGtrueEthgQ8LO42ZX8cOfTqDK4jvDDpKkLFwf2J49kYCMNW7d4ABih_XCb_2UXdq5fPJDkoyg7-8g_YfRUot-XnaXkNYycsNp7lA5_TW9td0FFpLQ2APzKcZ/s1600/1.jpg)
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYQ0N5W1qAOxLP7t7iOM6O6AzbZnkXUy16s7P_CWfOb5UbTQY_aDsc727chyphenhyphen5W4IppVNernMMQeaUFTB_rFzAd95_CDt-tnwN-nBx6JyUp2duGjPaL5-VgNO41AVsA_vu30EJcipdDG409/s400/Clash+Royale+CLAN+TAG%2523URR8PPP.png)
up vote
1
down vote
favorite
I would like to have various virtual environments in my computer, some of them running python 2.7 and others with python3, and some of them must have full matplotlib support, which is achieved with --system-syte-packages
when creating the virtual environment (see matplotlib faqs).
Therefore, I need to biuld the dependencies of matplotlib for both python versions. I started with:
sudo apt-get build-dep python-matplotlib
Which installed everything properly, and then I tried to run:
sudo apt-get build-dep python3-matplotlib
Which did nothing, it only printed the following messages:
Reading package lists... Done
Picking 'matplotlib' as source package instead of 'python3-matplotlib'
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 to upgrade, 0 to newly install, 0 to remove and 6 not to upgrade.
How can this be solved? Both a pip
or apt-get
related solutions are welcome.
EDIT:
I can install matplotlib in a python3 virtual environment without any problem, however, it does not support many of the backends. For instance:
>>> import matplotlib
>>> matplotlib.use('GTK')
>>> import matplotlib.pyplot as plt
Traceback (most recent call last):
File "/home/oriol/venvs/pic_python3.5/lib/python3.5/site-packages/matplotlib/backends/backend_gtk.py", line 17, in <module>
import gobject
ImportError: No module named 'gobject'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/oriol/venvs/pic_python3.5/lib/python3.5/site-packages/matplotlib/pyplot.py", line 115, in <module>
_backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
File "/home/oriol/venvs/pic_python3.5/lib/python3.5/site-packages/matplotlib/backends/__init__.py", line 62, in pylab_setup
[backend_name], 0)
File "/home/oriol/venvs/pic_python3.5/lib/python3.5/site-packages/matplotlib/backends/backend_gtk.py", line 21, in <module>
raise ImportError("Gtk* backend requires pygtk to be installed.")
ImportError: Gtk* backend requires pygtk to be installed.
Even though pip freeze
inside the virtual environment includes pygobject==3.20.0
. I thought that this pygobject
may be the python2 one, however, the sys.path
in the virtual environment is:
['', '/usr/lib/python35.zip', '/usr/lib/python3.5', '/usr/lib/python3.5/plat-x86_64-linux-gnu', '/usr/lib/python3.5/lib-dynload', '/home/oriol/venvs/pic_python3.5/lib/python3.5/site-packages', '/usr/local/lib/python3.5/dist-packages', '/usr/lib/python3/dist-packages']
16.04 software-installation python dependencies matplotlib
 |Â
show 2 more comments
up vote
1
down vote
favorite
I would like to have various virtual environments in my computer, some of them running python 2.7 and others with python3, and some of them must have full matplotlib support, which is achieved with --system-syte-packages
when creating the virtual environment (see matplotlib faqs).
Therefore, I need to biuld the dependencies of matplotlib for both python versions. I started with:
sudo apt-get build-dep python-matplotlib
Which installed everything properly, and then I tried to run:
sudo apt-get build-dep python3-matplotlib
Which did nothing, it only printed the following messages:
Reading package lists... Done
Picking 'matplotlib' as source package instead of 'python3-matplotlib'
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 to upgrade, 0 to newly install, 0 to remove and 6 not to upgrade.
How can this be solved? Both a pip
or apt-get
related solutions are welcome.
EDIT:
I can install matplotlib in a python3 virtual environment without any problem, however, it does not support many of the backends. For instance:
>>> import matplotlib
>>> matplotlib.use('GTK')
>>> import matplotlib.pyplot as plt
Traceback (most recent call last):
File "/home/oriol/venvs/pic_python3.5/lib/python3.5/site-packages/matplotlib/backends/backend_gtk.py", line 17, in <module>
import gobject
ImportError: No module named 'gobject'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/oriol/venvs/pic_python3.5/lib/python3.5/site-packages/matplotlib/pyplot.py", line 115, in <module>
_backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
File "/home/oriol/venvs/pic_python3.5/lib/python3.5/site-packages/matplotlib/backends/__init__.py", line 62, in pylab_setup
[backend_name], 0)
File "/home/oriol/venvs/pic_python3.5/lib/python3.5/site-packages/matplotlib/backends/backend_gtk.py", line 21, in <module>
raise ImportError("Gtk* backend requires pygtk to be installed.")
ImportError: Gtk* backend requires pygtk to be installed.
Even though pip freeze
inside the virtual environment includes pygobject==3.20.0
. I thought that this pygobject
may be the python2 one, however, the sys.path
in the virtual environment is:
['', '/usr/lib/python35.zip', '/usr/lib/python3.5', '/usr/lib/python3.5/plat-x86_64-linux-gnu', '/usr/lib/python3.5/lib-dynload', '/home/oriol/venvs/pic_python3.5/lib/python3.5/site-packages', '/usr/local/lib/python3.5/dist-packages', '/usr/lib/python3/dist-packages']
16.04 software-installation python dependencies matplotlib
what happens when you try to create a python3 virtualenv and install matplotlib there? could it be that it works (and you don't need any additional packages)?
â d3vid
May 10 at 12:23
do you know which 6 packages aren't upgraded (or is that unrelated)?
â d3vid
May 10 at 12:24
@d3vid I have updated the question to answer your first question. About the 2nd question, I have no idea what packages are this 6. How can I see them?
â xg.plt.py
May 10 at 15:32
this looks to me like matplotlib is installing correctly, and you have a different dependency issue - can you confirm it works with a simpler backend?
â d3vid
May 11 at 16:47
for GTK/pygobject you need a different dependency that hooks into your system-level gtk files from within the virtualenv - I'm afraid I don't recall the name right now
â d3vid
May 11 at 16:49
 |Â
show 2 more comments
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I would like to have various virtual environments in my computer, some of them running python 2.7 and others with python3, and some of them must have full matplotlib support, which is achieved with --system-syte-packages
when creating the virtual environment (see matplotlib faqs).
Therefore, I need to biuld the dependencies of matplotlib for both python versions. I started with:
sudo apt-get build-dep python-matplotlib
Which installed everything properly, and then I tried to run:
sudo apt-get build-dep python3-matplotlib
Which did nothing, it only printed the following messages:
Reading package lists... Done
Picking 'matplotlib' as source package instead of 'python3-matplotlib'
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 to upgrade, 0 to newly install, 0 to remove and 6 not to upgrade.
How can this be solved? Both a pip
or apt-get
related solutions are welcome.
EDIT:
I can install matplotlib in a python3 virtual environment without any problem, however, it does not support many of the backends. For instance:
>>> import matplotlib
>>> matplotlib.use('GTK')
>>> import matplotlib.pyplot as plt
Traceback (most recent call last):
File "/home/oriol/venvs/pic_python3.5/lib/python3.5/site-packages/matplotlib/backends/backend_gtk.py", line 17, in <module>
import gobject
ImportError: No module named 'gobject'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/oriol/venvs/pic_python3.5/lib/python3.5/site-packages/matplotlib/pyplot.py", line 115, in <module>
_backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
File "/home/oriol/venvs/pic_python3.5/lib/python3.5/site-packages/matplotlib/backends/__init__.py", line 62, in pylab_setup
[backend_name], 0)
File "/home/oriol/venvs/pic_python3.5/lib/python3.5/site-packages/matplotlib/backends/backend_gtk.py", line 21, in <module>
raise ImportError("Gtk* backend requires pygtk to be installed.")
ImportError: Gtk* backend requires pygtk to be installed.
Even though pip freeze
inside the virtual environment includes pygobject==3.20.0
. I thought that this pygobject
may be the python2 one, however, the sys.path
in the virtual environment is:
['', '/usr/lib/python35.zip', '/usr/lib/python3.5', '/usr/lib/python3.5/plat-x86_64-linux-gnu', '/usr/lib/python3.5/lib-dynload', '/home/oriol/venvs/pic_python3.5/lib/python3.5/site-packages', '/usr/local/lib/python3.5/dist-packages', '/usr/lib/python3/dist-packages']
16.04 software-installation python dependencies matplotlib
I would like to have various virtual environments in my computer, some of them running python 2.7 and others with python3, and some of them must have full matplotlib support, which is achieved with --system-syte-packages
when creating the virtual environment (see matplotlib faqs).
Therefore, I need to biuld the dependencies of matplotlib for both python versions. I started with:
sudo apt-get build-dep python-matplotlib
Which installed everything properly, and then I tried to run:
sudo apt-get build-dep python3-matplotlib
Which did nothing, it only printed the following messages:
Reading package lists... Done
Picking 'matplotlib' as source package instead of 'python3-matplotlib'
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 to upgrade, 0 to newly install, 0 to remove and 6 not to upgrade.
How can this be solved? Both a pip
or apt-get
related solutions are welcome.
EDIT:
I can install matplotlib in a python3 virtual environment without any problem, however, it does not support many of the backends. For instance:
>>> import matplotlib
>>> matplotlib.use('GTK')
>>> import matplotlib.pyplot as plt
Traceback (most recent call last):
File "/home/oriol/venvs/pic_python3.5/lib/python3.5/site-packages/matplotlib/backends/backend_gtk.py", line 17, in <module>
import gobject
ImportError: No module named 'gobject'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/oriol/venvs/pic_python3.5/lib/python3.5/site-packages/matplotlib/pyplot.py", line 115, in <module>
_backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
File "/home/oriol/venvs/pic_python3.5/lib/python3.5/site-packages/matplotlib/backends/__init__.py", line 62, in pylab_setup
[backend_name], 0)
File "/home/oriol/venvs/pic_python3.5/lib/python3.5/site-packages/matplotlib/backends/backend_gtk.py", line 21, in <module>
raise ImportError("Gtk* backend requires pygtk to be installed.")
ImportError: Gtk* backend requires pygtk to be installed.
Even though pip freeze
inside the virtual environment includes pygobject==3.20.0
. I thought that this pygobject
may be the python2 one, however, the sys.path
in the virtual environment is:
['', '/usr/lib/python35.zip', '/usr/lib/python3.5', '/usr/lib/python3.5/plat-x86_64-linux-gnu', '/usr/lib/python3.5/lib-dynload', '/home/oriol/venvs/pic_python3.5/lib/python3.5/site-packages', '/usr/local/lib/python3.5/dist-packages', '/usr/lib/python3/dist-packages']
16.04 software-installation python dependencies matplotlib
edited May 10 at 15:31
asked May 10 at 10:44
xg.plt.py
1065
1065
what happens when you try to create a python3 virtualenv and install matplotlib there? could it be that it works (and you don't need any additional packages)?
â d3vid
May 10 at 12:23
do you know which 6 packages aren't upgraded (or is that unrelated)?
â d3vid
May 10 at 12:24
@d3vid I have updated the question to answer your first question. About the 2nd question, I have no idea what packages are this 6. How can I see them?
â xg.plt.py
May 10 at 15:32
this looks to me like matplotlib is installing correctly, and you have a different dependency issue - can you confirm it works with a simpler backend?
â d3vid
May 11 at 16:47
for GTK/pygobject you need a different dependency that hooks into your system-level gtk files from within the virtualenv - I'm afraid I don't recall the name right now
â d3vid
May 11 at 16:49
 |Â
show 2 more comments
what happens when you try to create a python3 virtualenv and install matplotlib there? could it be that it works (and you don't need any additional packages)?
â d3vid
May 10 at 12:23
do you know which 6 packages aren't upgraded (or is that unrelated)?
â d3vid
May 10 at 12:24
@d3vid I have updated the question to answer your first question. About the 2nd question, I have no idea what packages are this 6. How can I see them?
â xg.plt.py
May 10 at 15:32
this looks to me like matplotlib is installing correctly, and you have a different dependency issue - can you confirm it works with a simpler backend?
â d3vid
May 11 at 16:47
for GTK/pygobject you need a different dependency that hooks into your system-level gtk files from within the virtualenv - I'm afraid I don't recall the name right now
â d3vid
May 11 at 16:49
what happens when you try to create a python3 virtualenv and install matplotlib there? could it be that it works (and you don't need any additional packages)?
â d3vid
May 10 at 12:23
what happens when you try to create a python3 virtualenv and install matplotlib there? could it be that it works (and you don't need any additional packages)?
â d3vid
May 10 at 12:23
do you know which 6 packages aren't upgraded (or is that unrelated)?
â d3vid
May 10 at 12:24
do you know which 6 packages aren't upgraded (or is that unrelated)?
â d3vid
May 10 at 12:24
@d3vid I have updated the question to answer your first question. About the 2nd question, I have no idea what packages are this 6. How can I see them?
â xg.plt.py
May 10 at 15:32
@d3vid I have updated the question to answer your first question. About the 2nd question, I have no idea what packages are this 6. How can I see them?
â xg.plt.py
May 10 at 15:32
this looks to me like matplotlib is installing correctly, and you have a different dependency issue - can you confirm it works with a simpler backend?
â d3vid
May 11 at 16:47
this looks to me like matplotlib is installing correctly, and you have a different dependency issue - can you confirm it works with a simpler backend?
â d3vid
May 11 at 16:47
for GTK/pygobject you need a different dependency that hooks into your system-level gtk files from within the virtualenv - I'm afraid I don't recall the name right now
â d3vid
May 11 at 16:49
for GTK/pygobject you need a different dependency that hooks into your system-level gtk files from within the virtualenv - I'm afraid I don't recall the name right now
â d3vid
May 11 at 16:49
 |Â
show 2 more comments
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1034442%2fbuild-matplotlib-dependencies-for-both-python2-and-python3%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
what happens when you try to create a python3 virtualenv and install matplotlib there? could it be that it works (and you don't need any additional packages)?
â d3vid
May 10 at 12:23
do you know which 6 packages aren't upgraded (or is that unrelated)?
â d3vid
May 10 at 12:24
@d3vid I have updated the question to answer your first question. About the 2nd question, I have no idea what packages are this 6. How can I see them?
â xg.plt.py
May 10 at 15:32
this looks to me like matplotlib is installing correctly, and you have a different dependency issue - can you confirm it works with a simpler backend?
â d3vid
May 11 at 16:47
for GTK/pygobject you need a different dependency that hooks into your system-level gtk files from within the virtualenv - I'm afraid I don't recall the name right now
â d3vid
May 11 at 16:49