ubuntu下mysqldb安装

系统:Ubuntu16.04 环境:Python2 Python3 Anaconda/Python2
在配置好mysql的情况下,安装mysqldb报错
zqy@zqy-Mai-II:~$ sudo pip install mysql-python The directory '/home/zqy/.cache/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 '/home/zqy/.cache/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. Collecting mysql-python Downloading MySQL-python-1.2.5.zip (108kB) 100% |████████████████████████████████| 112kB 491kB/s Complete output from command python setup.py egg_info: Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/pip-build-76krf8c_/mysql-python/setup.py", line 13, in <module> from setup_posix import get_config File "/tmp/pip-build-76krf8c_/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 /tmp/pip-build-76krf8c_/mysql-python/

最后将pip改为pip2,安装成功

zqy@zqy-Mai-II:~$ sudo pip2 install mysql-python The directory '/home/zqy/.cache/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 '/home/zqy/.cache/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. Collecting mysql-python Downloading MySQL-python-1.2.5.zip (108kB) 100% |████████████████████████████████| 112kB 660kB/s Installing collected packages: mysql-python Running setup.py install for mysql-python ... done Successfully installed mysql-python-1.2.5

`

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • linux和windows下安装python拓展包-pycharm、numpy、scipy、matplotlib、...
    hzyido阅读 81,398评论 2 10
  • 说明本次redis集群安装在rhel6.8 64位机器上,redis版本为3.2.8,redis的gem文件版本为...
    读或写阅读 15,318评论 3 9
  • 我就是喜欢一个人,这个习惯已经十岁了。 小时候,爸妈为了生计每天早上出去,晚上八九点才会回来,家里只剩我和奶奶两个...
    瓶子__阅读 229评论 0 0
  • 写点什么吧。 “金大心,知道为什么你胃疼吗?做事情尽可能让自己慢下来,事情每天都要去做,控制好节奏慢慢来⋯⋯”这是...
    心的字阅读 248评论 2 0
  • 《断舍离》这本书曾经也是蛮火的,之所以能火的原因我认为是在这个日新月异的社会,你要不断地改变自己的状态去适应它,可...
    小键盘虾阅读 739评论 0 1