ModuleNotFoundError: Requests module not found despite successful installation in Python 3.12

I've installed the requests module in Python 3.12 using pip, and the installation shows as successful (see attached screenshot). I've also confirmed that I'm working in the correct directory. However, when I try to run my script, I still get the error:

ModuleNotFoundError: No module named 'requests'

I've double-checked both the installation path and the script's directory, and everything seems correct. Could anyone suggest what I might be missing?


Comments

  • Hi,

    It seems like the issue might be related to the installation path of the requests module, especially if there are multiple versions of pip installed on your system. To ensure the module is installed in the correct location, try running the following command:

    python -m pip install requests --target="C:\Program Files\Python310\Lib\site-packages"
    

    This will specify the installation path explicitly and help avoid any version conflicts between different Python installations. 

    Thanks.

Sign In or Register to comment.