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

I have an error, when I try to install mistune it says : marlonmartins$ pip install mistune command not found

Marlons-MacBook-Pro:~ marlonmartins$ pip install requests -bash: pip: command not found Marlons-MacBook-Pro:~ marlonmartins$ pip install --user requests -bash: pip: command not found Marlons-MacBook-Pro:~ marlonmartins$ pip install mistune -bash: pip: command not found Marlons-MacBook-Pro:~ marlonmartins$

4 Answers

Josh Keenan
Josh Keenan
20,315 Points

This means pip wasn't installed automatically when you installed Python and means you will have to install it manually.

Here's a link to a tutorial on how to do this:

https://pip.pypa.io/en/stable/installing/

If this doesn't work reply on this thread!

Hi, thanks for your quick reply very helpful.

I followed your link, but now I have a new error

Marlons-MacBook-Pro:~ marlonmartins$ python get-pip.py python: can't open file 'get-pip.py': [Errno 2] No such file or directory Marlons-MacBook-Pro:~ marlonmartins$ python get-pip.py --user python: can't open file 'get-pip.py': [Errno 2] No such file or directory Marlons-MacBook-Pro:~ marlonmartins$ python get-pip.py --no-index --find-links=/local/copies python: can't open file 'get-pip.py': [Errno 2] No such file or directory

hey, Josh, I got one more question for you , do you know why I get this errors ?

Exception: Traceback (most recent call last):

File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 209, in main status = self.run(options, args)

File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 317, in run prefix=options.prefix_path,

File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 731, in install **kwargs

File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 841, in install self.move_wheel_files(self.source_dir, root=root, prefix=prefix)

File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 1040, in move_wheel_files isolated=self.isolated,

File "/Library/Python/2.7/site-packages/pip/wheel.py", line 343, in move_wheel_files clobber(source, lib_dir, True)

File "/Library/Python/2.7/site-packages/pip/wheel.py", line 321, in clobber shutil.copyfile(srcfile, destfile)

File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 83, in copyfile with open(dst, 'wb') as fdst:

IOError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/itsdangerous.py'

Hi, thanks for your quick reply very helpful.

I followed your link, but now I have a new error

Marlons-MacBook-Pro:~ marlonmartins$ python get-pip.py python: can't open file 'get-pip.py': [Errno 2] No such file or directory Marlons-MacBook-Pro:~ marlonmartins$ python get-pip.py --user python: can't open file 'get-pip.py': [Errno 2] No such file or directory Marlons-MacBook-Pro:~ marlonmartins$ python get-pip.py --no-index --find-links=/local/copies python: can't open file 'get-pip.py': [Errno 2] No such file or directory

Josh Keenan
Josh Keenan
20,315 Points

I'll find you another help link give me a few minutes then :P

Hey, Josh

Thanks I think I managed to install them now, I used this video: https://www.youtube.com/watch?v=yBdZZGPpYxg

the code that I used: Last login: Thu Feb 4 12:06:01 on ttys000 Marlons-MacBook-Pro:~ marlonmartins$ curl https://bootstrap.pypa.io/get-pip.py >get-pip.py % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 1476k 100 1476k 0 0 2941k 0 --:--:-- --:--:-- --:--:-- 2941k Marlons-MacBook-Pro:~ marlonmartins$ Marlons-MacBook-Pro:~ marlonmartins$ Marlons-MacBook-Pro:~ marlonmartins$ sudo python get-pip.py