6월, 2023의 게시물 표시

[Python] AttributeError: partially initialized module "package_name" has no attribute "[package_name].attribute" (most likely due to a circular import)

 "AttributeError: partially initialized module "package_name" has no attribute "[package_name].attribute" (most likely due to a circular import)" 오류: "이 package는 요청하는 요소|선언 (attibute)이 없다." 이유: package 이름과 개발자가 작성 중이 파일명이 동일한 경우 발생한다. 예시: mypkg.py // import mypkg as mp mp.test() // python mypkg.py ... AttributeError: partially initialized module "mypkg" has no attribute "test" (most likely due to a circular import) 해결방법: mypkg를 mypkg_test.py와 같이 변경하자. mypkg_test.py // import mypkg as mp mp.test() // python mypkg.py ... This is my python test!

[Windows] terminal에서 wget, curl을 이용하여, file download 해보자!

Windows에서 wget으로 외부 library 혹은 package를 command line으로 설치하기 순서 1. wget 설치 [관리자 모드] choco install -y wget 2. curl 설치 (Windows 11에서는 curl을 사용할 수 있으나, 최신으로 사용하기 위해) [관리자 모드] choco install -y curl * 주의: "C:\Windows\System32\curl.exe"이 Chocolatey보다 우선이기 때문에, PATH를 "C:\ProgramData\chocolatey\bin"가 "C:\Windows\System32"보다 우선하도록 변경하면 해결된다. (선택적) 3. jq 설치 [관리자 모드] choco install -y jq 4. bsdtar 설치 ( libarchive 설치) 4.1 파일 다운로드받기 wget -Url https://libarchive.org/downloads/libarchive-v3.6.2-amd64.zip -OC:\Temp\libarchive-v3.6.2-amd64.zip 4.2 적당한 위치에 libarchive-v3.6.2-amd64.zip를 압축해제 ("libarchive\...") 4.3 "libarchive\bin"를 path에 등록 5. 예시 시험하기 예) 참고  Stack overflow  예시 wget -qO-  https://plugins.jetbrains.com/files/$( curl https://plugins.jetbrains.com/api/plugins/4415/updates | jq -r '.[0].file') | bsdtar -xvf- -C "%APPDATA%\JetBrains\IntellijIdea2023.1\plugins"