Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

What's the difference between these two folders on mac os x 8.5? I've installed the latest version of tcl and it was placed in my /usr/local/lib folder. However I have a tcl folder under /Library also. Should I install tcl in this folder instead?

I'm actually trying to use tk with python but python is complaining about the wrong arch for a tile dylib: /Library/Tcl/tile0.6/libtile0.6.dylib. This is why I built and inbstalled the latest versions of tk and tcl,

Why is python3 looking there instead of /usr/local/lib?

share|improve this question
add comment

1 Answer

Think of /Library as Apple-sanctioned, and /usr/local/* as generally third-party installations performed in the terminal. Your Python install is likely the install that comes with your Mac as bundled by Apple. Therefore, it doesn't really know about libraries that you've installed yourself. You can set sys.path in your python apps to tell them where to load libraries from. You can also use sys.path to see what the default path is:

$> python
>>> import sys
>>> print sys.path

Another route you can also take is to use a third-party package management system to install all of your development versions of software to get more fine-grained control of what libraries you want installed. This also allows you to update to newer versions of libraries than what Apple provides. MacPorts and Homebrew are two such package management systems.

So, in your case, you are interested in Tk and Python. You could use MacPorts to install your own version of Python and Tk, and use those versions instead of the out-of-the-box versions. Because these packages are installed by the same package manager, the MacPorts version of Python will be aware of any other python libraries installed by MacPorts.

Using a package manager means that you'll need to do some things such as setting up your $PATH to use the software provided by the package manager, so be sure to read the docs and get a good understanding of what you'd be getting yourself into. :-)

share|improve this answer
    
I installed python3 myself but i didnt do it on the command line. When I run 'which python3', I get /Library/Frameworks/Python.framework/Versions/3.1/bin/python3. When I print sys.path, all of the directories listed are relative to /Library. No mention of /usr/local/lib. –  Baz Mar 24 '13 at 7:09
    
If you are developing just for your local machine, you can add your own entries to sys.path in your scripts. sys.path.insert(1,'/usr/local/lib'), or sys.path.append('/usr/local/lib'). This line should appear before your import statement. This makes your script less portable to other machines, though. Package management would be better. You can also define a PYTHONPATH environment variable to augment the default sys.path. –  Jimmie Fulton Mar 24 '13 at 19:15
add comment

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.