It is a topical opportunity learning system recently, but it is being established as a field of Python. An event called PyData is also actively held.
Build the environment of NumPy and matplotlib on CentOS 6.x.
Install Development Tools on CentOS
Install other yum required
...Postscript
$ sudo yum install freetype-devel
Python2.7.9
$ cd /home/cmscom/tmp
$ wget https://www.python.org/ftp/python/2.7.9/Python-2.7.9.tgz
$ tar zxvf Python-2.7.9.tgz
$ cd Python-2.7.9
$ ./configure
$ make
$ sudo make install
Installed below
/usr/local/lib/python2.7
Install PIP and virtualenv
$ wget https://bootstrap.pypa.io/get-pip.py
$ sudo /usr/local/bin/python get-pip.py
$ sudo pip install virtualenv
$ cd /home/cmscom
$ virtualenv python
$ ./python/bin/pip install numpy
$ ./python/bin/pip install nltk
$ ./python/bin/pip install matplotlib
$ ./python/bin/pip install ipython[notebook]
I had a problem installing NLTK in another environment on Mac OS. I will describe the background and solution.
AttributeError: 'module' object has no attribute 'finders'
Looking at the content of the error, in NLTK setup.py, an error appears in the part where the following processing is performed.
nltk/setup.py
from setuptools.command import sdist
del sdist.finders[:]
I checked the version of setuptools
in my installation and found that setuptools-11.0
was installed.
A similar phenomenon was reported.
NLTK bug report https://github.com/nltk/nltk/issues/824
Setuptools bug report https://bitbucket.org/pypa/setuptools/issue/322/failure-installing-nltk-300-using
I did the following to proceed with the installation.
$ ./python/bin/pip install setuptools==9.1
This is the solution !!
On the NLTK side, I'm doing the following, but this is the problem.
del sdist.finders[:]
I don't know the details, but I think it was necessary when using the previous setuptools. It seems that changes have been made to setuptools since Ver.10, and it does not seem to match well with the support on the NLTK side.
A 2009 article talks about this. http://rhodesmill.org/brandon/2009/eby-magic/
It's an event at setuptools, so I'd like to hear from @aodag or @shimizukawa.
Recommended Posts