Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Introducing Pipenv

Tasnim Khaled
Tasnim Khaled
374 Points

Getting Error "No module"

Hello,

I am using windows 7, I even installed python, pip, and pipenv and at the same directory that contains the python I created main.py and I wrote the same code you did in the video. when I applied the command of running the main.py I got the following message: File "main.py", line 1, in <module> import requests ModuleNotFoundError: No module named 'requests'

I appreciate if you can advice please.

4 Answers

This tutorial only works if you have a Macintosh using terminal and Xcode. I'm not familiar with Windows 7 but Youtube should have some videos on fixing the your problem.

The code below runs:

import requests

response = requests.get("http://www.teamtreehouse.com")

print("Status code is " + str(response.status_code))
Alexey Larionov
PLUS
Alexey Larionov
Courses Plus Student 5,796 Points

Hi! Maybe you not installed requests package. You can run "pipenv install requests" command.

I'm having similar but different trouble. Can someone please help?

mark@mchez808 ~/wd $ pipenv install requests
Traceback (most recent call last):
  File "/home/mark/anaconda/bin/pipenv", line 7, in <module>
    from pipenv import cli
ImportError: No module named pipenv
mark@mchez808 ~/wd $