How do you install mysql-connector-python (development version) through pip?

来源:http://www.cnblogs.com/kungfupanda/archive/2016/09/17/5877880.html
-Advertisement-
Play Games

12down votefavorite 8 8 http://stackoverflow.com/questions/31748278/how-do-you-install-mysql-connector-python-development-version-through-pip/34027037 ...


12down votefavorite 8

http://stackoverflow.com/questions/31748278/how-do-you-install-mysql-connector-python-development-version-through-pip/34027037#34027037

 

I have a virtualenv in which I am running Django 1.8 with Python 3.4

I am trying to get support for MySQL however I am having trouble getting the different connectors to work. I have always used mysql-connector-python with django 1.7 and would like to continue using it.

The development version of mysql-connector-python (2.1.2) seems to have support for Django 1.8 now.

How do I install the development version using pip install (within my virtualenv)? I have tried running the following command:

pip install mysql-connector-python==2.1.2 --allow-external mysql-connector-python

but the 2.1.2 developer version is not available there:

could not find a version that satisfies the requirement mysql-connector-python==2.1.2 (from versions: 1.1.4, 1.1.5, 1.1.6, 1.2.2, 1.2.3, 2.0.1, 2.0.2, 2.0.3, 2.0.4)
  Some insecure and unverifiable files were ignored (use --allow-unverified mysql-connector-python to allow).
No matching distribution found for mysql-connector-python==2.1.2

I have tried downloading the file directly from: http://dev.mysql.com/downloads/connector/python/

...but for some reason after installation the connector is not available within my virtualenv

Help please :-) Thank you. '

EDIT: I have tried  pip install mysql-python but it is not supported by Python 3.4

    
share|improve this question edited Jul 31 '15 at 15:08                 asked Jul 31 '15 at 14:11          Aivoric         3962515        
 
   
add a comment |                      

1 Answer                                 1

            active                     oldest                     votes
         up vote27down vote

I agree, the debian packages appear to be broken for at least Ubuntu 14.04.

The apt-get version and the pip version do not include the 2.1.x releases.

To get it done, I had to grab the source:

$  git clone https://github.com/mysql/mysql-connector-python.git
$  cd mysql-connector-python
$  python ./setup.py build
$  sudo python ./setup.py install

...

>>> import mysql.connector as msc
>>> msc.__version__
'2.1.3'
>>>

您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • 屏蔽iOS10模擬器海量的垃圾debug信息 不屏蔽之前 進行如下設置 OS_ACTIVITY_MODE = disable 即可屏蔽垃圾信息 ...
  • Android Weekly Issue #222, 中文筆記. 本期文章包括: Okio中的三個方法, 檢測測試覆蓋率對build時間的影響, Android Support Annotations, Espresso測試相關, 一個新的MVP庫ThirtyInch的介紹, Android學習資... ...
  • 一、萬事開頭的序 網上看見大牛們的博客寫的那樣精彩,各種羡慕之情溢於言表。幾次衝動均想效仿牛人寫些博客來記錄下自己的心得體會,但均無感亦或是感覺容易被噴,相信很多菜鳥和我一樣都有過這樣的擔憂。萬事開頭難,不逼一下自己怎麼知道自己能不能飛起來。由於本人處於初學階段,寫此博客僅是對前輩總結的review ...
  • reserved state進入reserved state以後,sqlite可以修改資料庫中的內容,不過把修改以後的內容寫到pager的緩存里,大小由page cache指定。進入這個狀態以後,pager開始初始化日誌文件,用戶回滾和異常恢復。(其實就是把日誌中的文件內容拷貝到資料庫文件中去)這... ...
  • MySQL 開發團隊於 12 日宣佈 MySQL 8.0.0 開發里程碑版本(DMR)發佈! 可能有人會驚奇 MySQL 為何從 5.x 一下跳躍到了 8.0。事實上,MySQL 5.x 系列已經延續了很多年,從被 Oracle 收購之前就是 5.1,而收購之後一直維持在 5.x,比如 5.5,5. ...
  • 【等待事件】等待事件系列(3+4)--System IO(控制文件)+日誌類等待 1 BLOG文檔結構圖 2 前言部分 2.1 導讀和註意事項 各位技術愛好者,看完本文後,你可以掌握如下的技能,也可以學到一些其它你所不知道的知識,~O(∩_∩)O~: ① 控制文件類等待 ② 日誌類等待 2.2 相關... ...
  • 每一個資料庫連接可以包括多個資料庫文件,一個主資料庫文件和attached的幾個資料庫文件。每一個資料庫文件都有自己的B-tree和pager。資料庫連接(connection)和事務(transaction)的關係1. 每一個資料庫連接都必須在事務下進行操作2. 每一個資料庫連接不同同時打開多個... ...
  • https://blueprints.launchpad.net/myconnpy/+spec/sp-multi-resultsets Calling a stored procedure can produce multiple result sets. They should be retrie ...
一周排行
    -Advertisement-
    Play Games
  • 示例項目結構 在 Visual Studio 中創建一個 WinForms 應用程式後,項目結構如下所示: MyWinFormsApp/ │ ├───Properties/ │ └───Settings.settings │ ├───bin/ │ ├───Debug/ │ └───Release/ ...
  • [STAThread] 特性用於需要與 COM 組件交互的應用程式,尤其是依賴單線程模型(如 Windows Forms 應用程式)的組件。在 STA 模式下,線程擁有自己的消息迴圈,這對於處理用戶界面和某些 COM 組件是必要的。 [STAThread] static void Main(stri ...
  • 在WinForm中使用全局異常捕獲處理 在WinForm應用程式中,全局異常捕獲是確保程式穩定性的關鍵。通過在Program類的Main方法中設置全局異常處理,可以有效地捕獲並處理未預見的異常,從而避免程式崩潰。 註冊全局異常事件 [STAThread] static void Main() { / ...
  • 前言 給大家推薦一款開源的 Winform 控制項庫,可以幫助我們開發更加美觀、漂亮的 WinForm 界面。 項目介紹 SunnyUI.NET 是一個基於 .NET Framework 4.0+、.NET 6、.NET 7 和 .NET 8 的 WinForm 開源控制項庫,同時也提供了工具類庫、擴展 ...
  • 說明 該文章是屬於OverallAuth2.0系列文章,每周更新一篇該系列文章(從0到1完成系統開發)。 該系統文章,我會儘量說的非常詳細,做到不管新手、老手都能看懂。 說明:OverallAuth2.0 是一個簡單、易懂、功能強大的許可權+可視化流程管理系統。 有興趣的朋友,請關註我吧(*^▽^*) ...
  • 一、下載安裝 1.下載git 必須先下載並安裝git,再TortoiseGit下載安裝 git安裝參考教程:https://blog.csdn.net/mukes/article/details/115693833 2.TortoiseGit下載與安裝 TortoiseGit,Git客戶端,32/6 ...
  • 前言 在項目開發過程中,理解數據結構和演算法如同掌握蓋房子的秘訣。演算法不僅能幫助我們編寫高效、優質的代碼,還能解決項目中遇到的各種難題。 給大家推薦一個支持C#的開源免費、新手友好的數據結構與演算法入門教程:Hello演算法。 項目介紹 《Hello Algo》是一本開源免費、新手友好的數據結構與演算法入門 ...
  • 1.生成單個Proto.bat內容 @rem Copyright 2016, Google Inc. @rem All rights reserved. @rem @rem Redistribution and use in source and binary forms, with or with ...
  • 一:背景 1. 講故事 前段時間有位朋友找到我,說他的窗體程式在客戶這邊出現了卡死,讓我幫忙看下怎麼回事?dump也生成了,既然有dump了那就上 windbg 分析吧。 二:WinDbg 分析 1. 為什麼會卡死 窗體程式的卡死,入口門檻很低,後續往下分析就不一定了,不管怎麼說先用 !clrsta ...
  • 前言 人工智慧時代,人臉識別技術已成為安全驗證、身份識別和用戶交互的關鍵工具。 給大家推薦一款.NET 開源提供了強大的人臉識別 API,工具不僅易於集成,還具備高效處理能力。 本文將介紹一款如何利用這些API,為我們的項目添加智能識別的亮點。 項目介紹 GitHub 上擁有 1.2k 星標的 C# ...