Knowledge Map
pymysql 을 이용해서 mysql에 접속한다.brew를 update 한 다음에 mysql를 설치해보면 mysql 8이 설치가 된다.pymysql 최신 버전의 경우 mysql8을 지원해주는 것을 확인할 수 있다. 하지만 정작 접속하려고 하면 1045 에러를 만나게 될 것이다. pymysql.err.OperationalError: (1045, u"Access denied for user 'root'@'localhost' (using password: YES)") 이건 쉽게 말하면 비번이 맞지 않아서 그런 것인데, 검색해보면 전부 grant 에서 권한을 다 허용하라는 식으로 나올 것이다.그렇게 해서 잘 되면 다행인데, 그렇게 하고나서도 안되는 경우가 있다. 그이유는 mysql 8에서는 기본적으로 sha2로..
아래와 같이 사용하면 그냥 json파일을 만들수 있다. import json json_data = {"one":1, "two":2, "three":3} with open('someData.json', 'w') as one_file: json.dump(json_data, one_file) Colored by Color Scriptercs
celery로 tensorflow를 실행시켜 비동기 백그라운드로 처리하려고 생각했었다. flask와 celery worker를 각각 실행한 다음 tensorflow의 메서드를 호출했을 때 다음과 같은 에러가 발생했다. tensorflow/stream_executor/cuda/cuda_driver.cc:1216] failed to enqueue async memcpy from host to device: CUDA_ERROR_NOT_INITIALIZED; GPU dst: 0x130a30d900; host src: 0x205c3d500; size: 4=0x4 검색을 하니 2017년도 즈음 되는 글이 나왔는데 버그였고 고쳤다고 했다. 하지만 난 이 에러가 발생했다.좀더 추가적으로 검색해보니 tf자체가 분산 연산..
1. celery에 대한 간단한 사용 코드는 http://flask.pocoo.org/docs/0.12/patterns/celery/https://blog.miguelgrinberg.com/post/using-celery-with-flaskhttp://flask.pocoo.org/docs/1.0/patterns/celery/ 를 참고하면 된다. 물론 개인저장소의 CeleryModule 래퍼 클래스와 config.py를 참고하면 더 좋다. 2. flask 의 app 컨텍스트 사용하기 celery는 개별적인 다른 프로세스로 돌아가기 때문에 flask의 컨텍스트를 그대로 받아서 사용하지 않고 아예 별개의 컨텍스트라고 보면된다.따라서 flask에 import 했던 모듈들은 제대로 동작이 안되는 경우가 많을 것이..
from matplotlib.backends import _macosxRuntimeError: Python is not installed as a framework. The Mac OS X backend will not be able to function correctly if Python is not installed as a framework. See the Python documentation for more information on installing Python as a framework on Mac OS X. Please either reinstall Python as a framework, or try one of the other backends. If you are using (Ana)..