Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Maya Angelica Gurgiolo
4,268 PointsInstalling pytz
I can't figure out how to install pytz. In the video it says to use 'pip install pytz', but where am I supposed to type this? I've tried the Python shell, the Python command line, and Powershell. I have Python 3.4.
3 Answers

Iain Simmons
Treehouse Moderator 32,252 PointsFirst, make sure both the Python34
directory and its subdirectory Scripts
are in the PATH environment variable (there's an option to add this when installing Python).
Second, try python -m pip install pytz
from Powershell or a regular command prompt.

Maya Angelica Gurgiolo
4,268 PointsThank you so much for your answer! I had Python in PATH but not the Script subdirectory. After changing that I was successfully able to use the 'python -m pip install pytz' command in Powershell.

Iain Simmons
Treehouse Moderator 32,252 PointsGreat! Glad it was something simple! :)

shaunhoyes
17,972 PointsI'm using a Mac with Python 2.7. To install pytz, I opened the program called "Terminal", and then on the first line typed
pip install pytz
. If you're using a Mac, I hope this helps.

Michael Steinman
7,833 PointsI'm having trouble installing this module as well. Unfortunately, I don't understand the answer given. Can someone give step by step instructions on how to do this? I'm using Python 3.5 on Windows. All I know how to do is use the shell (IDLE) and write scripts by clicking File New File from the shell.

Iain Simmons
Treehouse Moderator 32,252 PointsSo there's a sneaky way to install modules from IDLE. Run these commands (one line at a time in IDLE):
from subprocess import call
call("pip install pytz", shell=True)
Then you can carry on with importing the module:
import pytz
Note that you need to import the module each time you use it, but only have to install it once.
Found this from this page on Google Groups: https://groups.google.com/forum/embed/#!topic/python-virtualenv/VsulL00j--8
Chris Freeman
Treehouse Moderator 67,995 PointsChris Freeman
Treehouse Moderator 67,995 Pointspip install
should be run at in a bash or powershell window. A virtualenv may used within the shell to localize the install to that end. What error are you seeing when trying in powershell?