mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
parent
04508b0c4d
commit
b0fe8c3429
@ -97,20 +97,32 @@ $ git clean -f # this will remove untracked files
|
|||||||
|
|
||||||
### Python: `Segmentation fault: 11` on `import <some_python_module>`
|
### Python: `Segmentation fault: 11` on `import <some_python_module>`
|
||||||
|
|
||||||
A `Segmentation fault: 11` is in 95% due to a different Python executable used for building the software vs. the python you use to import the module. Note that e.g. the `boost` bottle is built against system python and should be brewed from source to make it work with a brewed Python.
|
A `Segmentation fault: 11` is in many cases due to a different Python
|
||||||
This can even happen when both python executables are the same version (e.g. 2.7.2). The explanation is that Python packages with C-extensions (those that have `.so` files) are compiled against a certain python binary/library that may have been built with a different arch (e.g. Apple's python is still not a pure 64bit). Other things can go wrong, too. Welcome to the dirty underworld of C.
|
executable used for building the software vs. the python you use to import the
|
||||||
|
module. This can even happen when both python executables are the same version
|
||||||
|
(e.g. 2.7.2). The explanation is that Python packages with C extensions (those
|
||||||
|
that have `.so` files) are compiled against a certain python binary/library that
|
||||||
|
may have been built with a different arch (e.g. Apple's python is still not a
|
||||||
|
pure 64-bit build). Other things can go wrong, too. Welcome to the dirty
|
||||||
|
underworld of C.
|
||||||
|
|
||||||
To solve this, you should remove the problematic formulae with those python bindings and all of it's dependencies.
|
To solve this, you should remove the problematic formula with those python
|
||||||
|
bindings and all of its dependencies.
|
||||||
|
|
||||||
- `brew rm $(brew deps <problematic_formula>)`
|
- `brew rm $(brew deps <problematic_formula>)`
|
||||||
- `brew rm <problematic_formula>`
|
- `brew rm <problematic_formula>`
|
||||||
- Also check the `$(brew --prefix)/lib/python2.7/site-packages` directory and delete all remains of the corresponding python modules if they were not cleanly removed by the previous steps.
|
- Also check the `$(brew --prefix)/lib/python2.7/site-packages` directory and
|
||||||
- Check that `which python` points to the python you want. Perhaps now is the time to `brew install python`.
|
delete all remains of the corresponding python modules if they were not
|
||||||
|
cleanly removed by the previous steps.
|
||||||
|
- Check that `which python` points to the python you want. Perhaps now is the
|
||||||
|
time to `brew install python`.
|
||||||
- Then reinstall `brew install <problematic_formula>`
|
- Then reinstall `brew install <problematic_formula>`
|
||||||
- Now start `python` and try to `import` the module installed by the <problematic_formula>
|
- Now start `python` and try to `import` the module installed by the
|
||||||
|
\<problematic_formula\>
|
||||||
|
|
||||||
You can basically use any Python (2.x) for the bindings homebrew provides, but you can't mix.
|
You can basically use any Python (2.x) for the bindings homebrew provides, but
|
||||||
Homebrew formulae use a brewed Python if available or, if not so, they use whatever `python` is in your `PATH`.
|
you can't mix. Homebrew formulae use a brewed Python if available or, if not
|
||||||
|
so, they use whatever `python` is in your `PATH`.
|
||||||
|
|
||||||
### Python: `Fatal Python error: PyThreadState_Get: no current thread`
|
### Python: `Fatal Python error: PyThreadState_Get: no current thread`
|
||||||
|
|
||||||
@ -119,14 +131,12 @@ Fatal Python error: PyThreadState_Get: no current thread
|
|||||||
Abort trap: 6
|
Abort trap: 6
|
||||||
```
|
```
|
||||||
|
|
||||||
This happens for `boost`, `pygtk` and/or `pygobject` and related modules, for the same reason as described above.
|
This happens for `boost-python`, `pygtk`, `pygobject`, and related modules,
|
||||||
If the `boost` is your problem, please `brew rm boost`, `brew install boost --build-from-source`. This is needed because the boost bottle is built against system python.
|
for the same reason as described above. To solve this, follow the steps above.
|
||||||
|
|
||||||
To solve this, follow the steps above.
|
If `boost` is your problem, note that Boost.Python is now provided by the
|
||||||
|
`boost-python` formula. Removing any existing `boost` and `boost-python`,
|
||||||
### Python: `Python.h not found`
|
running `brew update`, and installing them anew should fix things.
|
||||||
|
|
||||||
The formula needs a `depends_on :python`, probably.
|
|
||||||
|
|
||||||
### Python: easy-install.pth cannot be linked
|
### Python: easy-install.pth cannot be linked
|
||||||
```
|
```
|
||||||
@ -147,9 +157,6 @@ To list all files that would be deleted:
|
|||||||
brew link --overwrite --dry-run formula_name
|
brew link --overwrite --dry-run formula_name
|
||||||
```
|
```
|
||||||
|
|
||||||
Don't follow the advice of setuptools here but fix by adding
|
Don't follow the advice here but fix by using
|
||||||
`--record=installed.txt` and `--single-version-externally-managed` flags to `setup.py`:
|
`Language::Python.setup_install_args` in the formula as described in
|
||||||
|
[Python for Formula Authors](Python-for-Formula-Authors.md).
|
||||||
### Python: `/usr/local/bin/virtualenv: ...: bad interpreter: No such file or directory`
|
|
||||||
|
|
||||||
Did you try to pip install --upgrade virtualenv? Since the full path to Python is included, you will need to reinstall software like this after upgrading python itself.
|
|
||||||
|
@ -63,9 +63,7 @@ about when you do (`brew upgrade`). This can be surprising.
|
|||||||
To remove a formula entirely, you may do
|
To remove a formula entirely, you may do
|
||||||
(`brew uninstall formula_name --force`).
|
(`brew uninstall formula_name --force`).
|
||||||
|
|
||||||
Be careful as this is a destructive operation and unfortunately, in
|
Be careful as this is a destructive operation.
|
||||||
Homebrew 0.9.5 it seems that Homebrew does not support the `--dry-run`
|
|
||||||
option.
|
|
||||||
|
|
||||||
### Where does stuff get downloaded?
|
### Where does stuff get downloaded?
|
||||||
|
|
||||||
@ -86,16 +84,14 @@ alternative](https://developer.apple.com/legacy/library/qa/qa1067/_index.html).
|
|||||||
Read everything in https://github.com/Homebrew/homebrew/blob/master/CONTRIBUTING.md.
|
Read everything in https://github.com/Homebrew/homebrew/blob/master/CONTRIBUTING.md.
|
||||||
|
|
||||||
### Why do you compile everything?
|
### Why do you compile everything?
|
||||||
Projects distribute source tarballs, generally, but if they provide a
|
Homebrew is about **homebrewing**, it’s half the point that you can just
|
||||||
good binary, we’ll use it. Though we don’t always, because Homebrew is
|
|
||||||
about **homebrewing**, it’s half the point that you can just
|
|
||||||
`brew edit $FORMULA` and change how the formula is compiled to your own
|
`brew edit $FORMULA` and change how the formula is compiled to your own
|
||||||
specification.
|
specification.
|
||||||
|
|
||||||
Homebrew does provide pre-compiled versions for some formulae. These
|
Homebrew does provide pre-compiled versions for some formulae. These
|
||||||
pre-compiled versions are referred to as **bottles** and are available
|
pre-compiled versions are referred to as **bottles** and are available
|
||||||
at:
|
at:
|
||||||
[http://sf.net/projects/machomebrew/files](http://sf.net/projects/machomebrew/files).
|
[https://bintray.com/homebrew/bottles](https://bintray.com/homebrew/bottles).
|
||||||
|
|
||||||
If available, bottled binaries will be used by default except under the
|
If available, bottled binaries will be used by default except under the
|
||||||
following conditions:
|
following conditions:
|
||||||
@ -253,4 +249,4 @@ to with `brew link`.
|
|||||||
|
|
||||||
### How can I specify different configure arguments for a formula?
|
### How can I specify different configure arguments for a formula?
|
||||||
`brew edit $FORMULA` and edit the formula. Currently there is no
|
`brew edit $FORMULA` and edit the formula. Currently there is no
|
||||||
other way to do this, but we’ll design something like that into brew2.
|
other way to do this.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user