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

Philip Ondrejack
Philip Ondrejack
4,287 Points

Not owned by the current user...Sudo Pip Install

When installing pip and python I have ran into a snag that says:

The directory '/Users/Parthenon/Library/Logs/pip' or its parent directory is not owned by the current user and the debug log has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want the -H flag.

because I now have to install using sudo.

I had python and a handful of libraries already installed on my Mac, I'm running Yosemite. I recently had to do a clean reinstall of the the OS. Now I'm getting this prompt and I'm having trouble figuring out how to change it

Before my command line was Parthenon$ no it's Philips-MBP:~ Parthenon$

I am the sole owner of this computer and this is the only account on it.

Any idea what this is all about?

2 Answers

Kenneth Love
STAFF
Kenneth Love
Treehouse Guest Teacher

Are you using the built-in Python or did you go through the Python installer?

Philip Ondrejack
Philip Ondrejack
4,287 Points

2.7.6 is what came with this comp. I DLed 3.4 and used that installer. If I run python from the command line I get 2.7.6. I have to run python3 to get 3.4

Kenneth Love
Kenneth Love
Treehouse Guest Teacher

So you'll probably have to use pip3 for installing, too. But, the good news is, your pip3 should be able to use the --user option when installing. Can you do pip3 install --user requests without any errors? If so, can you then, inside of a Python shell, do import requests?

You should not have to sudo the pip3 part.