Hot answers tagged python
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
To fix this problem you need to download the Command Line Tools for Mountain Lion.
Currently you still need a Mac OS X developers subscription to get the release version of these, this should change to in the next day or so.
EDIT:
You can now install the release version of the Command Line Tools using Xcode with a free developer account.
For those of you ...
3
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 ...
3
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 ...
3
At the moment this isn't likely to be fixable, unless you're fairly comfortable with OS X development and want to rewrite parts of the underlying GUI library.
According to this bug report on Python.org, it's an issue with the TkInter GUI library, which IDLE apparently makes use of. TkInter in turn is based on Tk, which is a cross-platform GUI toolkit, which ...
3
You need to create a shell script named sage containing:
#!/bin/bash
open /Applications/Sage.app
I suggest creating a bin directory in your home folder, and storing any scripts you create there. Save the script there with the name sage, then execute chmod u+x sage to give your user permission to execute the script.
Now, the last step is to tell bash that ...
2
IDLE requires TK to work. You need the tkinter package for your version of python in order for IDLE to work. You probably want py27-tkinter and py32-tkinter. Unfortunately, you'll probably have to go with the default xll version, the +quartz variant is not well maintained upstream. It won't build in x64 on Lion+ or with Xcode 4.4+ because it uses deprecated ...
2
I had a similar issue trying to follow these directions, what fixed it was:
I removed /usr/bin/easy_install (not sure if nescessary)
INSTALLED VERTUALENV using the EASY_INSTALL that was installed by brew in /usr/local
And all good!
Virtualenv really is the way to go.
2
For me, after installing the command-line tools, easy_install is in /usr/bin, not /usr/local/bin. I needed to remove easy_install from /usr/local/bin:
$ sudo rm /usr/local/bin/easy_install*
which removes (in my case)
easy_install, easy_install-2.6, and easy_install-2.7
2
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.
2
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 ...
2
The reason why Ubuntu works is that it has a package manager for all code, that is python and binaries. pip is a python installer and works in OSX for all pure python packages and simple C packages but seems to have issues with the more complex ones.
The nearest think to Linux's package managers are the package managers that deal with code ported from other ...
2
Generally speaking, you can only relocate a package (that is, install it into a different directory) that has been built with relocation in mind.
If the package supports it, it can be relocated with the command line equivalent of Installer.app, conveniently called installer, with option -target (from man installer):
The target volume is specified with ...
2
You can safely install Python under /Library/Frameworks and not worry about it interfering with the "system" Python, although with a few symlinks and/or $PATH changes you can make it the default if you want.
As an alternative, you can install MacPorts and set its install root to whatever you want (the default is /opt/local, I believe, although this is ...
2
You need to install ipython in addition to python:
$ port search ipython
py-ipython @0.13.2 (python)
An enhanced Interactive Python shell
With
$ sudo port select --set ipython ipython24
you can then select the version you want.
It ill be installed in
$ type ipython
ipython is /opt/local/bin/ipython
Check that your PATH begins with /opt/local/bin ...
1
Macport has it. You may install MacPort and do a
sudo port install vte
NB: Installing vte trough MacPort install a new python in /opt/local/ and vte gets installed in /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/gtk-2.0
1
Yes, it is perfectly possible to have both statements coexist happily in .bash_profile. This file is evaluated sequentially from top to bottom, and the same environment variable ($PATH in this case) can be modified multiple times. If you wish, you can edit both into a single command:
export ...
1
Short answer: not really.
Long answer: sort of, but it's probably more trouble than it's worth, unless you really can't used the shell command for some reason. OS X doesn't really expose much system configuration to Python. Most scriptable interfaces to configure OS X are shell-based or AppleScript-based (and of course the various Objective-C APIs).
...
1
This isn't too difficult to do, you just need to know the right magic. I'll walk you through it.
Open Automator, and when prompted to choose a type for your document, select Service. If you're not prompted, just hit ⌘N to make a new automator file.
At the top of the rightmost panel, make sure that Output replaces selected text is checked, and the first ...
1
Add "path": "/Library/Frameworks/Python.framework/Versions/3.3/bin/" to your Python3 build file. Mine looks like this:
{
"cmd": ["python3", "-u", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python",
"encoding": "utf8",
"path": "/Library/Frameworks/Python.framework/Versions/3.3/bin/"
}
Note: Make ...
1
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 ...
1
I'd say segiddins has it almost right, with a couple of slight adjustments that made that solution work perfectly for me:
Copy IDLE.app to the desktop.
Right-click the copied IDLE.app and select Show Package Contents.
Open Contents/info.plist.
Add the following two lines...
<key>NSHighResolutionCapable</key>
<true/>
...to the end of ...
1
The message nothing found to load means sometimes that the config is overriden by an other config. You force the loading by using the option "-w" when using launchctl load or unload.
If you have to force the load or unload of a plist file, it means that you have a config which overrides the plist. This overriding is created when you use the "-w" otherwise ...
1
As I discovered the hard way, you must execute the command using sudo as well as passing the full path of the .plist file as follows (in your case):
sudo launchctl load /Library/LaunchDaemons/com.sickbeard.sickbeard.plist
The path may be different for you, but you must locate the file to find out its location and pass it as I quoted to the launchctl ...
Only top voted, non community-wiki answers of a minimum length are eligible