简体   繁体   English

使用 pyenv 安装 python 3.8 的问题

[英]Issue installing python 3.8 using pyenv

I tried installing python using the command pyenv install 3.8.11我尝试使用命令 pyenv install 3.8.11 安装 python

Please let me know if you need more info.如果您需要更多信息,请告诉我。 Thank you for looking.感谢您的关注。 output:输出:

BUILD FAILED (Ubuntu 20.04 using python-build 20180424)构建失败(Ubuntu 20.04 使用 python-build 20180424)

Inspect or clean up the working tree at /tmp/python-build.20210821132713.23441
Results logged to /tmp/python-build.20210821132713.23441.log

Last 10 log lines:
  File "/tmp/python-build.20210821132713.23441/Python-3.8.11/Lib/ensurepip/__init__.py", line 206, in _main
    return _bootstrap(
  File "/tmp/python-build.20210821132713.23441/Python-3.8.11/Lib/ensurepip/__init__.py", line 125, in _bootstrap
    return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
  File "/tmp/python-build.20210821132713.23441/Python-3.8.11/Lib/ensurepip/__init__.py", line 34, in _run_pip
    return subprocess.run([sys.executable, "-c", code], check=True).returncode
  File "/tmp/python-build.20210821132713.23441/Python-3.8.11/Lib/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/tmp/python-build.20210821132713.23441/Python-3.8.11/python', '-c', '\nimport runpy\nimport sys\nsys.path = [\'/tmp/tmp7l0fqi9l/setuptools-56.0.0-py3-none-any.whl\', \'/tmp/tmp7l0fqi9l/pip-21.1.1-py3-none-any.whl\'] + sys.path\nsys.argv[1:] = [\'install\', \'--no-cache-dir\', \'--no-index\', \'--find-links\', \'/tmp/tmp7l0fqi9l\', \'--root\', \'/\', \'--upgrade\', \'setuptools\', \'pip\']\nrunpy.run_module("pip", run_name="__main__", alter_sys=True)\n']' returned non-zero exit status 1.
make: *** [Makefile:1198: install] Error 1

log:日志:

Traceback (most recent call last):
  File "<string>", line 6, in <module>
  File "/tmp/python-build.20210821140419.301/Python-3.8.11/Lib/runpy.py", line 203, in run_module
    mod_name, mod_spec, code = _get_module_details(mod_name)
  File "/tmp/python-build.20210821140419.301/Python-3.8.11/Lib/runpy.py", line 144, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/tmp/python-build.20210821140419.301/Python-3.8.11/Lib/runpy.py", line 111, in _get_module_details
    __import__(pkg_name)
  File "<frozen zipimport>", line 241, in load_module
  File "<frozen zipimport>", line 709, in _get_module_code
  File "<frozen zipimport>", line 570, in _get_data
zipimport.ZipImportError: can't decompress data; zlib not available
Traceback (most recent call last):
  File "/tmp/python-build.20210821140419.301/Python-3.8.11/Lib/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/tmp/python-build.20210821140419.301/Python-3.8.11/Lib/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/tmp/python-build.20210821140419.301/Python-3.8.11/Lib/ensurepip/__main__.py", line 5, in <module>
    sys.exit(ensurepip._main())
  File "/tmp/python-build.20210821140419.301/Python-3.8.11/Lib/ensurepip/__init__.py", line 206, in _main
    return _bootstrap(
  File "/tmp/python-build.20210821140419.301/Python-3.8.11/Lib/ensurepip/__init__.py", line 125, in _bootstrap
    return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
  File "/tmp/python-build.20210821140419.301/Python-3.8.11/Lib/ensurepip/__init__.py", line 34, in _run_pip
    return subprocess.run([sys.executable, "-c", code], check=True).returncode
  File "/tmp/python-build.20210821140419.301/Python-3.8.11/Lib/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/tmp/python-build.20210821140419.301/Python-3.8.11/python', '-c', '\nimport runpy\nimport sys\nsys.path = [\'/tmp/tmp1imhbulh/setuptools-56.0.0-py3-none-any.whl\', \'/tmp/tmp1imhbulh/pip-21.1.1-py3-none-any.whl\'] + sys.path\nsys.argv[1:] = [\'install\', \'--no-cache-dir\', \'--no-index\', \'--find-links\', \'/tmp/tmp1imhbulh\', \'--root\', \'/\', \'--upgrade\', \'setuptools\', \'pip\']\nrunpy.run_module("pip", run_name="__main__", alter_sys=True)\n']' returned non-zero exit status 1.
make: *** [Makefile:1198: install] Error 1

pyenv requires some packages to build Python from source. pyenv需要一些包来从源代码构建 Python。

For Ubuntu, frompyenv wiki: suggested build environment对于 Ubuntu,来自pyenv wiki:建议的构建环境

sudo apt-get install make build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev

I have the same issue and i tried this but still我有同样的问题,我试过这个,但仍然

alejandrocampos@Mac-mini-de-Alejandro ~ % pyenv install 3.8.2
python-build: use openssl@1.1 from homebrew
python-build: use readline from homebrew
Downloading Python-3.8.2.tar.xz...
-> https://www.python.org/ftp/python/3.8.2/Python-3.8.2.tar.xz
Installing Python-3.8.2...
python-build: use readline from homebrew
python-build: use zlib from xcode sdk

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

Inspect or clean up the working tree at /var/folders/3m/ycpjzsr528q9rb9zlqtgnqhw0000gn/T/python-build.20211119225033.32081
Results logged to /var/folders/3m/ycpjzsr528q9rb9zlqtgnqhw0000gn/T/python-build.20211119225033.32081.log

Last 10 log lines:
checking size of _Bool... 1
checking size of off_t... 8
checking whether to enable large file support... no
checking size of time_t... 8
checking for pthread_t... yes
checking size of pthread_t... 8
checking size of pthread_key_t... 8
checking whether pthread_key_t is compatible with int... no
configure: error: Unexpected output of 'arch' on OSX
make: *** No targets specified and no makefile found.  Stop.
alejandrocampos@Mac-mini-de-Alejandro ~ %

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM