未能在macOS 10.14.2上安装Python 3.7.2

未能在macOS 10.14.2上安装Python 3.7.2,python,python-3.x,Python,Python 3.x,我通过pyenv安装了python3.7.2 pyenv install 3.7.2 python-build: use openssl from homebrew python-build: use readline from homebrew Downloading Python-3.7.2.tar.xz... -> https://www.python.org/ftp/python/3.7.2/Python-3.7.2.tar.xz Installing Python-3.7.2..

我通过pyenv安装了python3.7.2

pyenv install 3.7.2
python-build: use openssl from homebrew
python-build: use readline from homebrew
Downloading Python-3.7.2.tar.xz...
-> https://www.python.org/ftp/python/3.7.2/Python-3.7.2.tar.xz
Installing Python-3.7.2...
python-build: use readline from homebrew

BUILD FAILED (OS X 10.14.2 using python-build 20180424)

Inspect or clean up the working tree at /var/folders/ql/l7pj2ssj7j3ctsx3lqt99cwc0000gn/T/python-build.20190129200315.73913
Results logged to /var/folders/ql/l7pj2ssj7j3ctsx3lqt99cwc0000gn/T/python-build.20190129200315.73913.log

Last 10 log lines:
    fi
Could not find platform independent libraries <prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: initfsencoding: unable to load the file system codec
ModuleNotFoundError: No module named 'encodings'

Current thread 0x0000000111ac65c0 (most recent call first):
/bin/sh: line 1: 85109 Abort trap: 6           ./python.exe -E -S -m sysconfig --generate-posix-vars
generate-posix-vars failed
make: *** [pybuilddir.txt] Error 1
pyenv安装3.7.2
python构建:使用自制的openssl
python构建:使用自制的readline
正在下载Python-3.7.2.tar.xz。。。
-> https://www.python.org/ftp/python/3.7.2/Python-3.7.2.tar.xz
正在安装Python-3.7.2。。。
python构建:使用自制的readline
构建失败(使用python构建20180424的OS X 10.14.2)
检查或清理位于/var/folders/ql/l7pj2ssj7j3ctsx3lqt99cwc0000gn/T/python-build.20190129200315.73913的工作树
结果记录到/var/folders/ql/l7pj2ssj7j3ctsx3lqt99cwc0000gn/T/python-build.20190129200315.73913.log
最后10行日志:
fi
找不到与平台无关的库
考虑将$PythONHOLD设置为[:]
致命的Python错误:initfsencoding:无法加载文件系统编解码器
ModuleNotFoundError:没有名为“encodings”的模块
当前线程0x000000011AC65C0(最新调用优先):
/bin/sh:line 1:85109中止陷阱:6./python.exe-E-S-msysconfig——生成posix变量
生成posix变量失败
make:**[pybuilddir.txt]错误1
当我手动从源代码构建它时,出现了相同的错误

$ ./configure
$ make
./python.exe -E -S -m sysconfig --generate-posix-vars ;\
    if test $? -ne 0 ; then \
        echo "generate-posix-vars failed" ; \
        rm -f ./pybuilddir.txt ; \
        exit 1 ; \
    fi
Could not find platform independent libraries <prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: initfsencoding: unable to load the file system codec
ModuleNotFoundError: No module named 'encodings'

Current thread 0x0000000115df55c0 (most recent call first):
/bin/sh: line 1: 43771 Abort trap: 6           ./python.exe -E -S -m sysconfig --generate-posix-vars
generate-posix-vars failed
make: *** [pybuilddir.txt] Error 1

$。/配置
$make
./python.exe-E-S-msysconfig——生成posix变量\
如果测试$-ne0;然后\
echo“生成posix变量失败”\
rm-f./pybuilddir.txt\
出口1\
fi
找不到与平台无关的库
考虑将$PythONHOLD设置为[:]
致命的Python错误:initfsencoding:无法加载文件系统编解码器
ModuleNotFoundError:没有名为“encodings”的模块
当前线程0x0000000115df55c0(最新调用优先):
/bin/sh:line 1:43771中止陷阱:6./python.exe-E-S-msysconfig——生成posix变量
生成posix变量失败
make:**[pybuilddir.txt]错误1
我还用自制软件安装了python2和python3

还有xcode开发工具
xcode选择-p
/库/开发人员/命令行工具