简体   繁体   中英

Can't install Python v3.6 packages on Windows 10 via pip

I recently installed python on my Windows 10 machine but I can't download packages via pip. I have 3.6.1 installed. PIP is version 9.0.1.

For example, this happens:

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\

For the record, I've tried the following:

  1. Installing pyCurl (Can't even remember why I did this now)
  2. Tried pip install --upgrade setuptools and easy_install -U setuptools .

I got this working on pythonista on IOS easier than this - why does Windows have to be so difficult?!

Is there a way to fix this?

There is a problem with the package when installing on Windows, which is why you are getting the error. It is not a pip or Windows problem.

The author of the package has fixed the problem on GitHub (see the commit ), but not pushed the updated package onto PyPI, which is the default source for packages that are installed by pip and easy_install.

In the meantime, you can work around this by directly installing the latest package from GitHub with pip install https://github.com/divijbindlish/parse-torrent-name/archive/master.zip .

There are other ways to install packages from GitHub too, as detailed here . You can even download the zip manually, and install the zip with easy_install, if you want.

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