pypy

Installing Python eggs under PyPy

久未见 提交于 2019-11-29 11:42:12
问题 How do I install Python egg under PyPy? During installation, PyPy created /usr/lib64/pypy-1.5/site-packages/ directory. So, I tried using easy_install with prefix set to this directory, however it complains that this is not a valid directory for eggs. Do I just copy eggs from /usr/lib/python2.7/site-packages , or is it as easy as using easy_install (with some changes in configuration, perhaps)? My working environment is Fedora 15 Beta, Python 2.7.1 ( /usr/bin/python ), PyPy 1.5.0-alpha0 with

Using Numpy with pypy

南楼画角 提交于 2019-11-29 09:10:28
I am using some numpy tools (mainly arrays) and I wanted to run the script with pypy, but i can't make it work. The error that i get is: ImportError: No module named multiarray. I checked if the multiarray.so file was in the core folder. Can someone tell me if first: is possible to do what I am trying to do and second: How can I do it? I've just posted a blog post explaining what's the status and what's the plan. In short numpy will not work with PyPy's cpyext and even if it does, it would be too slow for usage. The other answers are quite old. Here is the the completely unscientific measure

how can i use pip with pypy installed from launchpad?

北慕城南 提交于 2019-11-28 16:00:22
问题 I have ubuntu 11.10. I apt-get installed pypy from this launchpad repository: https://launchpad.net/~pypy the computer already has python on it, and python has its own pip. How can I install pip for pypy and how can I use it differently from that of python? 回答1: Quoting (with minor changes) from here the pypy website: If you want to install 3rd party libraries, the most convenient way is to install pip: $ curl -O https://bootstrap.pypa.io/get-pip.py $ ./pypy-2.1/bin/pypy get-pip.py $ ./pypy-2

How do you get PyPy, Django and PostgreSQL to work together?

こ雲淡風輕ζ 提交于 2019-11-28 14:48:32
问题 What fork, or combination of packages should one to use to make PyPy, Django and PostgreSQL play nice together? I know that PyPy and Django play nice together, but I am less certain about PyPy and PostgreSQL. I do see that Alex Gaynor has made a fork of PyPy called pypy-postgresql. I also know that some people are using psycopg2-ctypes. Is there a difference between these forks? Or should we use the stable 1.9 PyPy and use psycopg2-ctypes? Using the ctypes options could hurt performance, see

Kivy, Eclipse and PyDev (also PyPy)

浪尽此生 提交于 2019-11-28 06:29:24
According to this post: https://groups.google.com/forum/?fromgroups#!topic/kivy-users/n7c3thksnzg , it is possible to use Eclipse as an IDE for Kivy through PyDev. However, I didn't understand the instructions. Can anyone please elaborate on how to connect Kivy with Eclipse. Note: I'm on a Windows machine. Also, is it possible to use PyPy instead of the Python Interpreter? Thanks~! Using Kivy with Pydev on Windows xp/7 Under Window/Preferences/PyDev/Interpreter-Python add a new interpreter pointing to the python executable which ships with kivy portable add kivy package folder under libraries

Using Numpy with pypy

 ̄綄美尐妖づ 提交于 2019-11-28 02:33:35
问题 I am using some numpy tools (mainly arrays) and I wanted to run the script with pypy, but i can't make it work. The error that i get is: ImportError: No module named multiarray. I checked if the multiarray.so file was in the core folder. Can someone tell me if first: is possible to do what I am trying to do and second: How can I do it? 回答1: I've just posted a blog post explaining what's the status and what's the plan. In short numpy will not work with PyPy's cpyext and even if it does, it

Why is pow(a, d, n) so much faster than a**d % n?

和自甴很熟 提交于 2019-11-27 17:25:17
I was trying to implement a Miller-Rabin primality test , and was puzzled why it was taking so long (> 20 seconds) for midsize numbers (~7 digits). I eventually found the following line of code to be the source of the problem: x = a**d % n (where a , d , and n are all similar, but unequal, midsize numbers, ** is the exponentiation operator, and % is the modulo operator) I then I tried replacing it with the following: x = pow(a, d, n) and it by comparison it is almost instantaneous. For context, here is the original function: from random import randint def primalityTest(n, k): if n < 2: return

PyPy — How can it possibly beat CPython?

ε祈祈猫儿з 提交于 2019-11-27 16:34:45
From the Google Open Source Blog : PyPy is a reimplementation of Python in Python, using advanced techniques to try to attain better performance than CPython. Many years of hard work have finally paid off. Our speed results often beat CPython, ranging from being slightly slower, to speedups of up to 2x on real application code, to speedups of up to 10x on small benchmarks. How is this possible? Which Python implementation was used to implement PyPy? CPython ? And what are the chances of a PyPyPy or PyPyPyPy beating their score? (On a related note... why would anyone try something like this?)

Why shouldn't I use PyPy over CPython if PyPy is 6.3 times faster?

纵然是瞬间 提交于 2019-11-27 09:55:42
I've been hearing a lot about the PyPy project. They claim it is 6.3 times faster than the CPython interpreter on their site . Whenever we talk about dynamic languages like Python, speed is one of the top issues. To solve this, they say PyPy is 6.3 times faster. The second issue is parallelism, the infamous Global Interpreter Lock (GIL). For this, PyPy says it can give GIL-less Python . If PyPy can solve these great challenges, what are its weaknesses that are preventing wider adoption? That is to say, what's preventing someone like me, a typical Python developer, from switching to PyPy right

Why is pow(a, d, n) so much faster than a**d % n?

做~自己de王妃 提交于 2019-11-26 19:03:05
问题 I was trying to implement a Miller-Rabin primality test, and was puzzled why it was taking so long (> 20 seconds) for midsize numbers (~7 digits). I eventually found the following line of code to be the source of the problem: x = a**d % n (where a , d , and n are all similar, but unequal, midsize numbers, ** is the exponentiation operator, and % is the modulo operator) I then I tried replacing it with the following: x = pow(a, d, n) and it by comparison it is almost instantaneous. For context