Programming Language/Python
-
[Python Error] attributeerror: module 'typing' has no attribute '_specialform'Programming Language/Python 2023. 2. 22. 16:10
Error pip install로 python 라이브러리를 설치하던 중에 에러가 발생하여 해결하다가 다음과 같은 에러가 나면서 윈도우 터미널이 먹통됐다. 윈도우 터미널에 어떤 명령어를 쳐도 다음 에러가 발생... pip uninstall dataclasses 위의 명령어를 통해서 해결했다는 문서도 봤지만 내 경우에는 해당 명령어를 실행할 경우 다음 에러가 발생하면서 다시 먹통되기를 반복했다. modulenotfounderror: no module named 'dataclasses' Solutions 이것 저것 찾아봤지만 해결책은 pip를 다시 설치하는 것이 제일 빠르고 쉬웠다. curl -O https://bootstrap.pypa.io/pip/3.6/get-pip.py python get-pip.py ..
-
[Python] ubuntu에 Python 버전 설정하기Programming Language/Python 2022. 7. 24. 22:01
Python 버전 확인 python3 --version python --version Python 설치경로 확인 which python which python3 Alternatives로 Python 버전 변경 1. alternatives 확인 # python sudo update-alternatives --config python # python3 sudo update-alternatives --config python3 2. alternative 등록 # python sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.9 1 sudo update-alternatives --install /usr/bin/python pyt..
-
[Python] virtual env 설정Programming Language/Python 2022. 5. 8. 17:26
Virtual env venv를 사용하여 프로젝트 별 전용 가상공간을 생성하여 프로젝트 별로 독립된 파이썬 실행환경을 가질 수 있다. 여러 프로젝트의 python package를 섞이지 않게 관리할 수 있는 장점! 서로 다른 프로젝트의 패키지 버전이 충돌날 일이 없어진다. venv 설정 python3.x 버전일경우 python대신 python3으로 명령어 실행 # 파이썬 버전 확인 python --version # 가상환경 생성 cd project_directory python -m venv .venv # 윈도우 가상 환경 활성화 cd .venv/Scripts activate # 우분투 가상 환경 활성화 source .venv/bin/activate # 가상환경 비활성화 deactivate require..