J. Doe
J. Doe

Reputation: 21

How do I install a Python module?

Be forewarned, issues related to installing Python make me nervous. I spent an entire morning panicking what would happen when I would install Python 3.

Now on to the task. My computer is an Apple. I would like to add a python module that I have downloaded from the internet. How do I install the package?

I tried 'python setup.py install' but received an error:

    error: could not create '/Library/Python/2.7/site-packages/bs4': Permission denied

Please help. Thank you.

Upvotes: 1

Views: 131

Answers (2)

Silas Ray
Silas Ray

Reputation: 26150

Alternatively to installing with elevated privileges, you could also use virtualenv to create a self-contained environment in user space, then install things to that with regular user privileges. This also has other benefits over installing to the system Python, such as keeping your dependencies clear, and not accidentally breaking your system install with some funky package.

Upvotes: 1

Andy
Andy

Reputation: 50540

You need to use elevated privileges to do this by using sudo

sudo python setup.py install

Upvotes: 0

Related Questions