Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I'm trying to compile a file using Python and I receive this message:

error: could not create '/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/tulip': Permission denied

Why is the permission denied? How can I fix this?

share|improve this question
    
Why do you want to write a file there ? oO –  Matthieu Riegler Oct 16 '12 at 17:56
    
Im trying to install a sub-module for python. –  Render Oct 16 '12 at 17:58
2  
Prepend your command with sudo –  CraftyThumber Oct 16 '12 at 19:04
1  
A small nit, Python is an interpreter, not a compiler. The difference is that Python has to convert the source code to "machine code" every time it is run where compiled languages do that once and use the same generated machine code every time it is run. Typically compiled languages are faster, but for small tasks the shorter development time of python more than makes up for the runtime difference. –  Mark Oct 17 '12 at 13:36
    
Thank you for the explanation @MarkThalman –  Render Oct 17 '12 at 21:13

1 Answer 1

up vote 1 down vote accepted

It's trying to create a file in the system installation of Python (i.e. it's going in the root Library folder). That folder is only writeable by root (to prevent damaging important system files), hence why you're getting a permission error.

Running the command with sudo preceding it, i.e. sudo foo bar will give you the proper permissions, after asking for your password. Alternatively, you can use virtualenv to set up your own Python environment that will allow you to mess around without worrying about changing the system default install.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.