Label (space separated): Uncategorized
Instructions for use
First backup /etc/yum.repos.d/CentOS-Base.repo
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
Download the corresponding version of the repo file and put it in /etc/yum.repos.d/ (please make a corresponding backup before operation)
CentOS6
Run the following command to generate the cache
yum clean all
yum makecache
# wget http://www.python.org/ftp/python/2.7.5/Python-2.7.5.tar.bz2
# tar jxvf Python-2.7.5.tar.bz2
# cd Python-2.7.5
#. /configure --prefix=/usr/local
# make && make altinstall
# mv /usr/bin/python /usr/bin/python2.6.6
# ln -s /usr/local/bin/python2.7/usr/bin/python
yum install zlib& zilib devel
Then encountered yum error because of the wrong python version:
[ root@localhost bin]# yum install pip
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:
No module named yum
Please install a package which provides this module, or
verify that the module is installed correctly.
It's possible that the above module doesn't match the
current version of Python, which is:2.7.3(default, Jan 162016,05:59:11)[GCC 4.4.620120305(Red Hat 4.4.6-4)]
If you cannot solve this problem yourself, please go to
the yum faq at:
http://yum.baseurl.org/wiki/Faq
Find the yum file and edit this py file
[ root@develop local]# which yum
/usr/bin/yum[root@develop local]# vi /usr/bin/yum
will
#! /usr/bin/python
To:
#! /usr/bin/python2.6
Then save OK.
Supplement: Yum is written based on python.
Install zlib&zlib-devel
Recompile python
/.configure``make``make install
Then reinstall setuptools
Encountered wangqi is not in the sudoers file.
# visudo
## Allow root to run any commands anywhere
root ALL=(ALL) ALL
wangqi ALL=(ALL) ALL
Encountered ImportError: cannot import name HTTPSHandler
yum install openssl openssl-devel -y
After that, install Python again.
/.configure``make``make install
pip installation is complete
Install numpy,
Install pandas
problem appear:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 32: ordinal not in range(128)
Solution:
Modify the mimetypes.py file, the path is located in the Lib\mimetypes.py file under the python installation path. Add the following lines under import:
if sys.getdefaultencoding()!='gbk':reload(sys)
sys.setdefaultencoding('gbk')
Still reporting an error:
gcc: error trying to exec 'cc1plus': execvp: No such file or directory
error: command 'gcc' failed with exit status 1
Try to solve:
yum -y install gcc
Still reporting an error:
Command /usr/local/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/pandas/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-5RbGXm-record/install-record.txt --single-version-externally-managed --compile failed with error code 1in/tmp/pip_build_root/pandas
Traceback(most recent call last):
File "/usr/local/bin/pip", line 9,in<module>load_entry_point('pip==1.5.6','console_scripts','pip')()
File "/usr/local/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/__init__.py", line 185,in main
return command.main(cmd_args)
File "/usr/local/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/basecommand.py", line 161,in main
text ='\n'.join(complete_log)
UnicodeDecodeError:'gbk' codec can't decode bytes in position 97-98: illegal multibyte sequence
Use the installation package to install directly, and found the following problems:
gcc: error trying to exec 'cc1plus': execvp: No such file or directory
error: command 'gcc' failed with exit status 1
Install gcc-c++
[ root@localhost pandas-0.17.1]# yum list gcc-c++
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
Available Packages
gcc-c++.i686 4.4.7-16.el6 base
[ root@localhost pandas-0.17.1]# yum -y install gcc-c++.i686
Encounter problems
No local packages or download links found for python-dateutil
error: Could not find suitable distribution for Requirement.parse('python-dateutil')
pip install python-dateutil
Finally done
Recommended Posts