๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๐Ÿ’ปTech/๐Ÿpython6

[python] pysqlite3 ์„ค์น˜ ์˜ค๋ฅ˜ ํ•ด๊ฒฐ ๐Ÿšซ ERROR src/connection.h:34:21: fatal error: sqlite3.h: No such file or directory #include "sqlite3.h" compilation terminated. error: command 'gcc' failed with exit status 1 ๐Ÿ’ก SOLVED $ yum install -y libsqlite3x-devel $ pip3 install pysqlite3 2023. 4. 12.
[python] sasl ์„ค์น˜ ์˜ค๋ฅ˜ ํ•ด๊ฒฐ sasl ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์„ค์น˜ ๊ณผ์ •์—์„œ ์•„๋ž˜์™€ ๊ฐ™์€ ์˜ค๋ฅ˜ ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•๋“ค์ž…๋‹ˆ๋‹ค. ๋ฆฌ๋ˆ…์Šค ํŒจํ‚ค์ง€ ์„ค์น˜๊ฐ€ ํ•„์š”ํ•˜๋„ค์š”. ๊ฒฐ๊ณผ์ ์œผ๋กœ ์•„๋ž˜ ๋ช…๋ น์–ด ์ˆ˜ํ–‰ํ•˜์—ฌ ํŒจํ‚ค์ง€ ์„ค์น˜ํ•ด์ฃผ๋ฉด ๋ฉ๋‹ˆ๋‹ค. ๐Ÿšซ ERROR gcc: error trying to exec 'cc1plus': execvp: No such file or directory sasl/saslwrapper.h:22:23: fatal error: sasl/sasl.h: No such file or directory ๐Ÿ’ก SOLVED $ yum install -y gcc-c++ cyrus-sasl-devel $ pip3 install sasl 2023. 3. 22.
[SOLVED] Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-on0urr/pip/ ๐Ÿšซ ERROR pip ํŒจํ‚ค์ง€ ์„ค์น˜ ๊ณผ์ •์—์„œ ์•„๋ž˜ ์—๋Ÿฌ๊ฐ€ ๊ณ„์† ๋ฐœ์ƒํ•˜์—ฌ ๊ฒ€์ƒ‰ํ•ด ๋ณด๋‹ˆ pip, setuptools ์—…๊ทธ๋ ˆ์ด๋“œํ•˜๋ผ๊ณ  ๋‚˜์˜ต๋‹ˆ๋‹ค Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-on0urr/pip/ ๊ทธ๋ž˜์„œ ์—…๊ทธ๋ ˆ์ด๋“œ๋ฅผ ์ง„ํ–‰ํ•˜๋ ค๊ณ  'pip install --upgrade pip' ๋ช…๋ น์–ด๋ฅผ ์‹คํ–‰ํ–ˆ๋Š”๋ฐ ๋‹ค๋ฅธ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•˜๋„ค์š” ๐Ÿ˜ฅ [root@localhost ~] pip install --upgrade pip Collecting pip Using cached https://files.pythonhosted.org/packages/33/c9/e2164122d365d8f823213a53970fa3005eb16218ed.. 2022. 4. 12.
pip install (ํ์‡„๋ง ๋กœ์ปฌ whl ํŒŒ์ผ ์ง์ ‘ ์„ค์น˜) โ—พ whl ํŒŒ์ผ ์ง์ ‘ ์„ค์น˜ user ์˜ต์…˜์€ ์„ค์น˜๋ฅผ ์ง„ํ–‰ํ•˜๋Š” ํ•ด๋‹น ๊ณ„์ •์— ํŒจํ‚ค์ง€ ์„ค์น˜ํ•œ๋‹ค๋Š” ์˜๋ฏธ user ์˜ต์…˜์„ ๋ถ™์ด์ง€ ์•Š์œผ๋ฉด root ๊ณ„์ •์œผ๋กœ ์ง„ํ–‰ํ•ด์•ผํ•จ pip3 install --no-index --find-links . ํŒŒ์ผ๋ช….whl --user โ—พ requirements.txt ํŒŒ์ผ์— ์„ค์น˜ ํŒจํ‚ค์ง€ ๋ชฉ๋ก ์ž‘์„ฑํ•˜์—ฌ ์‹คํ–‰ pip3 install --no-index --find-links . -r requirements.txt --user 2021. 6. 18.
[Python] httplib.badstatusline ์—๋Ÿฌ ํ•ด๊ฒฐ ๋ฐฉ๋ฒ• httplib๋กœ API URI ํ˜ธ์ถœํ•˜๋Š” ๊ณผ์ •์—์„œ ์•„๋ž˜์™€ ๊ฐ™์€ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค. API ํ˜ธ์ถœ์„ ๋ฐ˜๋ณตํ•˜์—ฌ ๊ณ„์† ํ˜ธ์ถœํ•˜๋Š” ์ฝ”๋“œ์˜€๋Š”๋ฐ, ์ฒซ๋ฒˆ์งธ ํ˜ธ์ถœ์€ ์ •์ƒ์ ์œผ๋กœ ํ˜ธ์ถœ ๋˜์ง€๋งŒ ๋‘๋ฒˆ์งธ ํ˜ธ์ถœ๋ถ€ํ„ฐ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•˜๋„ค์š” Traceback (most recent call last): File "test.py", line 40, in clusterInfo = getAppPendingCnt(conn) File "yarnAppStatus.py", line 9, in getAppPendingCnt r1 = conn.getresponse() File "/usr/lib64/python2.7/httplib.py", line 1113, in getresponse response.begin() File "/usr/lib64/python2.. 2019. 11. 1.
[Python] REST API ํ˜ธ์ถœ ์ƒ˜ํ”Œ ์ฝ”๋“œ Python REST API ํ˜ธ์ถœ ์ƒ˜ํ”Œ ์ฝ”๋“œ์ž…๋‹ˆ๋‹ค. ์ง€์ •์‹œ๊ฐ„ ์ดํ›„๋กœ ์ˆ˜ํ–‰๋˜๋Š” api killํ•˜๋Š” ์ฝ”๋“œ import httplib, json, datetime print datetime.datetime.now() #๋‚ ์งœ ์ถœ๋ ฅ INGEST_LIST="/druid/indexer/v1/tasks" #API ์ฃผ์†Œ HOST="aaa-bb-001" #API ํ˜ธ์ŠคํŠธ PORT="8090" #API ํฌํŠธ hour = (datetime.datetime.now() + datetime.timedelta(hours=-9)).hour conn = httplib.HTTPConnection(HOST, PORT) #connection ์„ค์ • conn.request("GET", INGEST_LIST) #request res = conn.g.. 2019. 6. 13.