python 配置開發環境 安裝mysql-connector-python


Day1:

今天開始跟着廖雪峰老師做一個基於python的博客系統,第一天配置python開發環境;參考網站: 實戰;

本機環境: MacOS 10.12

問題: 安裝mysql-connector-python中遇到的問題

網上推薦的安裝方法: $ easy_install mysql-connector-python, 但是在安裝過程中出現了以下問題:

[Errno 13] Permission denied: '/Library/Python/2.7/site-packages/test-easy-install-18192.pth'

以為是權限問題,sudo切換到root權限下進行同樣操作,出現一下問題:

Searching for mysql-connector-python
Reading https://pypi.python.org/simple/mysql-connector-python/
No local packages or download links found for mysql-connector-python
error: Could not find suitable distribution for Requirement.parse('mysql-connector-python')

中間試了下博客Mac平台安裝mysql-connector-python中推薦的從git下載相關源碼后編譯安裝,但是仍然失敗!

解決辦法

最后沒辦法,選擇去mysql-connector-python的下載地下載最新版本的.dmg安裝包進行安裝,本人安裝的版本是: mysql-connector-python-2.1.4-osx10.11.dmg

安裝成功測試

~ python
>>> import mysql.connector as ms
>>> msc.__version__
'2.1.4'


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM