반응형 python338 ValueError: Mime type rendering requires nbformat>=4.2.0 but it is not installed ValueError: Mime type rendering requires nbformat>=4.2.0 but it is not installed- 위 와 같은 에러 메세지가 나타나면 아래 명령어로 nbformat의 버전을 업그레이드해주세요pip install --upgrade nbformat 2024. 8. 25. ModuleNotFoundError: No module named 'mysql' ModuleNotFoundError: No module named 'mysql'ImportError: 'MySQL'이라는 이름의 모듈이 없습니다.아래 명령어로 mysql 패키지를 설치해주세요 !pip install mysql-connector-python 2024. 8. 23. HTTPError: HTTP Error 400: Bad Request pytube HTTPError: HTTP Error 400: Bad Request pytube유튜브 다운과정에서 위와 같은 에러가 나오면 아래 코드로 실행해 보세요 # pytubefix 설치#pip install pytubefix# 패키지 불러오기from pytubefix import YouTubefrom pytubefix.cli import on_progress # url 선택url = "url" # 객체 생성yt = YouTube(url, on_progress_callback = on_progress)# 다운로드 실행 ys = yt.streams.get_highest_resolution()ys.download() 2024. 8. 13. 파이썬으로 첫번째 띄어쓰기 전 문장 가져오기 파이썬으로 첫번째 띄어쓰기 전 문장 가져오기 주어진 문자열에서 첫 번째 "\n"이 나오기 전까지의 문자열을 가져오면됩니다. Python에서 split 메서드를 사용할 수 있습니다. 다음은 그 예시 코드입니다.# 예시 문자열text = "첫번째 줄\n두번째 줄\n세번째 줄"# 첫 번째 \n 이전까지의 문자열 추출first_line = text.split('\n')[0]print(first_line) 2024. 8. 11. huggingface/tokenizers: The current process just got forked, after parallelism has already been used. Disabling parallelism to avoid deadlocks... To disable this warning, you can either: huggingface/tokenizers: The current process just got forked, after parallelism has already been used. Disabling parallelism to avoid deadlocks... To disable this warning, you can either: 이 경고는 Huggingface tokenizers 라이브러리에서 병렬 처리가 이미 사용된 후 프로세스가 포크될 때 발생합니다. 이는 잠재적인 데드락을 방지하기 위한 안전 조치입니다. 이 경고를 비활성화하려면 아래 코드를 추가해 주세요 ! import osos.environ["TOKENIZERS_PARALLELISM"] = "false" 2024. 8. 1. TypeError: Object of type ndarray is not JSON serializable TypeError: Object of type ndarray is not JSON serializable 1. 오류설명- 파이썬 딕셔너리를 json파일로 저장할때, array이가 포함되어 있다면 발생하는 오류 입니다.import jsonimport numpy as npy = np.array([3,4])dict = { "name" : "John", "array" : y}with open("temp.json", 'w') as f: json.dump(dict, f) TypeError: Object of type ndarray is not JSON serializable 2. 해결방법- array를 list로 변경하면 문제없이 저장 됩니다.- tolist() 메서드를 활용하여 array를 리.. 2024. 7. 31. 이전 1 ··· 4 5 6 7 8 9 10 ··· 57 다음 반응형