原创 numpy:DeprecationWarning: The binary mode of fromstring is deprecated, as it behaves surprisingly

DeprecationWarning: The binary mode of fromstring is deprecated, as it behaves surprisingly on unicode inputs. Use

原创 anaconda 怎樣移動anaconda文件夾到其他目錄

由於各種原因,需要把原來在安裝在/root/目錄下的anaconda移到/home/下,嘗試了三種方式: 將anaconda遷移到新目錄,再建立軟鏈接到原安裝目錄,簡單有效! 導出需要的虛擬環境到environment.yml,

原创 【常用工具命令行】之多媒體處理工具FFmpeg

日常編碼中用到的ffmpeg命令行,及時記錄備忘,命令親測有效哦 查看文件詳情 # 查看文件詳情 ffmpeg -i a.ts -f null - # 以json格式查看詳情 ffprobe -v quiet -print_format

原创 uwsgi:error while loading shared libraries: libpcre.so.1

anaconda 虛擬環境pip安裝uwsgi後,運行報錯: uwsgi: error while loading shared libraries: libpcre.so.1: cannot open shared object

原创 python/c++ 利用gRPC完成python遠程調用c++

Python Django寫的後臺,想要調用小夥伴的c++模塊方法,目前想到三種解決方案:http,gRPC,本地調用(ctypes,SWIG) 出於以下考慮: 後臺與模型模塊分離部署(部分模型模塊對GPU,顯存等有各類要求)

原创 python/c++ SWIG把c++封裝成爲python可調用的so庫

SWIG是一個接口編譯器,爲c/c++提供腳本語言接口,支持多種語言(Perl, PHP, Python, Tcl, Ruby 和 PHP) 安裝 #linux apt-get install swig 命令步驟 #根據exam

原创 redis celery:AttributeError: str object has no attribute items

linux python manage.py celery worker -B -l info 報錯 …… File "/root/anaconda3/envs/env**/lib/python3.6/site-packag

原创 DRF Error Log(用戶相關)

問題: @receiver(post_save, sender=User) def create_user(sender, instance=None, created=False, **kwargs): …… 用戶User的信

原创 python 利用gRPC完成遠程調用c++

Python Django寫的後臺,想要調用小夥伴的c++模塊方法,目前想到三種解決方案:http,gRPC,本地調用(ctypes,SWIG) 出於以下考慮: 後臺與模型模塊分離部署(部分模型模塊對GPU,顯存等有各類要求)

原创 linux pip uwsgi compiler_compat/ld: error: lto-wrapper failed collect2: error: ld returned 1 exit

linux-gnu/libpython3.6m.a -lutil -lcrypt lto1: fatal error: bytecode stream generated with LTO version 6.0 inst

原创 Linux+uWSGI+flask部署

安裝uWSGI pip install uwsgi 創建 uwsgi.ini 文件 [uwsgi] http=172.xxx.xxx.xxx:5000 #pythonpath :項目目錄 pythonpath=/home/hay

原创 ubuntu+uwsgi+nginx+django 部署手記三(配置https)

django rest framwork 爲了配合微信小程序的訪問,藉助nginx ssl 配置https https 有兩部分組成:HTTP + SSL / TLS #首先,cd 到你想生成證書、私鑰的路徑下面 #1.創建服務器

原创 linux如何徹底殺掉uwsgi進程

在啓動uwsgi時,如果指定了pid,可以通過pid停止uwsgi 如果沒指定,直接kill uwsgi的進程id,會導致uwsgi重啓,無法關閉成功 未指定 daemonize: Ctrl+c(快捷鍵可能有所不同) 指定

原创 SWIG把c++封裝成爲python可調用的so庫

SWIG是一個接口編譯器,爲c/c++提供腳本語言接口,支持多種語言(Perl, PHP, Python, Tcl, Ruby 和 PHP) 安裝 #linux apt-get install swig 命令步驟 #根據exam

原创 ubuntu下uwsgi如何部署django的http服務

uwsgi 安裝 pip install uwsgi -i http://pypi.douban.com/simple --trusted-host pypi.douban.com 在conda環境下大概率安裝不成功,可以使