Unicodedecorror in "Pip upgrade" and "install pywinusb"

Asked

Viewed 72 times

0

My experience in Python is not much, but no error of this kind had yet appeared in any installation. As always appeared the message to upgrade the version of Pip, I decided to continue with this update, and that’s when I appeared this error.

Before I had installed the package "pyusb" without any problem.

I tried to install the package "pywinusb" and I had the same error in the upgrade of Pip.

I have done several searches through Google, but I have not found any answer that explains why this error...

PS C:\Python27> pip --version
pip 18.1 from c:\python27\lib\site-packages\pip (python 2.7)

PS C:\Python27> python -m pip install --upgrade pip
Collecting pip
Exception:
Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\pip\_internal\cli\base_command.py", line 143, in main
    status = self.run(options, args)
  File "C:\Python27\lib\site-packages\pip\_internal\commands\install.py", line 318, in run
    resolver.resolve(requirement_set)
  File "C:\Python27\lib\site-packages\pip\_internal\resolve.py", line 102, in resolve
    self._resolve_one(requirement_set, req)
  File "C:\Python27\lib\site-packages\pip\_internal\resolve.py", line 256, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "C:\Python27\lib\site-packages\pip\_internal\resolve.py", line 209, in _get_abstract_dist_for
    self.require_hashes
  File "C:\Python27\lib\site-packages\pip\_internal\operations\prepare.py", line 283, in prepare_linked_requirement
    progress_bar=self.progress_bar
  File "C:\Python27\lib\site-packages\pip\_internal\download.py", line 836, in unpack_url
    progress_bar=progress_bar
  File "C:\Python27\lib\site-packages\pip\_internal\download.py", line 673, in unpack_http_url
    progress_bar)
  File "C:\Python27\lib\site-packages\pip\_internal\download.py", line 895, in _download_http_url
    file_path = os.path.join(temp_dir, filename)
  File "C:\Python27\lib\ntpath.py", line 85, in join
    result_path = result_path + p_path
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 8: ordinal not in range(128)
You are using pip version 18.1, however version 19.1.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

PS C:\Python27> pip install pywinusb
Collecting pywinusb
Exception:
Traceback (most recent call last):
  File "c:\python27\lib\site-packages\pip\_internal\cli\base_command.py", line 143, in main
    status = self.run(options, args)
  File "c:\python27\lib\site-packages\pip\_internal\commands\install.py", line 318, in run
    resolver.resolve(requirement_set)
  File "c:\python27\lib\site-packages\pip\_internal\resolve.py", line 102, in resolve
    self._resolve_one(requirement_set, req)
  File "c:\python27\lib\site-packages\pip\_internal\resolve.py", line 256, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "c:\python27\lib\site-packages\pip\_internal\resolve.py", line 209, in _get_abstract_dist_for
    self.require_hashes
  File "c:\python27\lib\site-packages\pip\_internal\operations\prepare.py", line 283, in prepare_linked_requirement
    progress_bar=self.progress_bar
  File "c:\python27\lib\site-packages\pip\_internal\download.py", line 836, in unpack_url
    progress_bar=progress_bar
  File "c:\python27\lib\site-packages\pip\_internal\download.py", line 673, in unpack_http_url
    progress_bar)
  File "c:\python27\lib\site-packages\pip\_internal\download.py", line 895, in _download_http_url
    file_path = os.path.join(temp_dir, filename)
  File "c:\python27\lib\ntpath.py", line 85, in join
    result_path = result_path + p_path
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 8: ordinal not in range(128)

My question is what could be causing the mistake: "Unicodedecodeerror: 'ascii' codec can’t Decode byte 0xe9 in position 8: ordinal not in range(128)"?

  • About this particular mistake: "Unicodedecodeerror: 'ascii' codec can’t Decode byte 0xe9 in position 8: ordinal not in range(128)", when I was trying to upgrade to Pip or trying to install any python package, it was due to the name of my user folder. My folder had the name "C:/Users/Sérgio Neves", and the "is" in "Sérgio" was the problem, so I changed the name of my folder to "C:/Users/Sergioneves", without accents or spaces. Thus, I have already managed to install Pip and python packages.

1 answer

0

You can try updating Python to a more current version (type version 3.7). With Python updated and configured on path If you need to keep version 2.7 for any reason you can use the virtualenv.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.