Search code examples
pythonpippython-requestspython-requests-html

"ImportError: No module named requests_html" after installing requests-html to pip and pip3


Tried installing requests-html through pip and pip3 in many different ways (recommendations from other StackOverflow threads) and I keep on getting the same error ImportError: No module named requests_html.

Checked pip and pip3 list, both of them have requests and requests-html. Also my python is updated, its 3.7.6.

Also weirdly I started writing the code on jupyter notebook, and everything worked, however when I switched to sublime text that's where the problem occurred.

Please help.

P.s. I am on a mac, and I am a beginer.


Solution

  • The issue where Sublime was using the wrong Python Environment.

    You need to add a new build configuration:

    1. Check where is your Python3 path (using which or where commands, depending on your os)
    2. Add and configure the build system (look at the link below or google how to do it)
    3. Select the newly created build system

    Source: https://medium.com/@hariyanto.tan95/set-up-sublime-text-3-to-use-python-3-c845b742c720