我最近在我的Windows 10机器上安装了python,但我无法通过pip下载软件包。我安装了3.6.1。 PIP是版本9.0.1。
例如,会发生这种情况:
Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.
C:\WINDOWS\system32>pip install parse-torrent-name
Collecting parse-torrent-name
Using cached parse-torrent-name-1.1.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\Kintesh\AppData\Local\Temp\pip-build-uf2g9dii\parse-torrent
-name\setup.py", line 5, in <module>
description = f.read()
File "c:\users\kintesh\appdata\local\programs\python\python36-32\lib\encod
ings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 292:
character maps to <undefined>
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\Kintesh\
AppData\Local\Temp\pip-build-uf2g9dii\parse-torrent-name\
为了记录,我尝试了以下内容:
pip install --upgrade setuptools
和easy_install -U setuptools
。我在IOS上使用pythonista的工作比这更容易 - 为什么Windows必须如此困难?!
有没有办法解决这个问题?
答案 0 :(得分:0)
在Windows上安装时包有问题,这就是您收到错误的原因。这不是一个点子或Windows问题。
该软件包的作者修复了GitHub上的问题(请参阅commit),但没有将更新的软件包推送到PyPI,这是由pip和easy_install安装的软件包的默认源。
与此同时,您可以通过使用pip install https://github.com/divijbindlish/parse-torrent-name/archive/master.zip
直接从GitHub安装最新的软件包来解决此问题。
还有其他方法可以从GitHub安装软件包,详见here。您甚至可以手动下载zip,如果需要,也可以使用easy_install安装zip。