일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
Tags
- 네이버카페
- 거래사기
- Frida
- CryptoJS
- 안전결제
- 취약점
- 보이스피싱 #대검찰청 #명의도용 #비밀번호 #계좌번호 #공공기관 #가짜검찰청
- ue4dumper
- react
- NUGU
- XSS
- ssrf
- CJ대한통운 #쿠팡 #통관번호오류 #통관고유번호오류 #안주원팀장 #모건인베스트
- speed-measure-webpack-plugin
- 채팅환전사기
- self-signed
- 중고나라
- 척추관협착증
- 많다..
- MongoDB #NoSQL #CreateUser #DropUser #mongod #mognod.conf
- 변태는
- intelmac
- Sequoia
- open redirect
- esbuild
- 허리디스크
- 로맨스스캠
- shell_gpt
- Malware Sample
- 모의해킹
Archives
- 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/
2) https://github.com/pyenv/pyenv/issues/1737#issuecomment-827865222
'프로그래밍' 카테고리의 다른 글
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 |
Comments