终端-python连接postgresql数据库

import psycopg2

2017.02.28补充
改动暂时只对终端有效

若报错 Library not loaded: libssl.1.0.0.dylib,解决方式如下:

Option 2. If for some reason you would like to maintain the current symbolic links in usr/local, run this command in your shell:

export DYLD_FALLBACK_LIBRARY_PATH=$HOME/anaconda/lib/:$DYLD_FALLBACK_LIBRARY_PATH

Just make sure to replace $HOME/anaconda/lib above with the actual lib path. In my case, this was $HOME/miniconda2/envs/ali/lib.

This will only work for the shell/bash session you're currently in. To make the change persistent, add the export statement to your ~/.bash_profile or ~/.bashrc file.

参考资料:
stackoverflow:Import psycopg2 Library not loaded: libssl.1.0.0.dylib
增删环境变量

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容