pip安装mysql-python出错

Posted in 2016-9-28 11:7 | Category: Python | Tags: pip python mysql

Table of Contents

Collecting mysql-python
  Using cached MySQL-python-1.2.5.zip
    Complete output from command python setup.py egg_info:
    sh: mysql_config: 未找到命令
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-g21LDi/mysql-python/setup.py", line 17, in <module>
        metadata, options = get_config()
      File "setup_posix.py", line 43, in get_config
        libs = mysql_config("libs_r")
      File "setup_posix.py", line 25, in mysql_config
        raise EnvironmentError("%s not found" % (mysql_config.path,))
    EnvironmentError: mysql_config not found

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-g21LDi/mysql-python/

Mac

参考问题

brew install mysql
export PATH=$PATH:/usr/local/mysql/bin
pip install MySQL-Python

Centos

yum install python-devel mysql-devel

centos7安装python3及pip3

Posted in 2016-7-7 9:32 | Category: Linux | Tags: pip python

安装python3

安装python3很简单

  • 下载源码并且编译
  • 安装epel

这里采用第二种方法:

yum install epel-release

安装完成之后,yum list python3* ,你就可以看见 python34

yum install python34

安装pip3

参考问题
如果在上述安装 python3时采用了第二种方法,pip默认未安装,而且无法通过yum install python34-pip来安装

正确的方法应该是:

yum install python34-setuptools
easy_install-3.4 pip # 这里可能有一些出入,总之是使用python3的easy_install

ok,就这样

记录pip安装时报的错

Posted in 2016-3-7 21:13 | Category: Python | Tags: pip python

Pillow

ValueError: jpeg is required unless explicitly disabled using --disable-jpeg, aborting

    ----------------------------------------
Command "/home/***/***/venv/bin/python3.4 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-k9djbrwk/Pillow/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-i_zr9z4a-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/***/***/venv/include/site/python3.4/Pillow" failed with error code 1 in /tmp/pip-build-k9djbrwk/Pillow

解决办法:

# yum install libjpeg-turbo-devel

其实这个办法也不太准确, 参考 pillow文档 ,安装

$ sudo yum install libtiff-devel libjpeg-devel libzip-devel freetype-devel lcms2-devel libwebp-devel tcl-devel tk-devel

misaka

error: Setup script exited with error: command ‘gcc’ failed with exit status 1

我使用

pip3 install misaka

报错

error: Setup script exited with error: command ‘gcc’ failed with exit status …