python-3.x - pypy3 import psycopg2错误( undefined symbol :PyCoder_Encoder)

标签 python-3.x psycopg2 pypy

我在Ubuntu16.04上通过以下代码将psycopg2安装到pypy3(Python3.5.3):

pypy3 -m pip install psycopg2

但是,我遇到了一些错误:

Error:b'You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application.\n'

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-epd368s6/psycopg2



我在“You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application”中找到了解决方案。

我的计算机已经安装了Postgresql9.5,因此我使用了以下命令进行安装:
sudo apt-get install libpq-dev
pypy3 -m pip install psycopg2

没有错误报告,但是当我尝试“导入psycopg2”时,出现了ImportError:

enter image description here

我在“pypy3 import psycopg2 error (PyCodec_Encoder)”中发现了相同的错误,但没有找到解决方案。

有人知道如何解决吗?

最佳答案

pointed to发出的PyPy问题包含答案“有人必须实现缺少的功能(以及其他缺少的PyCodec_ *功能。目前,我们在codec.py中仅实现了很少的功能。根据实现的功能中的模式,实现非常简单,最难的部分是编写测试。

psycopg2cffi package,它应该可以在PyPy上运行并且会更快。如果可以满足您的需求,请尝试在此处进行评论。

关于python-3.x - pypy3 import psycopg2错误( undefined symbol :PyCoder_Encoder),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53338404/

相关文章:

python - 为 pypy 安装了 numpy 但得到 "TypeError: readonly attribute ' __module_ _' "

php - 单个网络服务器上的 PyPy + PHP

用于学习 Django 的 Python 2.7 或 3.3

python - 从 python/postgresql/psycopg2 中的用户输入安全地指定 'order by' 子句

python - 无法更新在 Google Cloud Platform 上构建的网站

postgresql - 将 Web2py 部署到 Heroku(Psycopg2 错误)

python - Postgresql:在不同的客户端中查询速度慢 10 倍

python - 处理列表和字典的惯用方式

Python 请求 422 post 错误

python - 从 X-Y 元组列表的字典中获取最大 X 和 Y 的最有效方法