1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-12 13:33:45 -05:00

build prereqs is the most common info to look up; formatting

native-api
2021-05-09 21:30:25 +03:00
parent 10b081d1bd
commit 7e9899ef82

33
Home.md

@@ -4,19 +4,6 @@ To install pyenv, please refer to the [Readme](https://github.com/pyenv/pyenv/).
## Troubleshooting / FAQ
### Python scripts or shell scripts that use python keep failing
If you experience failure while executing a script that issues `python` command or executes another python script:
- try executing the command again in the appropriate `pyenv shell`
- check if the command is a python script or invokes a python script and fix the shebang to `#!/usr/bin/env python`
Such failures usually show up as:
- incompatible python version, but you are certain that you have correct version installed
- module not found but you are certain that the module is installed
- the issue can be traced back to something related to `PYTHONPATH`
Also, see below for suggested build environment.
### Suggested build environment
pyenv will try its best to download and compile the wanted Python version,
@@ -113,10 +100,24 @@ environment.
See also [Common build problems](https://github.com/pyenv/pyenv/wiki/Common-build-problems) for further information.
### How is this better than pythonbrew and pythonz?
See [[Why pyenv?]]
### Python scripts or shell scripts that use python keep failing
If you experience failure while executing a script that issues `python` command or executes another python script:
- try executing the command again in the appropriate `pyenv shell`
- check if the command is a python script or invokes a python script and fix the shebang to `#!/usr/bin/env python`
Such failures usually show up as:
- incompatible python version, but you are certain that you have correct version installed
- module not found but you are certain that the module is installed
- the issue can be traced back to something related to `PYTHONPATH`
### What is allowed in a `.python-version` file?
The string read from a `.python-version` file must match the name of an existing
@@ -132,6 +133,7 @@ such behavior is unpredictable and therefore harmful.
[python-build]: ../../tree/master/plugins/python-build
### How to verify that I have set up pyenv correctly?
1. Check that `pyenv` is in your PATH:
@@ -150,6 +152,7 @@ such behavior is unpredictable and therefore harmful.
[installation instructions]: ../../#installation
### pyenv is installed but things just aren't working for me!
Please search [existing issues][issues] and open a new one if you can't find any answers. Here's a script that dumps information about your current environment; you can use Gist to paste it online and share the URL to it in your bug report:
@@ -162,6 +165,7 @@ pyenv doctor
[issues]: ../../issues
[Gist]: https://gist.github.com/
### Which shell startup file do I put pyenv config in?
Typically it's one of the following:
@@ -179,10 +183,12 @@ results by adding pyenv to `~/.bashrc` instead.
See [[Unix shell initialization]] for more info about how config files get
loaded.
### Debugging pyenv
The `PYENV_DEBUG` is the environment variable to debug logging in pyenv. You can try to enable debug logging by setting something in the environment variable like `PYENV_DEBUG=1 pyenv versions`.
### How to build CPython with Framework support on OS X
Some of 3rd party tool like [PyInstaller](https://github.com/pyinstaller/pyinstaller) might require CPython installation built with `--enable-framework`. You can build CPython with shared library as follows.
@@ -193,6 +199,7 @@ $ env PYTHON_CONFIGURE_OPTS="--enable-framework" pyenv install 3.5.0
Note: You'd better not `export` `PYTHON_CONFIGURE_OPTS` cause it breaks building of some distros like `miniconda` and `anaconda`.
### How to build CPython with `--enable-shared`
Some of 3rd party tool like [PyInstaller](https://github.com/pyinstaller/pyinstaller) might require CPython installation built with `--enable-shared`. You can build CPython with shared library as follows.