Hot answers tagged

39

A quick solution is to use homebrew to install python into /usr/local/bin so that your pip can run against a user-modifiable python framework. brew install python pip --version Disabling System Integrity Protection is also an option, but I don't recommend that for anything but professionally managed and fire walled servers where you have the manpower to ...


33

I'm assuming the paths to the python script and its parameters are valid, otherwise you'd most likely be seeing errors in the Console instead. The last time I saw that error was because there were spurious characters in the plist, e.g. extra spaces, causing syntax errors and therefore making it fail to load. If you run plutil -lint on your plist, this will ...


32

I solved this problem while writting question: For some reason /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.8.xctoolchain/ folder (it contains Xcode's comand line utilities) is situated here: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain To fix it here is the fast solution: $ sudo ln -s /Applications/Xcode....


28

First, you're not disabling SIP as a way to address the issue. Sorry that's the reason that this folder creation is failing, but we have to work around it. Second, you lose all the niceties Apple thought they were giving you, like a bridge via pyObjC, when you install your own Python. (I'll admit, they say you should install your own to /usr/local if you're ...


26

Preferences are cached in 10.9. See http://hints.macworld.com/article.php?story=20130908042828630. If you edit a plist file directly or replace the plist of an application, the application will keep using the cached version even after you quit and reopen the application. You can run defaults read com.googlecode.iterm2 or killall cfprefsd to apply the ...


22

Another viable option without a need to disable SIP or install other Python versions, is to install the modules only for the current user using pip install --user <modulename> If it is just your personal machine, this would be the simplest and safest solution.


16

I think that pwd -P and readlink are going to be your friends for this task. "How can I get the behavior of GNU's readlink -f on a Mac?" is a handy resource. pwd -P only works if you're inside the symlink directory: 14:07:13 jason@mac ~ $ cd bin 14:08:08 jason@mac bin $ pwd -P /Users/jason/Applications readlink works by specifying the target (thus it ...


13

This problem often arises when pip tries to install a manpage for IPython on El Capitan. The quick fix is to use a pip command like this: sudo -H pip install --install-option '--install-data=/usr/local' <package> However, System Integrity Protection (SIP) on El Capitan blocks several bad practices with pip that used to slide by, so you will probably ...


11

This resolves recursively and returns an absolute path: $ python >>> import os >>> os.path.realpath("/usr/local/bin/python3") Or the non-interactive version: python -c "import os; print(os.path.realpath('/usr/local/bin/python3'))"


11

If an application has open windows, this should raise them above windows from other applications, but keep them below ones from the current application. tell application "System Events" perform action "AXRaise" of window 1 of process "QuickTime Player" end tell


9

You need to download the Command Line Tools for Mountain Lion. Xcode installed: Go to the prefences in Xcode (Xcode -> Preferences), select the 'Downloads' tab and choose to install Command Line Tools Xcode not installed: Apple has released a Command Line Tools package that is compatible with Mountain Lion (OS X 10.8.*), check the Apple Developers ...


8

Macports select can change it back. The current macports does it using the port select command - older versions had python_select To see the possible pythons run port select --list python From that list choose the one you want and change to it e.g. sudo port select --set python python25-apple


8

If you never want to see the crash report dialogs, there is a preference to disable them: defaults write com.apple.CrashReporter DialogType none Log out and back in to apply the changes.


8

It's on 2.7.5. Python 2.7.5 (default, Aug 25 2013, 00:04:04) [GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>>


7

You can install 2.7. It is generally considered a bad, bad idea to change the native version, because built-in apps and frameworks are written for specifically the version that is bundled. The way to go is to install 2.7 along side 2.6. This is generally considered the best practice. That way, you can use 2.7 when you want, and apps will still use the ...


7

Having great trouble migrating iTerm2 (2.0.0) plist to my new Mac running Yosemite (10.10.1). What I did to fix that is: Open iTerm2, so a default com.googlecode.iterm2.plist file is created. Quit iTerm2 Deleted all cached preferences for iterm2 by issuing defaults delete com.googlecode.iterm2 Copied the file to the new Mac in the correct location inside ...


7

This question probably has all the answers for you. In short there is no easy way. Your options are: Recover the files from a (Time machin) Backup, if existent. Reinstall OSX, e.g. from the Recovery mode pressing Command+R at the startup screen Copy the missing files from the Recovery partition (check if the partition is up to date first). E.g. by doing ...


7

I personally use Homebrew, which is a very nice package manager. If you want to give this a try, first of all make sure you have the XCode Command Line Tools installed on your Mac. Then install Homebrew by typing ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" in the Terminal. Homebrew will place its "Cellar" (the ...


7

There appears to be an issue with recent Macports builds of python see this bug A workaround is to install pyXX-readline (py35-readline has been produced just for this bug) Another is to install python addding the +readline variant


6

You need an alias. Typing alias sage='open /PATH/TO/Sage.app' will create an alias which will do exactly what you want, run the program just by typing sage. The problem is that this will only last until you close that terminal window (bash). So, you need to create that alias each time you run a new bash. To do so, just: Create or modify a text file called ...


6

PIL is missing libjpeg library. To install it: Go to http://www.ijg.org/files/jpegsrc.v8c.tar.gz Unpack this package and cd to the unpacked folder cd ~/Downloads/jpeg-8c Compile it: ./configure make Then install: sudo make install But PIL still can't find library. Now you need to reinstall it: Uninstall pil (if you instlled it with pip, just type ...


6

Instead of using Finder aliases, use Terminal to create symbolic links (see man ls for details): ln -s /path/to/python3.3/binary /usr/local/bin/python ln -s /path/to/python2.6/binary /usr/local/bin/python2.6 It's usually not a good idea to mess with /usr/bin content (will be wiped out with the next upgrade). Use /usr/local/bin instead and make sure it ...


5

There are several ways to install Python and which way affects the later answers. In all cases you should install a later Python 3 version - 3.1.3 is the latest released version. For choosing which to run I would call python3.1 or python2.6 to be explicit as the language differs enough that the code is specific to the 2.x or 3.x branches. In fact much code ...


5

/Library/Python/x.x/site-packages (x.x designates the version).


5

From python docs noting that they seem to have hard coded 2.5 instead of the current version and is not that well written What you get after installing is a number of things: A MacPython 2.5 folder in your Applications folder. In here you find IDLE, the development environment that is a standard part of official Python distributions; ...


5

While checking the programs above I realized I hadn't added the Current alias, which was likely used: /System/Library/Frameworks/Python.framework/Versions/Current/Python Adding Python from the Current alias folder fixed my problem. Hadn't seen this question or answer anywhere else online so I'm keeping it up.


5

You need to install Xcode 4.4 (from the app store) and then, within xcode open Xcode > Preferences (or press Cmd + ,) then open the downloads tab and install the Command Line Tools.


5

I finally found out what the problem is. The problem was not with the terminal emulators themselves as both OSX Terminal and iTerm2 were using UTF-8 by default. It turned out one has to inform python explicitly that the terminal is capable of handling unicode by way of export PYTHONIOENCODING=utf-8 Credits to this stackoverflow answer.


4

I just don't believe that thing that you want yet exists1. But… 1) There is textastic which supports text highlighting for Python, Ruby, CSS and HTML and it supports FTP, SFTP and WebDAV connectivity (but no version control support). It highlights 80 different file formats but not Django templates (you can edit them like it's just html). 2) GitHub ...


4

I coul not install pygit2 using pip. However, it worked fine using the latest version available on Github: $ git clone git://github.com/libgit2/pygit2.git $ cd pygit2 $ python setup.py install The problem here I think is that you're trying to use a two month old pygit2 release with the cutting edge version of libgit2. If using pip is an absolute necessity,...



Only top voted, non community-wiki answers of a minimum length are eligible