简体   繁体   中英

Python 3 installed and unable to install MySQLdb due to 2.7 deprecation error

I've got python 3 installed

spiders$ python -V
Python 3.8.5

And when I attempt to install MYSQLD I get the following message:

spiders$ pip install mysqlclient
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Defaulting to user installation because normal site-packages is not writeable
Collecting mysqlclient
  Using cached mysqlclient-1.4.6.tar.gz (85 kB)
    ERROR: Command errored out with exit status 1:

I see that this might be due to the python directory under which Pip sits. But I'm incredibly uneducated about this. Any help is appreciated.

pip3 install mysql-connector-python fixed it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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