question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pip 19.0.3 -> 19.2.3 fails with AttributeError: 'NoneType' object has no attribute 'bytes'

See original GitHub issue

Environment

  • pip version: 19.0.3
  • Python version: 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)] on win32
  • OS: Win10 (1809, 17763.737)

Description Error occurs during upgrade.

Expected behavior pip installs without error.

How to Reproduce

  1. Download Python 3.7.4 from https://www.python.org/downloads/release/python-374/ (web-based installer)
  2. Install for all users
  3. Open cmd / PowerShell as admin
  4. C:\WINDOWS\system32>python -m pip install --upgrade pip

Output

Collecting pip
  Using cached https://files.pythonhosted.org/packages/30/db/9e38760b32e3e7f40cce46dd5fb107b8c73840df38f0046d8e6514e675a1/pip-19.2.3-py2.py3-none-any.whl
Installing collected packages: pip
  Found existing installation: pip 19.0.3
    Uninstalling pip-19.0.3:
      Successfully uninstalled pip-19.0.3
  Rolling back uninstall of pip
  Moving to c:\users\user\appdata\roaming\python\python37\scripts\pip.exe
   from C:\Users\User\AppData\Local\Temp\pip-uninstall-akvm93y4\pip.exe
  Moving to c:\users\user\appdata\roaming\python\python37\scripts\pip3.7.exe
   from C:\Users\User\AppData\Local\Temp\pip-uninstall-akvm93y4\pip3.7.exe
  Moving to c:\users\user\appdata\roaming\python\python37\scripts\pip3.exe
   from C:\Users\User\AppData\Local\Temp\pip-uninstall-akvm93y4\pip3.exe
  Moving to c:\users\user\appdata\roaming\python\python37\site-packages\pip-19.0.3.dist-info\
   from c:\users\user\appdata\roaming\python\python37\site-packages\~ip-19.0.3.dist-info
  Moving to c:\users\user\appdata\roaming\python\python37\site-packages\pip\
   from c:\users\user\appdata\roaming\python\python37\site-packages\~ip
Exception:
Traceback (most recent call last):
  File "C:\Users\User\AppData\Roaming\Python\Python37\site-packages\pip\_internal\cli\base_command.py", line 179, in main
    status = self.run(options, args)
  File "C:\Users\User\AppData\Roaming\Python\Python37\site-packages\pip\_internal\commands\install.py", line 393, in run
    use_user_site=options.use_user_site,
  File "C:\Users\User\AppData\Roaming\Python\Python37\site-packages\pip\_internal\req\__init__.py", line 57, in install_given_reqs
    **kwargs
  File "C:\Users\User\AppData\Roaming\Python\Python37\site-packages\pip\_internal\req\req_install.py", line 913, in install
    use_user_site=use_user_site, pycompile=pycompile,
  File "C:\Users\User\AppData\Roaming\Python\Python37\site-packages\pip\_internal\req\req_install.py", line 445, in move_wheel_files
    warn_script_location=warn_script_location,
  File "C:\Users\User\AppData\Roaming\Python\Python37\site-packages\pip\_internal\wheel.py", line 544, in move_wheel_files
    generated.extend(maker.make(spec))
  File "C:\Users\User\AppData\Roaming\Python\Python37\site-packages\pip\_vendor\distlib\scripts.py", line 405, in make
    self._make_script(entry, filenames, options=options)
  File "C:\Users\User\AppData\Roaming\Python\Python37\site-packages\pip\_vendor\distlib\scripts.py", line 309, in _make_script
    self._write_script(scriptnames, shebang, script, filenames, ext)
  File "C:\Users\User\AppData\Roaming\Python\Python37\site-packages\pip\_vendor\distlib\scripts.py", line 245, in _write_script
    launcher = self._get_launcher('t')
  File "C:\Users\User\AppData\Roaming\Python\Python37\site-packages\pip\_vendor\distlib\scripts.py", line 384, in _get_launcher
    result = finder(distlib_package).find(name).bytes
AttributeError: 'NoneType' object has no attribute 'bytes'
You are using pip version 19.0.3, however version 19.2.3 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

I also tried using solution from https://github.com/pypa/pip/issues/5820#issuecomment-428611054

C:\WINDOWS\system32>python -m pip install -U --force-reinstall pip
Collecting pip
  Using cached https://files.pythonhosted.org/packages/30/db/9e38760b32e3e7f40cce46dd5fb107b8c73840df38f0046d8e6514e675a1/pip-19.2.3-py2.py3-none-any.whl
Installing collected packages: pip
  Found existing installation: pip 19.0.3
    Uninstalling pip-19.0.3:
      Successfully uninstalled pip-19.0.3
  Rolling back uninstall of pip
  Moving to c:\users\user\appdata\roaming\python\python37\scripts\pip.exe
   from C:\Users\User\AppData\Local\Temp\pip-uninstall-1kl45zbn\pip.exe
  Moving to c:\users\user\appdata\roaming\python\python37\scripts\pip3.7.exe
   from C:\Users\User\AppData\Local\Temp\pip-uninstall-1kl45zbn\pip3.7.exe
  Moving to c:\users\user\appdata\roaming\python\python37\scripts\pip3.exe
   from C:\Users\User\AppData\Local\Temp\pip-uninstall-1kl45zbn\pip3.exe
  Moving to c:\users\user\appdata\roaming\python\python37\site-packages\pip-19.0.3.dist-info\
   from c:\users\user\appdata\roaming\python\python37\site-packages\~ip-19.0.3.dist-info
  Moving to c:\users\user\appdata\roaming\python\python37\site-packages\pip\
   from c:\users\user\appdata\roaming\python\python37\site-packages\~ip
Exception:
Traceback (most recent call last):
  File "C:\Users\User\AppData\Roaming\Python\Python37\site-packages\pip\_internal\cli\base_command.py", line 179, in main
    status = self.run(options, args)
  File "C:\Users\User\AppData\Roaming\Python\Python37\site-packages\pip\_internal\commands\install.py", line 393, in run
    use_user_site=options.use_user_site,
  File "C:\Users\User\AppData\Roaming\Python\Python37\site-packages\pip\_internal\req\__init__.py", line 57, in install_given_reqs
    **kwargs
  File "C:\Users\User\AppData\Roaming\Python\Python37\site-packages\pip\_internal\req\req_install.py", line 913, in install
    use_user_site=use_user_site, pycompile=pycompile,
  File "C:\Users\User\AppData\Roaming\Python\Python37\site-packages\pip\_internal\req\req_install.py", line 445, in move_wheel_files
    warn_script_location=warn_script_location,
  File "C:\Users\User\AppData\Roaming\Python\Python37\site-packages\pip\_internal\wheel.py", line 544, in move_wheel_files
    generated.extend(maker.make(spec))
  File "C:\Users\User\AppData\Roaming\Python\Python37\site-packages\pip\_vendor\distlib\scripts.py", line 405, in make
    self._make_script(entry, filenames, options=options)
  File "C:\Users\User\AppData\Roaming\Python\Python37\site-packages\pip\_vendor\distlib\scripts.py", line 309, in _make_script
    self._write_script(scriptnames, shebang, script, filenames, ext)
  File "C:\Users\User\AppData\Roaming\Python\Python37\site-packages\pip\_vendor\distlib\scripts.py", line 245, in _write_script
    launcher = self._get_launcher('t')
  File "C:\Users\User\AppData\Roaming\Python\Python37\site-packages\pip\_vendor\distlib\scripts.py", line 384, in _get_launcher
    result = finder(distlib_package).find(name).bytes
AttributeError: 'NoneType' object has no attribute 'bytes'
You are using pip version 19.0.3, however version 19.2.3 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

ы

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
tonystevenjcommented, Oct 29, 2019

“easy_install -U pip” works!

3reactions
mrsmirzaeecommented, Oct 28, 2019

I uesd ithis command " easy_install -U pip " and work for me

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python 3.5 pip 9 AttributeError: 'NoneType' object has no ...
find(name). bytes AttributeError: 'NoneType' object has no attribute 'bytes' You are using pip version 9.0.
Read more >
Pip AttributeError: 'NoneType' object has no attribute 'bytes'
You go to upgrade pip in Python and you get the AttributeError: AttributeError : ' NoneType ' object has no attribute ' bytes...
Read more >
AttributeError: 'NoneType' object has no attribute 'bytes'
AttributeError : 'NoneType' object has no attribute 'bytes'. Trying to upgrade pip to 10.x after creating a virtual env. Collecting pip==10.0.1 Using cached ......
Read more >
python中pip升级报错,AttributeError: 'NoneType' object has ...
1. (tf2.0) F:\Pycharm代码>pip show pip Name: pip Version: 19.3.1 Summary: The PyPA recommended tool for installing Python packages.
Read more >
Installation - pip documentation v22.3.1
If your Python environment does not have pip installed, there are 2 mechanisms to install pip supported directly by pip's maintainers: ensurepip. get-pip.py ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found