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

IT-Engineering135

No module named 'win32com' ํ•ด๊ฒฐ ๋ฐฉ๋ฒ• import win32com.client ์ˆ˜ํ–‰์‹œ No module named 'win32com'์ด ๋ฐœ์ƒํ•˜๋Š” ๊ฒฝ์šฐ ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•์— ๋Œ€ํ•ด ์†Œ๊ฐœํ•œ๋‹ค. ํ•„์ž์˜ ๊ฒฝ์šฐ ์—๋Ÿฌ๋ฉ”์‹œ์ง€๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์•˜๋‹ค. Traceback (most recent call last): File "d:\00_Programming\Trading\sarktrader\dashin\dashin_get_item_list.py", line 1, in import win32com.client ModuleNotFoundError: No module named 'win32com' ์ด ๊ฒฝ์šฐ๋Š” ์ฝ˜์†”(Console) ์ฐฝ์—์„œ ํ˜น์€ Anaconda Promprt ๋“ฑ์—์„œ ์•„๋ž˜์˜ ๋ช…๋ น์–ด๋ฅผ ์ž…๋ ฅํ•˜์ž. pip install pywin32 ํ•ด๊ฒฐ์ด ๋˜์—ˆ์„ ๊ฒƒ์ด๋‹ค. ๊ทธ๋Ÿผ 20000. 2020. 12. 11.
Anaconda ์•„๋‚˜์ฝ˜๋‹ค 64 bit ํ™˜๊ฒฝ์—์„œ 32 bit ์‚ฌ์šฉํ•˜๋Š” ๋ฐฉ๋ฒ• ์•„๋‚˜์ฝ˜๋‹ค(Anaconda) 64bit๋ฅผ ์„ค์น˜ ํ›„์— 32bit ํŒŒ์ด์ฌ๊ณผ ํ™˜๊ฒฝ์ด ํ•„์š”ํ•œ ๊ฒฝ์šฐ๋ฅผ ์œ„ํ•ด ๋ณธ ํŽธ์„ ์ค€๋น„ํ–ˆ๋‹ค. ๋ฌด์—‡๋ณด๋‹ค ํ‚ค์›€์ฆ๊ถŒ API๋‚˜ ๋Œ€์‹ ์ฆ๊ถŒ API์™€ ๊ฐ™์ด ์ฆ๊ถŒ์‚ฌ API๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๊ฒฝ์šฐ conda ํ™˜๊ฒฝ์—์„œ ๋งž๋‹ฅ๋œจ๋ฆฌ๋Š” ๋ฒ„๊ทธ๋‚˜ ์—๋Ÿฌ๋“ค์ด 64bit ํ™˜๊ฒฝ์„ ์‚ฌ์šฉํ•˜๊ธฐ ๋•Œ๋ฌธ์ธ ๊ฒฝ์šฐ๊ฐ€ ์žˆ๋‹ค. ์ด ๊ฒฝ์šฐ ๊ฒฐ๊ตญ 32bit๋ฅผ ์‚ฌ์šฉํ•ด์•ผ ํ•œ๋‹ค. Traceback (most recent call last): File "d:\ProgramData\Anaconda3\lib\site-packages\win32com\client\dynamic.py", line 89, in _GetGoodDispatch IDispatch = pythoncom.connect(IDispatch) pywintypes.com_error: (-2147.. 2020. 12. 11.
[Mac] ์—ฌ๋Ÿฌ๊ฐœ์˜ ruby ๋ฒ„์ „ ์‚ฌ์šฉ์„ ์œ„ํ•œ rbenv ์„ค์น˜ ์˜ค๋ฅ˜ ํ•ด๊ฒฐ Error: Your CLT does not support macOS 11.0. It is either outdated or was modified. Please update your CLT or delete it if no updates are available. Error: An exception occurred within a child process: SystemExit: exit ๋งฅ์—์„œ ruby ์—ฌ๋Ÿฌ ๋ฒ„์ „ ์‚ฌ์šฉ์„ ์œ„ํ•œ rbenv ์„ค์น˜์‹œ ์œ„์˜ ์—๋Ÿฌ๋ฌธ์ œ ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•์— ๋Œ€ํ•œ ํฌ์ŠคํŒ…์„ ํ•œ๋‹ค. ํ„ฐ๋ฏธ๋„๋กœ iTerm์„ ์‚ฌ์šฉํ•˜์˜€๊ณ , Homebrew๋Š” ์„ค์น˜๋œ ์ƒํƒœ๋กœ ๊ฐ€์ •ํ•œ๋‹ค. Homebrew๋Š” ์•„๋ž˜์˜ ์ปค๋งจ๋“œ๋กœ ์„ค์น˜ํ•  ์ˆ˜ ์žˆ๋‹ค. # Install Homebrew /usr/bin/ruby -e "$(curl -fsS.. 2020. 12. 1.
AWS EC2 ์œˆ๋„์šฐ ์„œ๋ฒ„ ์ดˆ๊ธฐ ์„ธํŒ…๊ณผ ๊ธฐ๋ณธ ์„ค์ • - ํ•œ๊ธ€ ๋กœ์ผ€์ผ ์„ค์ •์œผ๋กœ ์ธ์ฝ”๋”ฉ ๋ฌธ์ œ ํ•ด๊ฒฐ ํ•„์ž๋Š” ์ฃผ์‹ ํŠธ๋ ˆ์ด๋”ฉ์„ ์œ„ํ•ด AWS Windows ์„œ๋ฒ„๋ฅผ ์„ธํŒ…ํ•˜์˜€๋Š”๋ฐ, ์‚ฌ์šฉํ•˜๋ ค๋Š” ํ”„๋กœ๊ทธ๋žจ์˜ ํ•œ๊ธ€์ด ๊นจ์ ธ๋ณด์ด๋Š” ํ˜„์ƒ์œผ๋กœ ์•ฝ๊ฐ„์˜ ์‚ฝ์งˆ์„ ํ–ˆ๋‹ค. ์ด์—, ์ด ๋งŽ์€ ๋ถ„๋“ค์ด ์ด ์‚ฝ์งˆ์„ ํ•˜์ง€ ๋ง๊ณ  ํŽธํ•˜๊ฒŒ ๋”ฐ๋ผํ•˜์‹œ๋ผ๊ณ  ๋ณธ ํฌ์ŠคํŒ…์„ ์ž‘์„ฑํ•˜๊ฒŒ ๋˜์—ˆ๋‹ค. ์ด ๊ธ€์€ ์•„๋ž˜์˜ ์„ค์ •์ด ์™„๋ฃŒ๋œ ์ƒํƒœ์—์„œ ์‹œ์ž‘ํ•œ๋‹ค. ์ธ์Šคํ„ด์Šค ์œ ํ˜•์€ ํ”„๋ฆฌํ‹ฐ์–ด์ธ t2.micro๋กœ ๋งŒ๋“ค์–ด์ง„ ์ƒํƒœ์ด๋‹ค. ์ด ๊ธ€์„ ๋๊นŒ์ง€ ์ˆ˜ํ–‰ํ•˜๋ฉด, ์ตœ์ข…์ ์œผ๋กœ ๊ฐ€์žฅ ์ค‘์š”ํ•œ ์‹œ์Šคํ…œ ๋กœ์บ˜ ๋ณ€๊ฒฝ์„ ํ†ตํ•ด ํ•œ๊ธ€ ์ธ์ฝ”๋”ฉ ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•  ์ˆ˜ ์žˆ๋‹ค. ์•ž๋ถ€๋ถ„์„ ์ƒ๋žตํ•˜๊ณ  ๋งจ ๋’ท๋ถ€๋ถ„์˜ ์œ ๋‹ˆ์ฝ”๋“œ๋ฅผ ์ง€์›ํ•˜์ง€ ์•Š๋Š” ํ”„๋กœ๊ทธ๋žจ์šฉ ์–ธ์–ด์˜ ์‹œ์Šคํ…œ ๋กœ์บ˜ ๋ณ€๊ฒฝ ๋ถ€๋ถ„๋งŒ ์‚ฌ์šฉํ•ด๋„ ๋ฌธ์ œ ์—†์œผ๋‹ˆ ์‹œ๊ฐ„์ด ์—†์œผ์‹  ๋ถ„๋“ค์€ ๋’ค๋ถ€ํ„ฐ ๋ณด์‹œ๊ธธ ์ถ”์ฒœ๋“œ๋ฆฐ๋‹ค. ์‹œ์ž‘๋ฒ„ํŠผ - Server Manager ์‹คํ–‰ Server Manager์—์„œ Con.. 2020. 11. 16.
์Šˆํผ๊ฐœ๋ฐœ์ž์˜ ์ž๊ฒฉ[3] - ๊ฐ€์ƒ ๋ฉ”๋ชจ๋ฆฌ๋Š” ๋ฌด์—‡์ธ๊ฐ€? ํŽ˜์ด์ง€์™€ ์Šค์™‘์€ ๋ฌด์—‡์ธ๊ฐ€? ๊ฐ€์ƒ ๋ฉ”๋ชจ๋ฆฌ๋Š” ๋ฌด์—‡์ธ๊ฐ€? ์œˆ๋„์šฐ์™€ ๊ฐ™์€ ์šด์˜์ฒด์ œ๋ฅผ ์‚ฌ์šฉํ•˜๋‹ค ๋ณด๋ฉด ํ”ํ•˜๊ฒŒ ์ ‘ํ•˜๋Š” ๋‹จ์–ด์ด๊ธฐ๋„ ํ•˜๊ณ , ์•„๋ž˜์™€ ๊ฐ™์ด ์„ค์ • ์ฐฝ์—์„œ๋„ ์ข…์ข… ์ง€๋‚˜์ณค๋˜ ๊ฒƒ ๊ฐ™์€ ๋‹จ์–ด์ธ๋ฐ, ์–ด๋–ค ์˜๋ฏธ์ธ์ง€ ์ž˜ ๋ชจ๋ฅด๊ธฐ๋„ ํ•˜๋Š” ๊ทธ๋Ÿฐ ๊ฐœ๋…์ด๋‹ค. ๊ฐ€์ƒ๋ฉ”๋ชจ๋ฆฌ๋ž€, "ํ•˜๋“œ๋””์Šคํฌ๋‚˜ SSD์™€ ๊ฐ™์€ ๋ณด์กฐ๊ธฐ์–ต ์žฅ์น˜์— ์ฃผ๊ธฐ์–ต์žฅ์น˜์ธ ๋žจ(RAM)์˜ ๋‚ด์šฉ ์ผ๋ถ€๋ฅผ ์ „๋‹ฌํ•ด ์“ฐ๊ณ  ์ฝ๋Š” ๊ฐ€์ƒ์˜ ๋ฉ”๋ชจ๋ฆฌ ํ˜•์‹" ์ด๋‹ค. ๊ฐ€์ƒ ๋ฉ”๋ชจ๋ฆฌ๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ๋ฉ”์ธ ๋ฉ”๋ชจ๋ฆฌ๋ฅผ ํšจ๊ณผ์ ์œผ๋กœ ๊ด€๋ฆฌํ•  ์ˆ˜ ์žˆ์œผ๋ฉฐ, ๋ฉ”๋ชจ๋ฆฌ๊ฐ€ ๋ถ€์กฑํ•  ๋•Œ ํšจ๊ณผ์ ์œผ๋กœ ๋Œ€์ฒ˜ํ•  ์ˆ˜ ์žˆ๋‹ค. ์˜ˆ์ปจ๋Œ€, ๋ฉ”๋ชจ๋ฆฌ ๋ถ€์กฑ์„ ๋ณด์กฐ๊ธฐ์–ต ์žฅ์น˜๊ฐ€ ๋ฐ›์•„์ฃผ๋ฉด์„œ ๋‹ค์–‘ํ•œ ์˜ค๋ฅ˜ ์ƒํ™ฉ์„ ๋Œ€๋น„ํ•  ์ˆ˜ ์žˆ๋‹ค. ๋‹ค๋งŒ, ์ด๋Ÿฐ ์ƒํ™ฉ์ด ๋ฐœ์ƒํ•˜๋ฉด ๋ณด์กฐ๊ธฐ์–ต์žฅ์น˜์˜ ์ฝ๋Š” ์†๋„๋Š” ์ฃผ๊ธฐ์–ต์žฅ์น˜์— ๋น„ํ•˜๋ฉด SSD๋ผ๊ณ  ํ• ์ง€๋ผ๋„ ๋งค์šฐ ๋Š๋ฆฌ๊ธฐ ๋•Œ๋ฌธ์—, ๋‹น์—ฐํžˆ ์ปดํ“จํ„ฐ๋Š” ์ฒด๊ฐํ•˜๊ธฐ๋กœ๋„ ๋งค์šฐ ๋Š๋ ค์ง€๊ฒŒ.. 2020. 11. 3.
ํŒŒ์ด์ฌ(Python) ๋””๋ ‰ํ† ๋ฆฌ ์ƒ์„ฑ, ์—†์œผ๋ฉด ๋งŒ๋“ค๊ธฐ ํŒŒ์ด์ฌ(Python)์œผ๋กœ ๋””๋ ‰ํ† ๋ฆฌ(directory)๋ฅผ ์ƒ์„ฑํ•  ๋•Œ ๋ฐ”๋กœ ๋งŒ๋“ค ์ˆ˜๋„ ์žˆ์ง€๋งŒ, ์—†๋Š”์ง€ ์ฒดํฌ๋ฅผ ํ•˜๊ณ  ๋งŒ๋“ค๋ฉด ์•ˆ์ „ํ•˜๊ฒŒ ๋งŒ๋“ค ์ˆ˜๋„ ์žˆ๊ณ , ํ•จ์ˆ˜๋ฅผ ํ•˜๋‚˜ ์ž˜ ๋งŒ๋“ค์–ด ๋‘๋ฉด ๋””๋ ‰ํ† ๋ฆฌ๊ฐ€ ์žˆ๋“  ์—†๋“  ํ•จ์ˆ˜ ํ˜ธ์ถœ์„ ํ•˜๋ฉด ๋œ๋‹ค๋Š” ์žฅ์ ์ด ์žˆ๋‹ค. ๊ฑฐ๋‘์ ˆ๋ฏธํ•˜๊ณ  ๋ฐ”๋กœ ์•„๋ž˜์˜ ํ•จ์ˆ˜๋ฅผ ๊ฐ€์ ธ๋‹ค๊ฐ€ ์‚ฌ์šฉํ•˜๋ฉด ๋œ๋‹ค. ์ง์ ‘ ๋งŒ๋“  ํ•จ์ˆ˜์ด๋‹ˆ ๋„์›€์ด ๋˜๊ธฐ๋ฅผ ๋ฐ”๋ž€๋‹ค. import os def createDirectory(directory): try: if not os.path.exists(directory): os.makedirs(directory) except OSError: print("Error: Failed to create the directory.") try, except ๊ตฌ๋ฌธ์„ ํ†ตํ•ด ํ•œ์ธต ๋” ์•ˆ์ „ํ•˜๊ฒŒ ๋งŒ๋“ค์–ด์ง„ ํ•จ์ˆ˜์ด๋‹ˆ ๋ง‰ ๊ฐ€์ ธ.. 2020. 10. 20.
AWS Instance Scheduler ์‚ฌ์šฉ๋ฒ• AWS EC2 ๋น„์šฉ ์ ˆ๊ฐ ๋ฐฉ๋ฒ•(ํƒ€์ด๋จธ๋กœ EC2 ์ธ์Šคํ„ด์Šค๋ฅผ ๊ป๋‹ค ์ผฐ๋‹ค ํ•ด๋ณด์ž) ์ œ๋ชฉ์ด ๊ธธ์—ˆ๋‹ค. ๊ทธ๋งŒํผ ์ด๋ฒˆ ํฌ์ŠคํŒ…์€ ์—ฌ๋Ÿฌ ์‚ฝ์งˆ ๋์— ์•„์ฃผ ์ข‹์€ ์ •๋ณด ๊ธ€์ด ๋  ๊ฒƒ์ด๋ผ ํ™•์‹ ํ•˜๊ณ  ๊ธ€์„ ์ ๋Š”๋‹ค. ์—ฌ๋Ÿฌ ๊ธ€๋“ค์„ ์ฐพ์•„๋ณด์•˜์ง€๋งŒ, ๋งค๋‰ด์–ผ์กฐ์ฐจ๋„ ์ด๋ฒˆ ํฌ์ŠคํŒ…๋ณด๋‹ค ์‰ฝ์ง€๋Š” ์•Š์„ ๊ฒƒ์ด๋ผ ์ž๋ถ€ํ•œ๋‹ค. ๋งค๋‰ด์–ผ ๋ฒˆ์—ญ๋„ ๊ทธ๋‹ค์ง€ ๊น”๋”ํ•˜์ง€ ์•Š๊ณ , ์ด๋ฏธ AWS ์„œ๋น„์Šค๋ฅผ ์ž˜ ์‚ฌ์šฉํ•˜๋Š” ์‚ฌ์šฉ์ž๋“ค์—๊ฒŒ ์ ํ•ฉํ•˜๊ธฐ ๋•Œ๋ฌธ์— ์ดํ•ดํ•˜๊ธฐ ์‰ฝ์ง€๊ฐ€ ์•Š๋‹ค. ๊ฒŒ๋‹ค๊ฐ€ ์ œ๋ฒ• ์‚ฝ์งˆ์„ ํ•˜๋‹ค๊ฐ€ ์•Œ์•„๋‚ธ ์•„์ฃผ ์‰ฌ์šด ๋ฐฉ๋ฒ•์ด๊ธฐ์— ๊ฐ€์น˜๊ฐ€ ์žˆ์„ ๊ฒƒ์ด๋ผ ์ƒ๊ฐํ•œ๋‹ค. ๋จผ์ €, AWS EC2 ์ธ์Šคํ„ด์Šค ์ƒ์„ฑ์ด๋‚˜ ๊ธฐ๋ณธ ์‚ฌ์šฉ ๋ฐฉ๋ฒ•์€ ์•ˆ๋‹ค๊ณ  ๊ฐ€์ •ํ•˜๊ฒ ๋‹ค. EC2 ์ธ์Šคํ„ด์Šค ์ƒ์„ฑ๊นŒ์ง€๋Š” ๋งŽ์€ ๋ธ”๋กœ๊ทธ์—์„œ ๋‹ค๋ฃจ๊ณ  ์žˆ์œผ๋‹ˆ ๊ตฌ๊ธ€๋งํ•ด์„œ ์ œ์ผ ๋จผ์ € ๋œจ๋Š” ๊ธ€์„ ๋งํฌํ•œ๋‹ค. [AWS] EC2 (1) - EC2 ์ธ์Šคํ„ด์Šค ์ƒ์„ฑํ•˜๊ธฐ 2020.02.06 ์ˆ˜์ • 1. ์„œ๋น„์Šค ์†Œ๊ฐœ AWS EC2๋Š” ๊ฐ„๋‹จํ•˜๊ฒŒ ๊ฐ€์ƒ์„œ๋ฒ„๋ผ.. 2020. 10. 13.
Ruby Development Kit์˜ Rubygem SSL ์ธ์ฆ ๋ฌธ์ œ ๋‹จ์ˆœ ํ•ด๊ฒฐ ๋ฐฉ๋ฒ• ๊ณตํฌ์˜ SSL ์˜ค๋ฅ˜๋ฅผ ๋˜ ๋งž์ดํ–ˆ๋‹ค. ์ด์ œ๋Š” ์ด ๋ฌธ์ œ ํ•ด๊ฒฐ์˜ ๊ทผ๋ณธ์„ ๊ณ ์น˜๊ณ  ๋‚˜์„œ ์ œ๋Œ€๋กœ ํฌ์ŠคํŒ…์„ ํ•ด์•ผํ•  ๋“ฏ์‹ถ๋‹ค. gem install *** ๊ณผ ๊ฐ™์€ ๊ตฌ๋ฌธ์„ ์‹คํ–‰ํ•˜์ž ๊ณตํฌ์˜ ์—๋Ÿฌ ๋ฌธ๊ตฌ๋“ค์ด ๋‚˜ํƒ€๋‚ฌ๋‹ค. ERROR: SSL verification error at depth 1: self signed certificate in certificate chain (19) ERROR: Root certificate is not trusted (/C=KR/O=Somansa/CN=Somansa Root CA) ์ฐธ๊ณ ๋กœ ์—๋Ÿฌ๋ฉ”์‹œ์ง€์˜ Somansa๋Š” ๊ตญ๋‚ด์˜ ๋ณด์•ˆ์—…์ฒด์ธ๋ฐ, ํ˜„ ํšŒ์‚ฌ๊ฐ€ ์ด ์—…์ฒด๋ฅผ ํ†ตํ•ด ์ธ์ฆ์„œ๋ฅผ ๋ฐœ๊ธ‰๋ฐ›์•„ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ๊ธฐ ๋•Œ๋ฌธ์ด๋‹ค. Self signed certificate in certificate chain ์ด ๋ฉ”์‹œ.. 2020. 9. 24.
ํŒŒ์ด์ฌ ๋‚ ์งœ-์‹œ๊ฐ„ ์‚ฌ์šฉ๊ณผ ๊ณ„์‚ฐ์— ์œ ์šฉํ•œ datetime ๋ชจ๋“ˆ ํ™œ์šฉ ์˜ˆ์‹œ ๋ชจ์Œ ํŒŒ์ด์ฌ์—์„œ ๋ฆฌ์ŠคํŠธ๋ฅผ ๊ด€๋ฆฌํ•˜๋“  ๋”•์…”๋„ˆ๋ฆฌ๋ฅผ ์‚ฌ์šฉํ•˜๋“  pandas์™€ ๊ฐ™์€ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ์‚ฌ์šฉํ•˜๋“  ๋‚ ์งœ ๊ฐ์ฒด๋ฅผ ์‚ฌ์šฉํ•  ์ผ์ด ์ œ๋ฒ• ์žˆ๋‹ค. ๋ณธ ํฌ์ŠคํŒ…์—์„œ๋Š” ํ”ํ•˜๊ฒŒ ์‚ฌ์šฉ๋˜๋Š” datetime ๋ชจ๋“ˆ์˜ ์‚ฌ์šฉ ์˜ˆ์‹œ๋“ค์„ ๋…ธํŠธ๋ถ์—์„œ ์ž‘์—…ํ•œ ๋‚ด์—ญ์„ ์ญ‰ ๋ถ™์—ฌ์„œ ๋ณด์—ฌ์คŒ์œผ๋กœ์จ datetime์˜ ๋‹ค์–‘ํ•œ ํ˜•ํƒœ์˜ ํ™œ์šฉ์„ ๋•๊ณ ์ž ํ•œ๋‹ค. datetime๋งค๋‰ด์–ผ์„ ํ†ตํ•ด ๋”์šฑ ์ž์„ธํžˆ ํ™•์ธํ•˜๊ณ  ๋‹ค์–‘ํ•œ ๊ธฐ๋Šฅ์„ ํญ๋„“๊ฒŒ ์‚ฌ์šฉํ•  ์ˆ˜๋„ ์žˆ์ง€๋งŒ, ์ฒ˜์Œ ์‚ฌ์šฉํ•˜๋Š” ์‚ฌ์šฉ์ž์˜ ์ž…์žฅ์—์„œ๋Š” ์•„๋ž˜์—์„œ ๋ณด์ธ ์˜ˆ์‹œ๋“ค๋งŒ์œผ๋กœ๋„ ์ถฉ๋ถ„ํžˆ ๋งŽ์€ ๊ธฐ๋Šฅ์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์œผ๋ฆฌ๋ผ ๋ณธ๋‹ค. datetime ๋ชจ๋“ˆ ์‚ฌ์šฉํ•˜๊ธฐ¶ In [2]: import datetime as dt now()ํ•จ์ˆ˜๋ฅผ ํ†ตํ•ด ํ˜„์žฌ ์‹œ๊ฐ„ ๋ถˆ๋Ÿฌ์˜ค๊ธฐ¶ In [3]: current_time = dt.datetime.now() In [4.. 2020. 9. 22.