talkpython / mastering-pycharm-course

Course demos and handouts for Talk Python's Effective PyCharm course
https://training.talkpython.fm/courses/explore_pycharm/mastering-pycharm-ide
GNU General Public License v2.0
1.12k stars 716 forks source link

Python ModuleNotFoundError #58

Closed xchapman closed 2 years ago

xchapman commented 2 years ago

I have been struggling with the ModuleNotFoundError: No module named 'requests' error for a while now. I am running Python 3.8 on a Windows 10 platform. I downloaded the python-jumpstart-course-demos files using the GitHub Desktop app. This error is affecting everything I am attempting to do with Python in PyCharm. I believe that it may be a path issue. Usually when I import a library this error appears.

path_error_01
mikeckennedy commented 2 years ago

Hi @xchapman The problem is you're running your system-wide Python (c:\users\jbc\appdata\local\programs\python38\python.exe) and requests is not install. You should create a virtual environment, activate it, then install requests into it. You can do this via PyCharm. See the bottom right in Python section in the bottom right of PyCharm.