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'