2015-05-17 44 views
1

我使用Arch Linux與Python 3默認。下載Django的工具區與命令pip install django-toolbelt 名稱:PIP 版本:6.1.1Pip install django-toolbelt得到一個錯誤:「codecs.ascii_decode(input,self.errors)[0] UnicodeDecodeError:'ascii'編解碼器無法解碼字節0xc2

我得到一個錯誤

Collecting django-toolbelt 
    Using cached django-toolbelt-0.0.1.tar.gz 
Requirement already satisfied (use --upgrade to upgrade): django in ./venv/lib/python3.4/site-packages (from django-toolbelt) 
Requirement already satisfied (use --upgrade to upgrade): psycopg2 in ./venv/lib/python3.4/site-packages (from django-toolbelt) 
Collecting gunicorn (from django-toolbelt) 
    Using cached gunicorn-19.3.0-py2.py3-none-any.whl 
Collecting dj-database-url (from django-toolbelt) 
    Using cached dj_database_url-0.3.0-py2.py3-none-any.whl 
Collecting dj-static (from django-toolbelt) 
    Using cached dj-static-0.0.6.tar.gz 
Collecting static3 (from dj-static->django-toolbelt) 
    Using cached static3-0.6.0.tar.gz 
    Complete output from command python setup.py egg_info: 
    Traceback (most recent call last): 
     File "<string>", line 20, in <module> 
     File "/tmp/pip-build-w5v7urb2/static3/setup.py", line 52, in <module> 
     long_description=open('README.rst').read(), 
     File "/home/phi/python/venv/lib/python3.4/encodings/ascii.py", line 26, in decode 
     return codecs.ascii_decode(input, self.errors)[0] 
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 2097: ordinal not in range(128) 

    ---------------------------------------- 
    Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-w5v7urb2/static3 

我該如何解決

+0

發佈完整追溯。也張貼確切版本的點子。 – Alik

+0

look heer http://stackoverflow.com/questions/21129020/how-to-fix-unicodedecodeerror-ascii-codec-cant-decode-byte –

+0

@Alik再次爲我檢查。謝謝你和@埃佈雷我試過,但沒有工作 – user3863069

回答

3

運行

LC_ALL=en_US.utf8 pip install django-toolbelt 

有在pip一個問題。如果您使用非Unicode字段設置(如C)並嘗試安裝包含pipUnicodeDecodeErrors的程序包,則setup.py可能會嘗試讀取包含非ASCII字符的文件。

在這種情況下,它是在this change引入的急性口音。

我打算在Github上報告這個問題。

+0

好的,謝謝你的幫助。 :) – user3863069

相關問題