ModuleNotFoundError: No module named 'wikipedia'

Question:

I am trying to make a line of code, that searches Wikipedia for information. Here’s my code:

import wikipedia
print(wikipedia.summary("Wikipedia"))

I have used the same module in the past, with no problem. Now here comes the error. When I run this SIMPLE 2 lines of code, I get: Modulenotfounderror: No module named: "wikipedia"
Yes, I have tried pip install wikipedia, and pip3 install wikipedia and it says:

Requirement already satisfied: wikipedia in c:usersdinohappdatalocalpackagespythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0localcachelocal-packagespython39site-packages (1.4.0)
Requirement already satisfied: beautifulsoup4 in c:usersdinohappdatalocalpackagespythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0localcachelocal-packagespython39site-packages (from wikipedia) (4.10.0)
Requirement already satisfied: requests<3.0.0,>=2.0.0 in c:usersdinohappdatalocalpackagespythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0localcachelocal-packagespython39site-packages (from wikipedia) (2.27.1)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:usersdinohappdatalocalpackagespythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0localcachelocal-packagespython39site-packages (from requests<3.0.0,>=2.0.0->wikipedia) (1.26.8)
Requirement already satisfied: certifi>=2017.4.17 in c:usersdinohappdatalocalpackagespythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0localcachelocal-packagespython39site-packages (from requests<3.0.0,>=2.0.0->wikipedia) (2021.10.8)
Requirement already satisfied: idna<4,>=2.5 in c:usersdinohappdatalocalpackagespythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0localcachelocal-packagespython39site-packages (from requests<3.0.0,>=2.0.0->wikipedia) (3.3)
Requirement already satisfied: charset-normalizer~=2.0.0 in c:usersdinohappdatalocalpackagespythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0localcachelocal-packagespython39site-packages (from requests<3.0.0,>=2.0.0->wikipedia) (2.0.10)
Requirement already satisfied: soupsieve>1.2 in c:usersdinohappdatalocalpackagespythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0localcachelocal-packagespython39site-packages (from beautifulsoup4->wikipedia) (2.3.1)

I don’t know what to do.

Asked By: DINOTICK

||

Answers:

Alrighty, so the fix for my own question was that I needed to use the correct version of python. So I just installed a slightly older version of python (3.9) as I was using 3.10 currently, and then swapped the version of python I was using in vscode. Worked like a charm. If you’re feeling lazy, you can also download the version you need off of the Microsoft store like I did. 🙂

Click here for image cause I don’t have embed perms yet lol

Answered By: DINOTICK
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.