本文介绍了PyPy是否支持gmpy2?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从讨论中看来,问题#60 第40条,PyPy之前无法构建gmpy.我目前打算使用的只是可能的质数is_prime代码,该代码方便地位于gmpy2中.我的印象是,调用gmpy2的次数越多,表示PyPy的效率越低.当前可以使用gmpy2吗?还是我必须使用类似GMPY_CFFI的东西?

It seems from the discussions issue #60 and issue #40 that PyPy couldn't build gmpy before. All I intend to use currently is the probable prime is_prime code which is conveniently in gmpy2. I get the impression that the more calls to gmpy2 means less efficiency for PyPy. Is using gmpy2 possible currently, or do I have to use something like GMPY_CFFI?

在PyPy中使用pip时出现的错误是cannot open include file 'mpir.h'

The error I get when using pip in PyPy is cannot open include file 'mpir.h'

推荐答案

您应使用 GMPY_CFFI . gmpygmpy2依赖于CPython的太多内部细节,无法移植到PyPy.

You should use GMPY_CFFI. gmpy and gmpy2 rely on too many internal details of CPython to be ported to PyPy.

注意:我维护gmpy2.

这篇关于PyPy是否支持gmpy2?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!