Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Python site-packages permission denied?

Reply
Thread Tools

Python site-packages permission denied?

 
 
Shane Neeley
Guest
Posts: n/a
 
      03-07-2012
What do I need to do to successfully install a package onto python so that I can use it as a module?

I have tried in terminal in the correct directory "python2.7 ./setup.py install" but it says permission denied.

Shanes-MacBook-Pro:seisen-urllib2_file-cf4c4c8 chimpsarehungry$ python2.7.1 ./setup.py install
-bash: python2.7.1: command not found
Shanes-MacBook-Pro:seisen-urllib2_file-cf4c4c8 chimpsarehungry$ python ./setup.py install
running install
running build
running build_py
running install_lib
copying build/lib/urllib2_file.py -> /Library/Python/2.7/site-packages
error: /Library/Python/2.7/site-packages/urllib2_file.py: Permission denied
Shanes-MacBook-Pro:seisen-urllib2_file-cf4c4c8 chimpsarehungry$
 
Reply With Quote
 
 
 
 
Chris Rebert
Guest
Posts: n/a
 
      03-07-2012
On Wed, Mar 7, 2012 at 1:02 PM, Shane Neeley <(E-Mail Removed)> wrote:
> What do I need to do to successfully install a package onto python so that I can use it as a module?
>
> I have tried in terminal in the correct directory "python2.7 ./setup.py install" but it says permission denied.
>
> Shanes-MacBook-Pro:seisen-urllib2_file-cf4c4c8 chimpsarehungry$ python2.7.1 ./setup.py install
> -bash: python2.7.1: command not found
> Shanes-MacBook-Pro:seisen-urllib2_file-cf4c4c8 chimpsarehungry$ python ./setup.py install
> running install
> running build
> running build_py
> running install_lib
> copying build/lib/urllib2_file.py -> /Library/Python/2.7/site-packages
> error: /Library/Python/2.7/site-packages/urllib2_file.py: Permission denied
> Shanes-MacBook-Pro:seisen-urllib2_file-cf4c4c8 chimpsarehungry$


You generally shouldn't mess with Mac OS X's system copies of Python.
Typically, one installs a separate copy using MacPorts, Fink, or
whatever, and uses that instead.
In any case, you generally need to `sudo` when installing stuff system-wide.

Cheers,
Chris
 
Reply With Quote
 
 
 
 
Ned Deily
Guest
Posts: n/a
 
      03-08-2012
In article
<CAMZYqRTXy3mSMXtivuE8ApYX2ZFAG3DQp1UN+fqWnAYWNOAN (E-Mail Removed)>,
Chris Rebert <(E-Mail Removed)> wrote:
> You generally shouldn't mess with Mac OS X's system copies of Python.
> Typically, one installs a separate copy using MacPorts, Fink, or
> whatever, and uses that instead.


I don't understand what you mean by "mess with". Certainly one should
not attempt alter standard library modules provided with the system
Python but adding additional packages is fully supported. Apple
conveniently provides a special directory in user-controlled space
(/Library/Python) as the default location for Distutils-based installs.
They even provide versions of easy_install for the system Pythons.

--
Ned Deily,
http://www.velocityreviews.com/forums/(E-Mail Removed)

 
Reply With Quote
 
Steven D'Aprano
Guest
Posts: n/a
 
      03-08-2012
On Wed, 07 Mar 2012 21:47:37 -0800, Ned Deily wrote:

> In article
> <CAMZYqRTXy3mSMXtivuE8ApYX2ZFAG3DQp1UN+fqWnAYWNOAN (E-Mail Removed)>,
> Chris Rebert <(E-Mail Removed)> wrote:
>> You generally shouldn't mess with Mac OS X's system copies of Python.
>> Typically, one installs a separate copy using MacPorts, Fink, or
>> whatever, and uses that instead.

>
> I don't understand what you mean by "mess with". Certainly one should
> not attempt alter standard library modules provided with the system
> Python but adding additional packages is fully supported.


I read Chris as making a general comment that one should be cautious
about making changes to the system copy of Python, advice that holds for
all OSes not just OS-X.


> Apple
> conveniently provides a special directory in user-controlled space
> (/Library/Python) as the default location for Distutils-based installs.
> They even provide versions of easy_install for the system Pythons.


Perhaps so, but it seems to have the permissions messed up, or some other
problem, because the OP can't write to it. His error is:

copying build/lib/urllib2_file.py -> /Library/Python/2.7/site-packages
error: /Library/Python/2.7/site-packages/urllib2_file.py:
Permission denied


I note also that Chris' final comment was:

"In any case, you generally need to `sudo` when installing stuff system-
wide."

which is probably the solution the OP is looking for.



--
Steven
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fixed: The machine-default permission settings do not grant Local Activation permission for the COM Server application with CLSID {555F3418-D99E-4E51-800A-6E89CFD8B1D7} to the user NT AUTHORITY\LOCAL SERVICE SID (S-1-5-19). Skybuck Flying Windows 64bit 1 06-29-2009 06:17 PM
Python script produces "sem_trywait: Permission denied" Mark E. Hamilton Python 1 10-19-2005 04:33 AM
Python script produces "sem_trywait: Permission denied" Mark E. Hamilton Python 0 10-18-2005 06:59 PM
Python script produces "sem_trywait: Permission denied" Hudson Python 0 11-03-2004 12:20 AM
CGI Python user/group permission weirdness Aienthiwan Python 2 01-19-2004 05:49 PM



Advertisments