美文网首页
终端-python连接postgresql数据库

终端-python连接postgresql数据库

作者: 异想派 | 来源:发表于2017-02-27 22:27 被阅读31次
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
增删环境变量

相关文章

网友评论

      本文标题:终端-python连接postgresql数据库

      本文链接:https://www.haomeiwen.com/subject/vtutgttx.html