1. 程式人生 > >【python】-- 安裝 xadmin錯誤:"UnicodeDecodeError: 'gbk' codec can't decode byte 0xa4 in position 3444"

【python】-- 安裝 xadmin錯誤:"UnicodeDecodeError: 'gbk' codec can't decode byte 0xa4 in position 3444"

在學習 Django 時,需要安裝 xadmin ,結果出現了一下錯誤

C:\WINDOWS\system32>pip install xadmin
Collecting xadmin
  Using cached xadmin-0.6.1.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users
\pinsily\AppData\Local\Temp\pip-build-xzvebsss\xadmin\setup.py", line 11, in <module> long_description=open('README.rst').read(), UnicodeDecodeError: 'gbk' codec can't decode byte 0xa4 in position 3444: illegal multibyte sequence ---------------------------------------- Command "python setup.py egg_info" failed with error code 1 in C:\Users
\pinsily\AppData\Local\Temp\pip-build-xzvebsss\xadmin\



網上搜索了一下,說是 python3 不支援 xadmin,結果還是找到了解決的方法

從錯誤中可以看到,是檔案README.rst 出現了 Unicode 解碼錯誤,這個檔案時沒有什麼用處的,可以新建一個同名的空白檔案替換掉



新建空白檔案README.rst 壓縮排 zip 中替換掉同名檔案

這裡寫圖片描述



使用管理員命令列介面進行安裝

C:\WINDOWS\system32>pip install xadmin-master.zip
Processing xadmin-master
.zip Requirement already satisfied: setuptools in c:\program files (x86)\python36-32\lib\site-packages (from xadmin==0.6.1) Requirement already satisfied: django<2.0.0,>=1.9.0 in c:\program files (x86)\python36-32\lib\site-packages (from xadmin==0.6.1) Collecting django-crispy-forms>=1.6.0 (from xadmin==0.6.1) Using cached django_crispy_forms-1.6.1-py2.py3-none-any.whl Collecting django-reversion>=2.0.0 (from xadmin==0.6.1) Using cached django_reversion-2.0.8-py2.py3-none-any.whl Collecting django-formtools>=1.0 (from xadmin==0.6.1) Using cached django_formtools-2.0-py2.py3-none-any.whl Collecting httplib2==0.9.2 (from xadmin==0.6.1) Using cached httplib2-0.9.2.zip Requirement already satisfied: pytz in c:\program files (x86)\python36-32\lib\site-packages (from django<2.0.0,>=1.9.0->xadmin==0.6.1) Installing collected packages: django-crispy-forms, django-reversion, django-formtools, httplib2, xadmin Running setup.py install for httplib2 ... done Running setup.py install for xadmin ... done Successfully installed django-crispy-forms-1.6.1 django-formtools-2.0 django-reversion-2.0.8 httplib2-0.9.2 xadmin-0.6.1