0

I'm on Python 3.6 and trying to use py -m pip install discord.py to install the discord package to write a discord bot. However, that command works most of the way until it says Rolling back uninstall of pip and then it crashes like so:

Exception: Traceback (most recent call last): File "C:\Program Files\Python36\lib\site-packages\pip\basecommand.py", line 211, in main status = self.run(options, args) File "C:\Program Files\Python36\lib\site-packages\pip\commands\install.py", line 311, in run root=options.root_path, File "C:\Program Files\Python36\lib\site-packages\pip\req\req_set.py", line 646, in install **kwargs File "C:\Program Files\Python36\lib\site-packages\pip\req\req_install.py", line 803, in install self.move_wheel_files(self.source_dir, root=root) File "C:\Program Files\Python36\lib\site-packages\pip\req\req_install.py", line 998, in move_wheel_files isolated=self.isolated, File "C:\Program Files\Python36\lib\site-packages\pip\wheel.py", line 449, in move_wheel_files generated.extend(maker.make(spec)) File "C:\Program Files\Python36\lib\site-packages\pip_vendor\distlib\scripts.py", line 353, in make self._make_script(entry, filenames, options=options) File "C:\Program Files\Python36\lib\site-packages\pip_vendor\distlib\scripts.py", line 257, in _make_script self._write_script(scriptnames, shebang, script, filenames, ext) File "C:\Program Files\Python36\lib\site-packages\pip_vendor\distlib\scripts.py", line 193, in _write_script launcher = self._get_launcher('t') File "C:\Program Files\Python36\lib\site-packages\pip_vendor\distlib\scripts.py", line 332, in _get_launcher result = finder(distlib_package).find(name).bytes File "C:\Program Files\Python36\lib\site-packages\pip_vendor\distlib\resources.py", line 324, in finder raise DistlibException('Unable to locate finder for %r' % package) pip._vendor.distlib.DistlibException: Unable to locate finder for 'pip._vendor.distlib' You are using pip version 7.1.2, however version 9.0.3 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' command.

So I try updating pip with py -m pip install --upgrade pip and it works most of the way until Rolling back uninstall of pip where it says:

Exception: Traceback (most recent call last): File "C:\Program Files\Python36\lib\site-packages\pip\basecommand.py", line 211, in main status = self.run(options, args) File "C:\Program Files\Python36\lib\site-packages\pip\commands\install.py", line 311, in run root=options.root_path, File "C:\Program Files\Python36\lib\site-packages\pip\req\req_set.py", line 646, in install **kwargs File "C:\Program Files\Python36\lib\site-packages\pip\req\req_install.py", line 803, in install self.move_wheel_files(self.source_dir, root=root) File "C:\Program Files\Python36\lib\site-packages\pip\req\req_install.py", line 998, in move_wheel_files isolated=self.isolated, File "C:\Program Files\Python36\lib\site-packages\pip\wheel.py", line 449, in move_wheel_files generated.extend(maker.make(spec)) File "C:\Program Files\Python36\lib\site-packages\pip_vendor\distlib\scripts.py", line 353, in make self._make_script(entry, filenames, options=options) File "C:\Program Files\Python36\lib\site-packages\pip_vendor\distlib\scripts.py", line 257, in _make_script self._write_script(scriptnames, shebang, script, filenames, ext) File "C:\Program Files\Python36\lib\site-packages\pip_vendor\distlib\scripts.py", line 193, in _write_script launcher = self._get_launcher('t') File "C:\Program Files\Python36\lib\site-packages\pip_vendor\distlib\scripts.py", line 332, in _get_launcher result = finder(distlib_package).find(name).bytes File "C:\Program Files\Python36\lib\site-packages\pip_vendor\distlib\resources.py", line 324, in finder raise DistlibException('Unable to locate finder for %r' % package) pip._vendor.distlib.DistlibException: Unable to locate finder for 'pip._vendor.distlib' You are using pip version 7.1.2, however version 9.0.3 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' command.

Oddly enough, trying to just run pip in the command prompt it gives me 'pip' is not recognized as an internal or external command, operable program or batch file.

I've tried uninstalling with py -m pip uninstall pip setuptools and reinstalling by running py get-pip.py on the python file, none of which seem to do anything.

So I have no way of uninstalling, reinstalling, or upgrading pip, and I can't use the current version of pip to install anything. I've searched for hours and tried changing my PATH variable and looking at file path limits, but I'm completly stuck and very new to this type of thing. I'm on Windows 10.

EDIT: "pip", "pip3", "python" and "python3" commands don't work. "py" command works.

EDIT: I seem to have gotten around using pip this time. I downloaded the discord package from github then followed instructions here which say to run py setup.py install --user. Still, I'd like to be able to use pip in the future.

Justin
  • 945
  • 12
  • 26
  • You need to add the `[python install path]/Scripts` directory to your `PATH`. Then you can just run `pip install pip --upgrade` – Brendan Abel Apr 01 '18 at 03:49

1 Answers1

0

There are couple solutions. You can reinstall python and during installation add it to environmental variable. Another way would be adding scripts and python to environmental path. http://www.correlatedsolutions.com/support/index.php?/Knowledgebase/Article/View/85/1/running-python-scripts-from-anywhere-under-windows.

  • After many many hours of trying to get this to work, today I finally got it. I disabled the windows path size limit (for the third time), redownloaded the newest version of python 3 (for the fifth time), added C:\Program Files\Python36\Scripts to my PATH settings (after checking dozens of posts online not a single one said "Program Files" (and this was my second time adding it to my PATH settings), then I just typed pip and it worked and told me it was outdated, I tried updating it and it didn't work but after a bunch of trial and error I got it to update. – Justin Apr 30 '18 at 07:13
  • TL;DR: Set your PATH variable, disable path size limit, and reinstall python (Windows). God I hate pip. – Justin Apr 30 '18 at 07:14
  • 1
    Also if someone else could please answer this question with what I commented that'd be appreciated. I can't "answer" it because they're not "accepting answers from this account anymore". This website has a real problem with it's karma checking system, makes it so legitamate people who only want to help the community are unable to. – Justin Apr 30 '18 at 07:15