Python 2

Python3 ๊ฐ€์ƒ ํ™˜๊ฒฝ ์ƒ์„ฑ

venv ๋ชจ๋“ˆ์€ ์ž์ฒด ์‚ฌ์ดํŠธ ๋””๋ ‰ํ„ฐ๋ฆฌ๋ฅผ ๊ฐ–๋Š” ๊ฒฝ๋Ÿ‰ โ€œ๊ฐ€์ƒ ํ™˜๊ฒฝโ€์„ ๋งŒ๋“ค๊ณ , ์„ ํƒ์ ์œผ๋กœ ์‹œ์Šคํ…œ ์‚ฌ์ดํŠธ ๋””๋ ‰ํ„ฐ๋ฆฌ์—์„œ ๊ฒฉ๋ฆฌํ•  ์ˆ˜ ์žˆ๋„๋ก ์ง€์›ํ•ฉ๋‹ˆ๋‹ค. ๊ฐ ๊ฐ€์ƒ ํ™˜๊ฒฝ์€ ๊ณ ์œ ํ•œ ํŒŒ์ด์ฌ ๋ฐ”์ด๋„ˆ๋ฆฌ(์ด ํ™˜๊ฒฝ์„ ๋งŒ๋“œ๋Š” ๋ฐ ์‚ฌ์šฉ๋œ ๋ฐ”์ด๋„ˆ๋ฆฌ ๋ฒ„์ „๊ณผ ์ผ์น˜ํ•จ)๋ฅผ ๊ฐ€์ง€๋ฉฐ ์ž์‹ ์˜ ์‚ฌ์ดํŠธ ๋””๋ ‰ํ„ฐ๋ฆฌ์— ๋…๋ฆฝ์ ์œผ๋กœ ์„ค์น˜๋œ ํŒŒ์ด์ฌ ํŒจํ‚ค์ง€ ์ง‘ํ•ฉ์„ ๊ฐ€์งˆ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ฐ€์ƒํ™˜๊ฒฝ ์ƒ์„ฑ $ python3 -m venv /home/myhome/venv * ์ง€์ •ํ•œ ๋””๋ ‰ํ† ๋ฆฌ์— ๊ฐ€์ƒ ํ™˜๊ฒฝ ์ƒ์„ฑ (๋ฆฌ๋ˆ…์Šค ๊ธฐ์ค€) * ์‹คํ–‰ ํ›„ ์ด๋ž˜์™€ ๊ฐ™์€ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•œ๋‹ค๋ฉด --without-pip ์˜ต์…˜์œผ๋กœ pip ๋Š” ๋ณ„๋„๋กœ ์„ค์น˜ํ•ด ์ค€๋‹ค. Error: Command '['/home/ojj/venv/bin/python3', '-Im', 'ensurepip', '--upgrade',..

IT Talks 2022.09.22

python ์˜ sys.stderr.write(f"ERROR: {exc}") ์˜ค๋ฅ˜

๊ฐ‘์ž๊ธฐ ์ด๋Ÿฐ ๋ฉ”์‹œ์ง€๊ฐ€ ๋‚˜์˜จ๋‹ค๋ฉด ? $ sudo python3 -m pip Traceback (most recent call last): File "/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main "__main__", mod_spec) File "/usr/lib/python3.5/runpy.py", line 85, in _run_code exec(code, run_globals) File "/usr/local/lib/python3.5/dist-packages/pip/__main__.py", line 29, in from pip._internal.cli.main import main as _main File "/usr/local/lib/pyth..

IT Talks/Linux 2021.05.15
728x90