0

I'm using PyCharm and I'm using the requests module. However, I keep getting the same error while running it on Command Prompt (PyCharm doesn't give any errors): ModuleNotFoundError: No module named 'requests'. However, I have installed it and it's even been listed in the installed modules section. This isn't a duplicate since in the other post, the module wasn't listed in the modules list. I have already remade the Pycharm project twice, but that didn't work. Even if I just take it out, it says the same thing about bs4.

Here's my complete import section:

import discord
from discord.ext import commands

import requests
import bs4
import random

Yes, I'm trying to make a Discord bot. I'll post any more code needed on request. Any help is appreciated. Thanks

  • 2
    try `pip freeze` and see if requests gets listed. if now then probably it must have been installed in a different environment than what where you are trying to import it. – sxddhxrthx Aug 05 '21 at 14:51

1 Answers1

0

Try to run from command prompt: "pip install requests".

I had got the same problem. Program run great from PyCharm but displayed ModuleNotFoundError when runnig from command prompt. After running "pip install requests" problem has gone.

xbox
  • 1
  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jan 31 '22 at 06:15