일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
- CryptoJS
- intelmac
- 중고나라
- XSS
- esbuild
- 많다..
- open redirect
- shell_gpt
- 변태는
- MongoDB #NoSQL #CreateUser #DropUser #mongod #mognod.conf
- 척추관협착증
- Sequoia
- Frida
- 허리디스크
- Malware Sample
- 안전결제
- self-signed
- 취약점
- 채팅환전사기
- 다우오피스
- 모의해킹
- 네이버카페
- CJ대한통운 #쿠팡 #통관번호오류 #통관고유번호오류 #안주원팀장 #모건인베스트
- NUGU
- 로맨스스캠
- 보이스피싱 #대검찰청 #명의도용 #비밀번호 #계좌번호 #공공기관 #가짜검찰청
- ue4dumper
- ssrf
- speed-measure-webpack-plugin
- 거래사기
- Today
- Total
annyoung
python 버전 관리를 위한 pyenv 본문
개요
개발하고 있는 서버 A,B가 있는데 A서버는 python@3.7.6에서는 돌아가지만 python@3.11.4에서는 돌아가지 않는다.하지만, B서버는 python@3.11.4에서 돌아가고 python@3.7.6에서는 돌아가지 않는 상황..
따라서 필자는 파이썬 버전 관리가 필요하다고 생각했다.
설치
pyenv
설치
brew install pyenv
.bash_profile
나 .zshrc
에 pyenv
활성화 하는 스크립트 추가
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.bash_profile
.bash_profile
나 .zshrc
변경사항 적용
exec "$SHELL"
pyenv
를 이용해 python 설치
pyenv install 3.7.6
pyenv install 3.11.4
그런데 pyenv로 python@3.7.6 설치하다가 에러가 발생했다.
nopsled@playground ~ pyenv install 3.7.6
python-build: use openssl@1.1 from homebrew
python-build: use readline from homebrew
Downloading Python-3.7.6.tar.xz...
-> https://www.python.org/ftp/python/3.7.6/Python-3.7.6.tar.xz
Installing Python-3.7.6...
python-build: use readline from homebrew
python-build: use zlib from xcode sdk
BUILD FAILED (OS X 13.4 using python-build 20180424)
Inspect or clean up the working tree at /var/folders/dl/r_8xbf8s37z1qztd3nml4tvh0000gn/T/python-build.20230804122132.4931
Results logged to /var/folders/dl/r_8xbf8s37z1qztd3nml4tvh0000gn/T/python-build.20230804122132.4931.log
Last 10 log lines:
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -I. -I./Include -I/usr/local/opt/readline/include -I/usr/local/opt/readline/include -I/Users/nopsled/.pyenv/versions/3.7.6/include -I/usr/local/opt/readline/include -I/usr/local/opt/readline/include -I/Users/nopsled/.pyenv/versions/3.7.6/include -DPy_BUILD_CORE_BUILTIN -c ./Modules/pwdmodule.c -o Modules/pwdmodule.o
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -I. -I./Include -I/usr/local/opt/readline/include -I/usr/local/opt/readline/include -I/Users/nopsled/.pyenv/versions/3.7.6/include -I/usr/local/opt/readline/include -I/usr/local/opt/readline/include -I/Users/nopsled/.pyenv/versions/3.7.6/include -DPy_BUILD_CORE_BUILTIN -c ./Modules/_sre.c -o Modules/_sre.o
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -I. -I./Include -I/usr/local/opt/readline/include -I/usr/local/opt/readline/include -I/Users/nopsled/.pyenv/versions/3.7.6/include -I/usr/local/opt/readline/include -I/usr/local/opt/readline/include -I/Users/nopsled/.pyenv/versions/3.7.6/include -DPy_BUILD_CORE_BUILTIN -c ./Modules/_codecsmodule.c -o Modules/_codecsmodule.o
./Modules/posixmodule.c:8436:15: error: implicit declaration of function 'sendfile' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
ret = sendfile(in, out, offset, &sbytes, &sf, flags);
^
1 error generated.
make: *** [Modules/posixmodule.o] Error 1
make: *** Waiting for unfinished jobs....
1 warning generated.
문법 검사를 하다가 sendfile이 묵시적 선언 되어 컴파일할 때 에러가 난다는 내용인것 같다.
관련 내용 리서치하다 보니 다음 커맨드를 입력해서 설치하니까 에러없이 잘 설치 되었다.
CFLAGS="-I$(brew --prefix openssl)/include -I$(brew --prefix bzip2)/include -I$(brew --prefix readline)/include -I$(xcrun --show-sdk-path)/usr/include" LDFLAGS="-L$(brew --prefix openssl)/lib -L$(brew --prefix readline)/lib -L$(brew --prefix zlib)/lib -L$(brew --prefix bzip2)/lib" pyenv install --patch 3.7.6 < <(curl -sSL https://github.com/python/cpython/commit/8ea6353.patch\?full_index\=1)
출처
1) https://www.daleseo.com/python-pyenv/
여러 버전의 파이썬 관리하기 (pyenv)
Engineering Blog by Dale Seo
www.daleseo.com
2) https://github.com/pyenv/pyenv/issues/1737#issuecomment-827865222
Python 3.6-3.8 cannot be installed on Mac OS 11.0.1: "implicit declaration of function 'sendfile' is invalid in C99" · Issue #1
Hi,Morning: First of all, thank you very much for thinking about and maintaining pyenv. We found problems installing pypypy3 via pyenv, but we were also able to find solutions we would like to shar...
github.com
'프로그래밍' 카테고리의 다른 글
python docx add border to image (1) | 2024.10.14 |
---|---|
브라우저 데이터 쉐어링 (0) | 2024.03.13 |
https local domain with self-signed certificate (0) | 2022.04.15 |
CRACO React esbuild with speed-measure-webpack-plugin (0) | 2022.03.24 |
flask with libreoffice (docx to pdf) (0) | 2022.02.25 |