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 Setting Up a Local Python Environment Installing Python and Python Libraries Locally Using pip

Rabih Atallah
Rabih Atallah
3,405 Points

Question regarding pip

Every time I write: pip install module (a module from python packages) in the IDLE, I receive a syntax error. should I use 'pip install module' in the IDLE or in the terminal. I use a mac.

1 Answer

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,457 Points

pip install module should be run on the shell command line prompt. You will get a syntax error trying to run pip as a python command in the interpretor.

Rabih Atallah
Rabih Atallah
3,405 Points

Thanks for the clarification...

Rabih Atallah
Rabih Atallah
3,405 Points

Hi Chris. Please how can I install numpy. I have python 3.4 installed. Whenever I run this command in my Terminal: pip install numpy. I get this :

Rabihs-MacBook-Air:~ rab$ pip install numpy Requirement already satisfied (use --upgrade to upgrade): numpy in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python Rabihs-MacBook-Air:~ rab$

but when I import numpy in Python 3.4 , I get an error. It seems MAC OS comes with an embedded Python 2.7 with numpy already installed. How can I transfer numpy to Python 3.4

Chris Freeman
Chris Freeman
Treehouse Moderator 68,457 Points

If you're on a system with Python 2.x as the system default, but also have Python 3.x installed, you need to run pip3 to get the Python 3 version of pip to install into the Python 3 site-packages area. Can you try:

pip3 install numpy

Rabih Atallah
Rabih Atallah
3,405 Points

Thanks so much! it worked