简体   繁体   English

无法使用PIP安装资料库

[英]Unable to install a Library using PIP

So I'm trying to follow a tutorial to connect to an SQL database, using Connector/Python. 因此,我正在尝试遵循一个使用Connector / Python连接到SQL数据库的教程。

I have to import it, obviously: 我必须导入它,显然:

import mysql.connector 导入mysql.connector

So I tried pip install mysql in the terminal. 所以我尝试在终端上pip install mysql

This is what I got: 这就是我得到的:

Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/g6/yrxcmygn3ls375rm9rh3p86r0000gn/T/pip-build-a0d0rzdl/MySQL-python/ 命令“ python setup.py egg_info”在/ private / var / folders / g6 / yrxcmygn3ls375rm9rh3p86r0000gn / T / pip-build-a0d0rzdl / MySQL-python /中失败,错误代码为1

What I've tried from looking up on Google: 我在Google上查询过的内容:

pip install --upgrade setuptools

pip install ez_setup

pip install unroll

easy_install -U setuptools

Nothing worked 什么都没做

Thanks 谢谢

MySQL-Python is not available for Python 3, you may consider using MySqlClient which is a fork of the MySQL-python interface for the MySQL database. MySQL-Python无法用于Python 3,您可以考虑使用MySqlClient ,它是MySQL数据库的MySQL-python接口的分支。

Before installing this connector, make sure MySQL (or MariaDB) is installed. 在安装此连接器之前,请确保已安装MySQL(或MariaDB)。

To install, an application, the best practices is to use a virtualenv. 要安装应用程序,最佳实践是使用virtualenv。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM