Page MenuHomePhabricator

Trouble using Python 3.8.3 pip on Windows 10
Closed, InvalidPublic

Description

I tried configuring Pywikibot on my local machine, having OS Windows 10 (version 2004).

  1. After successfully downloading and extracting the zipped file, I followed the installation commands from https://www.mediawiki.org/wiki/Manual:Pywikibot/Installation#Install_Pywikibot .
  1. The following commands were run in 'cmd'.
$ c:
$ cd "\Users\username\core-stable"
$ python pwb.py generate_user_files
  1. After running the last line, a request popped up which said:
The 'requests>=2.20.1; python_version >= "3.6"' distribution was not found and is required by the application

A package necessary for pywikibot is missing.
Please update required module with:


    pip install "requests>=2.20.1"
  1. After running pip install "requests>=2.20.1", an error popped up on the screen stating that:

The system cannot find the file specified.

It is very unclearly as to why the system says that it cannot find the file specified after running pip install "requests>=2.20.1".

Details:

python --version: Python 3.8.3
pywikibot version: whichever was in the package/pywikibot/core_stable.zip on 2021-04-02
OS: Windows 10
OS Version: 2004

Event Timeline

Mike_Peel subscribed.

This is for an Outreachy project, so is a bit urgent to fix please, but I'm not sure what the answer is.

Can you post a screenshot of the full error when running

pip install "requests>=2.20.1"

cc'ing @Xqt and @valhallasw who I believe both use Windows for Pywikibot who might be able to help.

Can you post a screenshot of the full error when running

pip install "requests>=2.20.1"

Here it is.

image.png (658×1 px, 88 KB)

NOTE: The first piwikibot I have mentioned is a directory I made to store core-stable.

Ah, try "pip install requests" to see if that works.

Ah, try "pip install requests" to see if that works.

Umm, no! The same error pops up.

If the other fixes don't work, try this fix as well:

To recover do the following:

Run CMD as admin
Do a 'python -m pip install -U --force pip' (this will fix your Pip installation)
Then close the CMD and open another admin CMD to make sure you get the PATH updates effectively
Do 'pip install -U --force requests'

Taken from: https://stackoverflow.com/questions/61278097/how-do-i-fix-pip

If the other fixes don't work, try this fix as well:

To recover do the following:

Run CMD as admin
Do a 'python -m pip install -U --force pip' (this will fix your Pip installation)
Then close the CMD and open another admin CMD to make sure you get the PATH updates effectively
Do 'pip install -U --force requests'

Taken from: https://stackoverflow.com/questions/61278097/how-do-i-fix-pip

pip install -U --force requests didn't run in admin cmd

Also, I tried to run the commands again after running python -m pip install -U --force pip but it didn't work. :(

What error did you get when running

pip install -U --force requests

What error did you get when running

pip install -U --force requests

Here it is.

image.png (117×1 px, 21 KB)

Make sure you're running the command line as administrator. If you are and it's still giving you an error, it might be an issue with your PATH variables. Try doing a fresh install of Python 3 through the official website https://www.python.org/downloads/
then trying again from scratch.

Just installed the latest version of Python 3 and the commands are working. Thank you!

JJMC89 removed a project: Pywikibot.
JJMC89 renamed this task from Trouble in configuring Pywikibot on Windows 10 to Trouble using Python 3.8.3 pip on Windows 10.Apr 2 2021, 6:32 PM

So in the end, this was an issue with Python 3.8.3 opposed to 3.9.3?

So in the end, this was an issue with Python 3.8.3 opposed to 3.9.3?

As I know Python 3.8.3 has problems with IDLE but this is new for me. CI for Pywikibot is also done with Python 3.8 and we didn't had such a problem; there was one in past with Python 3.5 and their very outdated pip.exe