I'm using zsh
and oh-my-zsh
. I'm doing
➜ ~ pyenv install 3.11.5
and the output is:
Downloading Python-3.11.5.tar.xz...
-> https://www.python.org/ftp/python/3.11.5/Python-3.11.5.tar.xz
Installing Python-3.11.5...
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/irem/.pyenv/versions/3.11.5/lib/python3.11/ctypes/__init__.py", line 8, in <module>
from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'
WARNING: The Python ctypes extension was not compiled. Missing the libffi lib?
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/irem/.pyenv/versions/3.11.5/lib/python3.11/ssl.py", line 100, in <module>
import _ssl # if we can't import it, let the error propagate
^^^^^^^^^^^
ModuleNotFoundError: No module named '_ssl'
ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib?
Please consult to the Wiki page to fix the problem.
https://github.com/pyenv/pyenv/wiki/Common-build-problems
BUILD FAILED (Ubuntu 23.04 using python-build 20180424)
Inspect or clean up the working tree at /tmp/python-build.20230902112800.123560
Results logged to /tmp/python-build.20230902112800.123560.log
Last 10 log lines:
LD_LIBRARY_PATH=/tmp/python-build.20230902112800.123560/Python-3.11.5 ./python -E -m ensurepip \
$ensurepip --root=/ ; \
fi
Looking in links: /tmp/tmpurefphym
Processing /tmp/tmpurefphym/setuptools-65.5.0-py3-none-any.whl
Processing /tmp/tmpurefphym/pip-23.2.1-py3-none-any.whl
Installing collected packages: setuptools, pip
WARNING: The scripts pip3 and pip3.11 are installed in '/home/irem/.pyenv/versions/3.11.5/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pip-23.2.1 setuptools-65.5.0
I saw a bunch of answers that say python
must be aliased somewhere, but I did not do that. Here's what's in my .zshrc
file:
export ZSH="$HOME/.oh-my-zsh"
plugins=(git)
source $ZSH/oh-my-zsh.sh
# pyenv
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init --path)"
eval "$(pyenv virtualenv-init -)"
# alias nvim
alias vi="nvim"
As for the various oh-my-zsh
config files, they all have the default options as far as I know. I did not personally change anything.
I should also add that:
➜ ~ openssl version
OpenSSL 3.0.8 7 Feb 2023 (Library: OpenSSL 3.0.8 7 Feb 2023)
➜ ~ openssl version -d
OPENSSLDIR: "/usr/lib/ssl"