将ubuntu升级到17.10时psycopg2导入错误(从17.04开始) [英] psycopg2 import error when ubuntu upgraded to 17.10 (from 17.04)

查看:110
本文介绍了将ubuntu升级到17.10时psycopg2导入错误(从17.04开始)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一切正常,直到我将操作系统升级到Ubuntu 17.10.现在我的Django项目无法运行(python manage.py runserver),因为psycopg2无法导入. psycopg2已随pip一起安装(那里没有任何更改).确切地说,这是错误:

Everything was working great until I upgraded the OS to Ubuntu 17.10. Now my Django project won't run (python manage.py runserver) because psycopg2 won't import. psycopg2 is already installed with pip (nothing has changed there). To be exact this is the error:

lib/python3.5/site-packages/psycopg2/.libs/libresolv-2-c4c53def.5.so: 
symbol __res_maybe_init, version GLIBC_PRIVATE not defined in file 
libc.so.6 with link time reference

推荐答案

尝试重新安装psycopg2.看起来像一个动态链接的依赖关系已更改.通常,数据库适配器具有已编译的组件,并且这些组件是针对可在更新时更改的系统文件编译的,因此,在主要的OS升级中,几乎可以肯定,您必须重新编译pip安装的版本.

Try reinstalling psycopg2. It looks like a dynamically linked dependency changed. The database adapters as a rule have compiled components and those are compiled against system files that can change on updates, so on major OS upgrades, you'll almost certainly have to recompile a pip installed version.

这篇关于将ubuntu升级到17.10时psycopg2导入错误(从17.04开始)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆