본문 바로가기

반응형

Python

(62)
[Python] pip install mariadb - MariaDB Connector/Python requires MariaDB Connector/C >= 3.3.1, found version 3.1.20 (feat. ubuntu / Docker) 다른에러에서 oserror 해결하고 오니까 또 에러가 난다. Error pip install mariadb Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com /usr/share/python-wheels/urllib3-1.25.8-py2.py3-none-any.whl/urllib3/connectionpool.py:999: InsecureRequestWarning: Unverified HTTPS request is being made to host 'pypi.ngc.nvidia.com'. Adding certificate verification is strongly advised. See: https://urllib3.readt..
[Python] python3 -m venv .venv error (feat. ubuntu) error 아래 처럼 venv로 가상환경을 만드려고 했는데 에러가 났다. root:/test# python3 -m venv .venv The virtual environment was not created successfully because ensurepip is not available. On Debian/Ubuntu systems, you need to install the python3-venv package using the following command. apt install python3.8-venv You may need to use sudo with that command. After installing the python3-venv package, recreate your virtua..
[PYTHON] DB SSL 연결 (feat. sql alchemy / mariadb) DB 설정 및 ssl 인증서 설정 https://24hours-beginner.tistory.com/389#%ED%94%84%EB%A1%9C%EC%A0%9D%ED%8A%B8_SSL_%EC%97%B0%EA%B2%B0_(Python_-_SQL_Alchemy) [MariaDB] 외부접속시 TLS/SSL 활성화 (feat. OpenSSL) 재직하고 있는 회사에서 한 서버에 api 서버와 db 서버가 같이 있어 보안에 별로 신경을 안 썼다. 하지만 회사가 조금 커지고 서버도 더 사주셔서 웹서버와 db 서버가 실질적으로 분리되었고, 보안 24hours-beginner.tistory.com Python db ssl 접속 (feat. sql alchemy) ssl 경로 적어주기 다양한 요인에 의하여 문법 등이 달라질 ..
[Python] pip install mariadb - Python: OSError: mariadb_config not found. (feat. ubuntu) 해결 apt install libmariadb-dev 원인은 필요한게 없어서 그런건데 오류를 보면 보다시피 mariadb_config가 없다고 한다. 그래서 관련 라이브러리를 install 해준다. Build prerequisites The following build prerequisites are required to install or build MariaDB Connector/Python from source code, github or from pypi.org. To install MariaDB Connector/Python from sources you will need: C compiler Python development files (Usually they are installed with..
[SQLAlchemy] shema 사용하기 내가 하고 싶었는데 못했던거 해결해서 까먹을까봐 쓰는 글 실제로 코드를 간략하게 인터넷에서 볼 수 있도록 바꾼거라 실행 안해봄.. (오류가 있을 수 있음) 환경 Python 3.9.13 SQLAlchemy 1.4.44 sample models.py from sqlalchemy import TIMESTAMP, Column, String, ForeignKey, text, DATE, TIME, FLOAT, Table from sqlalchemy.orm import relationship, backref from sqlalchemy.dialects.mysql import INTEGER, DECIMAL, TINYINT, TEXT from app.database import Base class User(Base):..
[Python] Python Timezone conversion (feat. pytz replace & timezone) pytz https://stackoverflow.com/questions/10997577/python-timezone-conversion/18646797#18646797 Python Timezone conversion How do I convert a time to another timezone in Python? stackoverflow.com from datetime import datetime import pytz utcmoment_naive = datetime.utcnow() utcmoment = utcmoment_naive.replace(tzinfo=pytz.utc) # print "utcmoment_naive: {0}".format(utcmoment_naive) # python 2 print(..
[Python] Sqlalchemy mysql group by with rollup https://sqlalchemy.narkive.com/0FwbqYZD/group-by-with-rollup#post2 GROUP BY ... WITH ROLLUP Is it possible to use the 'WITH ROLLUP' clause in SQLAlchemy? I'm having problems locating any examples on how to do so. Here's a link to MySQL (dialect I'm using) docs on the statement - http://dev.mysql.com/doc/refman/5.0/en/group-by-modifiers.html -- Yo sqlalchemy.narkive.com
[Python] venv 생성/실행 (가상환경)(python package 따로 관리) 참고 python 3.6.15 자습서 - 12. 가상 환경 및 패키지 0. venv 가상 환경을 만들고 관리하는 데 사용되는 모듈 1. 생성 (python3 -m venv [디렉토리 경로]) # ubuntu python3 -m venv [디렉토리 경로] # windows python -m venv [디렉토리 경로] python3 -m venv tutorial-env python3 -m venv /test/tutorial-env 존재하지 않는다면 tutorial-env 디렉터리를 만들고, 그 안에 파이썬 인터프리터의 사본, 표준 라이브러리 및 다양한 지원 파일이 들어있는 디렉터리들을 만듭니다. 가상 환경을 만들었으면, 가상 환경을 활성화할 수 있습니다. 2. 실행 (source [디렉토리경로]/bin/ac..

반응형