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 Data Science Basics Getting Started with Data Science Installing Libraries

Brendan Whiting
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Brendan Whiting
Front End Web Development Techdegree Graduate 84,736 Points

libraries do not appear in console as they do in video

On the video at 1:15 she types in:

pip list | grep "matplotlib*\|numpy*"

And the libraries and versions appear in the console. I think I did the same but nothing appears. I'm using the same workspace, and if I try "pip install" for each library, it says requirement already satisfied, so things can't be that wrong, I'm just curious why this pip list command isn't working for me.

1 Answer

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,425 Points

pip responds to shell environment variables that set the default value of options. Grepping for PIP variables:

$ env | grep PIP                                                            
PIP_USER=true             

With PIP_USER set, all pip commands run as if the --user option is set (see docs). This means pip list will only show the modules installed by the user and not system installed modules. Hence, an empty list is returned.

To override this environment variable use the --isolated option (see docs). Running this will produce what you seek:

treehouse:~/workspace$ pip --isolated list | grep "matplotlib*\|numpy*"
matplotlib (1.4.2)
numpy (1.9.1)

Thanks for this question! I learned about pip environment variables in the process!