본문 바로가기
728x90
반응형

python8

chroma 디비 생성과 데몬 실행 크로마 공식 홈페이지에서 자신을 소개한 내용은 다음과 같습니다. Chroma is the open-source AI application database. 파이션으로 설치합니다.pip3 install chromadb 크로마 디비를 생성합니다.크로마 디비는 디렉터리 형태로 생성됩니다. import chromadbclient = chromadb.PersistentClient(path="./chroma_db") chroma_db 폴더 내 크로마 디비가 생성된 것을 확인할 수 있습니다. 데몬 실행은 해당 갱로로 이동 후 chroma run --path ./ 위 명령어가 정상 작동하면 다음과 같은 화면이 보입니다. 크롬 브라우저에서 http://localhost:8000/를 접속해 보면 다음과 같은 화면이 .. 2025. 4. 21.
pip install 실행 시 externally-managed-environment를 만났을때 해결 방법 유튜브를 내려받고 싶을 때 유튜브 프리미엄을 가입하면 됩니다.그런데 요금을 내기 싫을 때는 웹에서 유튜브 주소를 넣고 내려받는 사이트를 이용합니다.그런데 가끔 해당 사이트에서 내려 받으면 해킹 위험이 있다고 하는 얘기를 듣고 불안감에 python으로 유튜브 다운로드 툴을 짜서 사용하고 있었습니다.참고적으로 제 PC 환경은 macOS 입니다.다운로드 툴을 맥 스튜디오에서 잘 쓰고 있었는데 맥북에도 설치를 해서 사용하려고 실행을 했습니다. 실행을 하니 yt-dlp 라이브러리가 없다는 에러가 보였습니다.그래서 'pip install yt-dlp'를 실행하니externally-managed-environment 에러를 만났습니다.  에러 메시지를 보면 몇 가지 설치를 더 해서 해결하라고 나옵니다.다 해 보아도 .. 2024. 12. 28.
파이션(python) 초등 완전 기초: 리스트 (Lists) flowers = "pink primrose,hard-leaved pocket orchid,canterbury bells,sweet pea,english marigold,tiger lily,moon orchid,bird of paradise,monkshood,globe thistle" print(type(flowers)) print(flowers) 결과: pink primrose,hard-leaved pocket orchid,canterbury bells,sweet pea,english marigold,tiger lily,moon orchid,bird of paradise,monkshood,globe thistle flowers_list = ["pink primrose", "hard-leaved pock.. 2023. 2. 12.
파이션(python) 초등 완전 기초: 조건문(Conditions and Conditional Statements) 조건 (Conditions) print(2 > 3) 결과: False var_one = 1 var_two = 2 print(var_one = var_one) 결과: False True 기호(Symbol) 의미 == 같다 (equals) != 같지 않다 (does not equal) = 크거나 같다 (greater than or equal to) 조건문(Conditional Statements) "if" 조건문 def evaluate_temp(temp): # Set an initial message message = "Normal temperature." # Update value of message only if temperature greater than 38 if .. 2023. 2. 10.
파이션(python) 초등 완전 기초: 데이타 타입(Data Types) 정수(Integers) x = 14 print(x) print(type(x)) 결과: 14 실수(Floats) nearly_pi = 3.141592653589793238462643383279502884197169399375105820974944 print(nearly_pi) print(type(nearly_pi)) 결과: 3.141592653589793 불린(Booleans): 참, 거짓 z_one = True print(z_one) print(type(z_one)) 결과:True z_three = (1 < 2) print(z_three) print(type(z_three)) 결과: True z_five = not z_three print(z_five) print(type(z_five)) 결과: Fals.. 2023. 2. 9.
파이션(python) 초등 완전 기초: 함수(Function) 함수 생성 "add_three" 함수 생성 # Define the function def add_three(input_var): output_var = input_var + 3 return output_var 함수 사용 # Run the function with 10 as input new_number = add_three(10) # Check that the value is 13, as expected print(new_number) 결과: 13 함수 멀티 파라미터(multiple arguments) def get_pay_with_more_inputs(num_hours, hourly_wage, tax_bracket): # Pre-tax pay pay_pretax = num_hours * hourly_w.. 2023. 2. 9.
728x90
반응형