簡體   English   中英

mysql-python連接器可同時使用python2.7和3.4

[英]mysql-python connector work with python2.7 and 3.4 at the same time

Python 2.7和3.4在我的mac-os中共存。 安裝官方的mysql連接器(從dev.mysql.com下載)后, import mysql.connector只能傳入python 2.7。 連接器有什么辦法可以同時在兩個python版本中使用嗎?

您可以通過pypi的易於安裝或pip安裝相同的連接器

easy_install-3.4 mysql-connector-python

相對於Python 3.6:

我在OSX上安裝mysql官方連接器后,才在python 2.7中運行。 作為替代方案,我使用了集成在python 3.6中的easy_install-3.6 python模塊

轉到目錄:/Library/Frameworks/Python.framework/Versions/3.6/bin

命令:easy_install-3.6 mysql-connector-python

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM