Install matplotlib with Plone 4.3.3 via buildout [duplicate] - matplotlib

When I try to upgrade my matplotlib using pip, it outputs:
Downloading/unpacking matplotlib from https://pypi.python.org/packages/source/m/matplotlib/matplotlib-1.4.0.tar.gz#md5=1daf7f2123d94745feac1a30b210940c
Downloading matplotlib-1.4.0.tar.gz (51.2MB): 51.2MB downloaded
Running setup.py (path:/tmp/pip_build_root/matplotlib/setup.py) egg_info for package matplotlib
============================================================================
Edit setup.cfg to change the build options
BUILDING MATPLOTLIB
matplotlib: yes [1.4.0]
python: yes [2.7.6 (default, Mar 22 2014, 22:59:38) [GCC
4.8.2]]
platform: yes [linux2]
REQUIRED DEPENDENCIES AND EXTENSIONS
numpy: yes [version 1.8.2]
six: yes [using six version 1.7.3]
dateutil: yes [using dateutil version 2.2]
tornado: yes [using tornado version 4.0.1]
pyparsing: yes [using pyparsing version 2.0.2]
pycxx: yes [Couldn't import. Using local copy.]
libagg: yes [pkg-config information for 'libagg' could not
be found. Using local copy.]
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip_build_root/matplotlib/setup.py", line 154, in <module>
result = package.check()
File "setupext.py", line 940, in check
if 'No such file or directory\ngrep:' in version:
TypeError: argument of type 'NoneType' is not iterable
Complete output from command python setup.py egg_info:
============================================================================
Edit setup.cfg to change the build options
BUILDING MATPLOTLIB
matplotlib: yes [1.4.0]
python: yes [2.7.6 (default, Mar 22 2014, 22:59:38) [GCC
4.8.2]]
platform: yes [linux2]
REQUIRED DEPENDENCIES AND EXTENSIONS
numpy: yes [version 1.8.2]
six: yes [using six version 1.7.3]
dateutil: yes [using dateutil version 2.2]
tornado: yes [using tornado version 4.0.1]
pyparsing: yes [using pyparsing version 2.0.2]
pycxx: yes [Couldn't import. Using local copy.]
libagg: yes [pkg-config information for 'libagg' could not
be found. Using local copy.]
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip_build_root/matplotlib/setup.py", line 154, in <module>
result = package.check()
File "setupext.py", line 940, in check
if 'No such file or directory\ngrep:' in version:
TypeError: argument of type 'NoneType' is not iterable
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/matplotlib
Storing debug log for failure in /home/username/.pip/pip.log
In the tail of the log it says:
Exception information:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/pip-1.5.6-py2.7.egg/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/local/lib/python2.7/dist-packages/pip-1.5.6-py2.7.egg/pip/commands/install.py", line 278, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/usr/local/lib/python2.7/dist-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 1229, in prepare_files
req_to_install.run_egg_info()
File "/usr/local/lib/python2.7/dist-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 325, in run_egg_info
command_desc='python setup.py egg_info')
File "/usr/local/lib/python2.7/dist-packages/pip-1.5.6-py2.7.egg/pip/util.py", line 697, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/matplotlib
Why did it fail?
Many thanks!

This is a known bug that has been fixed (https://github.com/matplotlib/matplotlib/pull/3414) on master.
The bug is in the handling of searching for a freetype installation. If you install the Linux package freetype-dev, you will avoid this bug and be able to compile matplotlib.
sudo apt-get install libfreetype6-dev

On Ubuntu 14 server, you also need to install libxft-dev
sudo apt-get install libfreetype6-dev libxft-dev

I had the same issues trying to install matplotlib on Python 3 using pip3, and it seems that this problem is related to a bare-bones installation of Python 3, and doing a:
sudo apt-get build-dep matplotlib
followed by
sudo pip3 install matplotlib
is probably a better solution than selectively installing only the libraries related to matplotlib.

Since mac doesn't have apt-get you, on OSX you may need to do:
brew install freetype
then you can run:
pip install matplotlib

Found this page while looking answer for fedora 24.
RPM solution is:
dnf install freetype-devel

If you re running Ubuntu server 14.04 u should add this font dependency
sudo apt-get install libxft-dev
Source

I was trying too update directly using sudo pip but changes are not saved in last. So i first use update cmd in terminal:
sudo apt-get update
then i used sudo install:
sudo apt-get install libffi-dev
Finally its installed by doing this method.

For those on Fedora 25 hitting this thread, I needed these two packages to make it work:
sudo dnf install freetype-devel gcc-c++

This worked for me:
python -m pip install -U pip setuptools
python -m pip install matplotlib
For more details, follow : https://matplotlib.org/2.0.0/users/installing.html

Related

How to install matplotlib 3.2.x on Ubuntu 16.04?

Tried several methods to install matplotlib on Ubuntu 16.04, but failed miserably. First I ran
sudo apt-get install python3-matplotlib, it always installed matplotlib 1.5.1 and I wanted the latest version 3.2.1. So I purged it and ran pip3 install matplotlib and what I got was always the following error
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-hse72gvy/matplotlib/setup.py", line 139
raise IOError(f"Failed to download jquery-ui. Please download "
^
SyntaxError: invalid syntax
which seems to suggest that I must install jQuery-UI. I haven't found any working solutions on the internet. Any more has a tip or solution?

Python 3 / PyQt 5 - ImportError: Undefined Symbol

I was making a QSS Theme Preview Program in PyQt 5. But, It suddenly stoppped working:
Traceback (most recent call last):
File "core.py", line 1, in <module>
from PyQt5.QtCore import *
ImportError: /usr/local/lib/python3.5/dist-packages/PyQt5/QtCore.so: undefined symbol: PySlice_AdjustIndices
I removed and re-installed qt5-default, python3-pyqt5, and python3-sip, but the error still occurs.
I am using Lubuntu 16.04 LTS (Xenial Xerus) On An Acer Chromebook R11 C738T using Crouton and Python 3.5.1-3 and PyQt 5.11.2. (I'm pretty sure that the version isn't the problem; other people had the same problem with different Python and PyQt versions)
P.S. Some people say that I need Python 3.6+, but when I run sudo apt install python3, apt says python3 is already the newest version (3.5.1-3). Plus, I get error when I try to build it myself.
I had the same problem, I fixed it by upgrading to python 3.6, sorry I can't dig deeper.
I put the steps to update the python from 3.5 to 3.6, in my case I work in Linux mint, but the steps should be the same.
First the installation.
sudo add-apt-repository ppa:jonathonf/python-3.6
sudo apt update
sudo apt-get install python3.6
Now the configuration (To make the system take version 3.6 by default)
!!!WARNING, depending on the version of Linux|distribution, system problems may be caused if you make default another python version!!!
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.5 1
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 2
update-alternatives --list python3
sudo update-alternatives --config python3
Then install the pip3 again
wget https://bootstrap.pypa.io/get-pip.py
sudo python3 get-pip.py
I hope it helps you, I'm sorry I can't tell you the cause of the problem, I hope someone tells us, for now it seems to be a PyQt5 bug with this version.
Anyway, good luck.

uninstall virtualenv in mac

I try to install tensorflow via virtualenv in mac, the reference is here:
for I have python already, so I install virtualenv by:
sudo pip install --upgrade virtualenv
build a new virtualenv environment in ~/development project/tensorflow, not in ~/tensorflow as is said in the reference:
virtualenv --system-site-packages ~/development project/tensorflow
cd ~/development project/tensorflow
active virtualenv by:
source bin/activate # if use bash,and I choose this line to run
when I am in virtualenv and run this:
(tensorflow)$ pip install --upgrade <$url_to_binary.whl>
it comes out an error:
zsh: parse error near '\n'
then I check here to help solve it
it says that <$url_to_binary.whl> should be replaced by https://storage.googleapis.com/tensorflow/mac/tensorflow-0.5.0-py2-none-any.whl, and I do so. And problem gone.
but, when I try to test tensorflow by cd some dir in tensorflow like:
(tensorflow)$ cd tensorflow/models/image/mnist
the dir is not exist.
so I guess the url I modified cause it, and I try to reinstall virtualenv and tensorflow, to make my install clean.
tensorflow is successfully uninstalled, but when I remove virtualenv, it booms:
Exception: Traceback (most recent call last): File
"/usr/local/lib/python2.7/site-packages/pip/basecommand.py", line 215,
in main
status = self.run(options, args) File "/usr/local/lib/python2.7/site-packages/pip/commands/uninstall.py",
line 76, in run
requirement_set.uninstall(auto_confirm=options.yes) File "/usr/local/lib/python2.7/site-packages/pip/req/req_set.py", line 346,
in uninstall
req.uninstall(auto_confirm=auto_confirm) File "/usr/local/lib/python2.7/site-packages/pip/req/req_install.py", line
754, in uninstall
paths_to_remove.remove(auto_confirm) File "/usr/local/lib/python2.7/site-packages/pip/req/req_uninstall.py",
line 115, in remove
renames(path, new_path) File "/usr/local/lib/python2.7/site-packages/pip/utils/init.py", line
267, in renames
shutil.move(old, new) File "/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py",
line 303, in move
os.unlink(src) OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/site-packages/virtualenv-15.1.0.dist-info/DESCRIPTION.rst'
I delete dir tensorflow
for now I could not uninstall virtualenv neither install it, but it still exist....that's really wired.
If I run sudo pip install --upgrade virtualenv again, it says:
The directory '/Users/Calvino/Library/Caches/pip/http' or its parent
directory is not owned by the current user and the cache has been
disabled. Please check the permissions and owner of that directory. If
executing pip with sudo, you may want sudo's -H flag. The directory
'/Users/Calvino/Library/Caches/pip' or its parent directory is not
owned by the current user and caching wheels has been disabled. check
the permissions and owner of that directory. If executing pip with
sudo, you may want sudo's -H flag. Requirement already up-to-date:
virtualenv in /usr/local/lib/python2.7/site-packages
My question is that how could I remove virtualenv and tensorflow thoroughly and reinstall them.
I would be very appreciate if anyone could help.
have been two years but anyways yo need to uninstall with >
//Reinstal python 2 or 3 with new SO update
brew update
sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
brew reinstall python#3
Reference
then reinstall tensorflow with>
https://www.tensorflow.org/install/pip
Now, you just need to run:
(tensorflow)$ pip install --upgrade tensorflow # for Python 2.7
(tensorflow)$ pip3 install --upgrade tensorflow # for Python 3.n
And remove by: (this is for virtualenv, you change the path, following path also should be changed to ~/development/project/tensorflow)
$ rm -r ~/tensorflow
If you install tensorflow with native pip:
$ pip uninstall tensorflow
$ pip3 uninstall tensorflow
More information: https://www.tensorflow.org/install/install_mac

Getting: tensorflow is not a supported wheel on this platform

I tried installing tensorflow on my system, but I received the following error:
tensorflow-0.5.0-cp27-none-linux_x86_64.whl is not a supported wheel on this platform
Exception Information captured in pip.log file:-
/home/gansai/tensorflow/bin/pip run on Wed Nov 11 00:19:05 2015
tensorflow-0.5.0-cp27-none-linux_x86_64.whl is not a supported wheel on this platform.
Exception information:
Traceback (most recent call last):
File "/home/gansai/tensorflow/local/lib/python2.7/site-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/home/gansai/tensorflow/local/lib/python2.7/site-packages/pip/commands/install.py", line 269, in run
InstallRequirement.from_line(name, None))
File "/home/gansai/tensorflow/local/lib/python2.7/site-packages/pip/req.py", line 168, in from_line
raise UnsupportedWheel("%s is not a supported wheel on this platform." % wheel.filename)
UnsupportedWheel: tensorflow-0.5.0-cp27-none-linux_x86_64.whl is not a supported wheel on this platform.
What could I do to install tensorflow and start experimenting it?
I guess pip3 is being used for installation
it can be solved by using pip2.7
I followed the steps in here
hope it helps you:)
tensorflow-0.5.0-cp27-none-linux_x86_64.whl is not a supported wheel on this platform
The above error comes because of trying to install TensorFlow onto a 32 bit system. As you could observe, the wheel was linux_x86_64, which is intended to be installed on 64 bit.
Steps to follow:-
Direct Binary Installation
Install Debian 64 bit OS. Download debian 64 bit ISO from torrent (http://cdimage.debian.org/debian-cd/current-live/amd64/bt-hybrid/)
Install python-dev. apt-get install python-dev
Install tensor-flow python2.7 -m pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl
Docker Based Installation
Install Debian 64 bit OS. Download debian 64 bit ISO from torrent (http://cdimage.debian.org/debian-cd/current-live/amd64/bt-hybrid/)
Install Docker on Debian. Follow steps mentioned in http://docs.docker.com/engine/installation/debian/#debian-jessie-80-64-bit
Run docker container for tensorflow. docker run -it b.gcr.io/tensorflow/tensorflow. Follow steps mentioned in http://tensorflow.org/get_started/os_setup.md#docker-based_installation
The main point to be noted here is that, as of now, python wheel for tensorflow is supported for 64 bit system, as shared in pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl
It might be unrelated but I had the same error with tensorflow-0.7.1-cp34-none-linux_x86_64.whl on a fresh Ubuntu Linux 14.04 LTS (64bit) and this is what has helped:
sudo apt-get install python3-setuptools -y && sudo easy_install3 pip -y && sudo apt-get install python 3.5-dev -y && sudo apt-get install python3.4-dev -y
sudo pip3 install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.7.1-cp34-none-linux_x86_64.whl
You can call a tensorflow script like this:
#call it with python3.4
python3.4 tensorflow_demo.py
While researching I often read about using wget and renaming the file but this became obsolete with the latest version, see here: https://github.com/tensorflow/tensorflow/issues/1142#issuecomment-186740120

Can't find Python modules after Time Machine restore

Recently, I performed a clean install of OS X Mountain Lion and restored my system from a Time Machine backup. When I tried to use python, it was unable to find most of the modules that I had installed before I wiped my OS. It also appears that the Xcode Command Line Tools were no longer on the system.
I reinstalled the Xcode Command Line Tools and pip (using easy_install), and went to work reinstalling the modules I use, starting with numpy. However, pip said it was already installed:
Requirement already satisfied (use --upgrade to upgrade): numpy in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
However, in the CLI for Python, it still can't find numpy:
Python 2.7.3 (v2.7.3:70274d53c1dd, Apr 9 2012, 20:52:43)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named numpy
I've tried to install some other modules. When I installed ujson with pip, everything went fine, and python found it with no problems. However, when I tried to install matplotlib with pip, clang threw an error and it failed to install. I think the problem might be that matplotlib has dependency on numpy, but I don't know.
In file included from src/ft2font.cpp:3:
src/ft2font.h:16:10: fatal error: 'ft2build.h' file not found
#include <ft2build.h>
^
1 error generated.
error: command 'clang' failed with exit status 1
----------------------------------------
Command /usr/bin/python -c "import setuptools;__file__='/tmp/pip-build/matplotlib/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-lqNcmF-record/install-record.txt --single-version-externally-managed failed with error code 1 in /tmp/pip-build/matplotlib`
Any advice on how to resolve this issue? Should I just uninstall this other version of numpy, or do you think this is a deeper issue?
Deleting the numpy files in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python and reinstalling numpy would be my suggestion. It seems like the libraries are no longer being linked to properly even though the files are there.