ModuleNotFoundError: No module named 'requests' after pip install

后端 未结 2 1977
青春惊慌失措
青春惊慌失措 2021-01-15 05:02

I know similar questions have been asked before but I couldn\'t find the solution to my problem.

I am getting the following error message after trying to import requ

相关标签:
2条回答
  • 2021-01-15 05:36

    Run this code:

    C:\Users\Jm\PycharmProjects\Test\venv\Scripts\python.exe -m pip install requests
    

    This forces the installation directory to your python install.

    This gives a much different effect than simply python -m pip install requests

    0 讨论(0)
  • 2021-01-15 05:44

    As @Daniel Scott mentioned before use the command mentioned above or below

    $: path-to-your-python-command -m pip install name-of-module

    If you are using linux/mac then you can find path-to-your-python command using:

    $: which python3

    /usr/bin/python3

    Lets say your python is installed here /usr/bin/python3 and the module you are installing is requests. Then you can use:

    $: /usr/bin/python3 -m pip install requests

    0 讨论(0)
提交回复
热议问题