Pip Error when installing

2019-09-16 15:52发布

问题:

Whenever I try to install pip usin the get-pip.py script, it just gives me errors. Ran cmd as Admin, re-installed python already..

I'm using python 2.7.9

 Exception:
  Traceback (most recent call last):
    File "c:\users\alex temporõr\appdata\local\temp\tmp13p7cp\pip.zip\pip\basecommand.py", line 232, in main
      status = self.run(options, args)
    File "c:\users\alex temporõr\appdata\local\temp\tmp13p7cp\pip.zip\pip\commands\install.py", line 339, in run
      requirement_set.prepare_files(finder)
    File "c:\users\alex temporõr\appdata\local\temp\tmp13p7cp\pip.zip\pip\req\req_set.py", line 355, in prepare_files
      do_download, session=self.session,
    File "c:\users\alex temporõr\appdata\local\temp\tmp13p7cp\pip.zip\pip\download.py", line 782, in unpack_url
      session,
    File "c:\users\alex temporõr\appdata\local\temp\tmp13p7cp\pip.zip\pip\download.py", line 667, in unpack_http_url
      from_path, content_type = _download_http_url(link, session, temp_dir)
    File "c:\users\alex temporõr\appdata\local\temp\tmp13p7cp\pip.zip\pip\download.py", line 841, in _download_http_url
      file_path = os.path.join(temp_dir, filename)
    File "C:\Python27\lib\ntpath.py", line 84, in join
      result_path = result_path + p_path
  UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 18: ordinal not in range(128)</code>

Ok, It was indeed because of the "ä" in the name, changed the user and it installed fine, thanks to Padraic Cunningham for pointing it out.

回答1:

Just for the sake of completeness, in this case the problem, as pointed out by Padraic, the problem was the non-ASCII character in your username. A similar error would have occurred if you had had non-ASCII characters in your computer name. So, for you poor souls finding this, be ware of that :-)