[Error] ModuleNotFoundError: No module named 'html.entities'; 'html' is not a package

2022. 9. 24. 10:00ใ†๐Ÿ Python

 

 

python์œผ๋กœ html ํŒŒ์ผ์„ ์ˆ˜์ •ํ•˜๋Š” ํ•จ์ˆ˜๋ฅผ ๋งŒ๋“ค๋˜ ์ค‘... ๋‹ค์Œ๊ณผ ํ•จ์ˆ˜๊ฐ€ ๋–ด๋‹ค.

ModuleNotFoundError: No module named 'html.entities'; 'html' is not a package

 

 

(1) ๋ชจ๋“ˆ์—๋Ÿฌ๋ผ๊ณ  ํ•ด์„œ import๋ฅผ ์ž˜๋ชปํ–ˆ๋‚˜ ๋ดค๋Š”๋ฐ ์—†์—ˆ๋‹ค.

(2) ๊ฒฐ๊ตญ ์ฐพ์•„๋ณด๋‹ˆ, ๊ฐ™์€ ํด๋„ ๋‚ด์— html.py ํŒŒ์ผ์ด ์žˆ์œผ๋ฉด ์ด๋ฅผ import ํŒŒ์ผ๋กœ ์ธ์‹ํ•ด์„œ ์—๋Ÿฌ๊ฐ€ ๋œจ๋Š” ๊ฒƒ์ด๋ผ๊ณ  ํ•œ๋‹ค.

 

 

๊ทธ๋ž˜์„œ ๋ƒ‰ํผ html.py ํŒŒ์ผ์„ ๋‹ค๋ฅธ ์ด๋ฆ„์œผ๋กœ ๋ฐ”๊ฟ”์คฌ๋”๋‹ˆ ํ•ด๊ฒฐ๋˜์—ˆ๋‹ค.