pycharm 安装 flask mysqldb 错误,求解 - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
Gary_Cheung

pycharm 安装 flask mysqldb 错误,求解

  •  
  •   Gary_Cheung 2016 年 4 月 26 日 6936 次点击
    这是一个创建于 3650 天前的主题,其中的信息可能已经有所发展或是发生改变。
    提示如下:
    OSError: mysql_config not found

    给出的 proposed solution :
    Try to run this command from the system terminal. Make sure that you use the correct version of 'pip' installed for your Python interpreter located at '/Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5'.

    pycharm 需要 pip 8.1.1 ,已经更新,应该不是 pip 版本问题。
    应该是配置文件 mysql_config 的问题,安装时只提示 not found ,实在不知道怎么解决 T_T
    6 条回复    2016-04-26 20:05:26 +08:00
    kungfuchicken
        1
    kungfuchicken  
       2016 年 4 月 26 日
    export PATH=$PATH:/usr/local/mysql/bin

    /usr/local/mysql/bin 是你 MySQL 的安装路径

    pip install MySQL-Python
    Gary_Cheung
        2
    Gary_Cheung  
    OP
       2016 年 4 月 26 日
    @kungfuchicken 抛了个错误如下

    bash-3.2$ export PATH=$PATH:/usr/local/mysql/bin
    bash-3.2$ pip install MySQL-Python
    ---------------------------------------------------
    Collecting MySQL-Python
    /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/connection.py:266: SubjectAltNameWarning: Certificate for pypi.python.org has no `subjectAltName`, falling back to check for a `commonName` for now. This feature is being removed by major browsers and deprecated by RFC 2818. (See https://github.com/shazow/urllib3/issues/497 for details.)
    SubjectAltNameWarning
    Using cached MySQL-python-1.2.5.zip
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/private/tmp/pip-build-931zi2ld/MySQL-Python/setup.py", line 13, in <module>
    from setup_posix import get_config
    File "/private/tmp/pip-build-931zi2ld/MySQL-Python/setup_posix.py", line 2, in <module>
    from ConfigParser import SafeConfigParser
    ImportError: No module named 'ConfigParser'

    ----------------------------------------
    Command "python setup.py egg_info" failed with error code 1 in /private/tmp/pip-build-931zi2ld/MySQL-Python/
    ----------------------------------------------------

    [问题]: python setup.py egg_info 是什么东东? 发现好多错误和它有关
    gotounix
        3
    gotounix  
       2016 年 4 月 26 日
    sudo apt-get install mysql-server libmysqld-dev
    kungfuchicken
        4
    kungfuchicken  
       2016 年 4 月 26 日   1
    @Gary_Cheung 忘了 MySQL-Python 不支持 Python3, 在 Python3 下装 mysqlclient 替代吧

    pip install mysqlclient
    caomaocao
        5
    caomaocao  
       2016 年 4 月 26 日
    是不是 os x 10.10 以后?~ 这之后的加了个权限的什么我记不清了, 要打开 os x 的 root 权限再开下啥的。以前查了好久
    julyclyde
        6
    julyclyde  
       2016 年 4 月 26 日
    setup.py egg_info 是让安装包自己输出一些信息,供进一步分析使用
    你这 python 居然不带 ConfigParser ?然后我看了看路径, 3.5 的
    告诉你: MySQLdb 不支持 python3
    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     1077 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 140ms UTC 23:32 PVG 07:32 LAX 16:32 JFK 19:32
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86