鍍金池/ 問答/Python  數(shù)據(jù)庫  網絡安全/ python3 pip install mysqlclient報錯

python3 pip install mysqlclient報錯

報錯顯示如下,不清楚是哪里的編碼問題,環(huán)境是win10+python3.7

PS C:\Users\zhu\python\mysite> pip3 install mysqlclient
Collecting mysqlclient
  Using cached mysqlclient-1.3.12.tar.gz
Installing collected packages: mysqlclient
  Running setup.py install for mysqlclient ... error
Exception:
Traceback (most recent call last):
  File "c:\users\zhu\appdata\local\programs\python\python37\lib\site-packages\pip\compat\__init__.py", line 73, in console_to_str
    return s.decode(sys.__stdout__.encoding)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xce in position 33: invalid continuation byte

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\users\zhu\appdata\local\programs\python\python37\lib\site-packages\pip\basecommand.py", line 215, in main
    status = self.run(options, args)
  File "c:\users\zhu\appdata\local\programs\python\python37\lib\site-packages\pip\commands\install.py", line 342, in run
    prefix=options.prefix_path,
  File "c:\users\zhu\appdata\local\programs\python\python37\lib\site-packages\pip\req\req_set.py", line 784, in install
    **kwargs
  File "c:\users\zhu\appdata\local\programs\python\python37\lib\site-packages\pip\req\req_install.py", line 878, in install
    spinner=spinner,
  File "c:\users\zhu\appdata\local\programs\python\python37\lib\site-packages\pip\utils\__init__.py", line 676, in call_subprocess
    line = console_to_str(proc.stdout.readline())
  File "c:\users\zhu\appdata\local\programs\python\python37\lib\site-packages\pip\compat\__init__.py", line 75, in console_to_str
    return s.decode('utf_8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xce in position 33: invalid continuation byte
回答
編輯回答
入她眼

update一下pip應該就好了。解釋在這:https://stackoverflow.com/que...

2018年3月16日 03:47
編輯回答
別逞強

yum install gcc python-devel mysql-devel -y

2018年3月2日 16:49
編輯回答
孤客

試試pip install mysqlclient-1.3.7-cp35-cp35m-win_amd64.whl

2018年5月13日 17:48