<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>PyPy (Posts about RPyC)</title><link>https://www.pypy.org/</link><description></description><atom:link href="https://www.pypy.org/categories/rpyc.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2026 &lt;a href="mailto:pypy-dev@pypy.org"&gt;The PyPy Team&lt;/a&gt; </copyright><lastBuildDate>Mon, 23 Mar 2026 21:26:47 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Using CPython extension modules with PyPy, or: PyQt on PyPy</title><link>https://www.pypy.org/posts/2009/11/using-cpython-extension-modules-with-4951018896657992031.html</link><dc:creator>Alexander Schremmer</dc:creator><description>&lt;div class="document" id="using-cpython-extension-modules-with-pypy-or-pyqt-on-pypy"&gt;

&lt;p&gt;If you have ever wanted to use CPython extension modules on PyPy,
we want to announce that there is a solution that should be compatible
to quite a bit of the available modules. It is neither new nor written
by us, but works nevertheless great with PyPy.&lt;/p&gt;
&lt;p&gt;The trick is to use RPyC, a transparent, symmetric remote procedure
call library written in Python. The idea is to start a
CPython process that hosts the PyQt libraries
and connect to it via TCP to send RPC commands to it.&lt;/p&gt;
&lt;p&gt;I tried to run PyQt applications
using it on PyPy and could get quite a bit of the functionality of these
working. Remaining problems include regular segfaults of CPython
because of PyQt-induced memory corruption and bugs because classes
like StandardButtons behave incorrectly when it comes to arithmetical operations.&lt;/p&gt;
&lt;p&gt;Changes to RPyC needed to be done to support remote unbound &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;__init__&lt;/span&gt;&lt;/tt&gt; methods,
shallow call by value for list and dict types (PyQt4 methods want real lists and dicts
as parameters), and callbacks to methods (all remote method objects are wrapped into
small lambda functions to ease the call for PyQt4).&lt;/p&gt;
&lt;p&gt;If you want to try RPyC to run the PyQt application of your choice, you just
need to follow these steps. Please report your experience here in the blog
comments or on our &lt;a class="reference external" href="https://codespeak.net/mailman/listinfo/pypy-dev"&gt;mailing list&lt;/a&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;ol class="arabic simple"&gt;
&lt;li&gt;Download RPyC from the &lt;a class="reference external" href="https://sourceforge.net/projects/rpyc/files/"&gt;RPyC download page&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Download this &lt;a class="reference external" href="https://codespeak.net/svn/user/xoraxax/rpyc-3.0.7-pyqt4-compat.patch"&gt;patch&lt;/a&gt; and apply it to RPyC by running
&lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;patch&lt;/span&gt; &lt;span class="pre"&gt;-p1&lt;/span&gt; &lt;span class="pre"&gt;&amp;lt;&lt;/span&gt; &lt;span class="pre"&gt;rpyc-3.0.7-pyqt4-compat.patch&lt;/span&gt;&lt;/tt&gt; in the RPyC directory.&lt;/li&gt;
&lt;li&gt;Install RPyc by running &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;python&lt;/span&gt; &lt;span class="pre"&gt;setup.py&lt;/span&gt; &lt;span class="pre"&gt;install&lt;/span&gt;&lt;/tt&gt; as root.&lt;/li&gt;
&lt;li&gt;Run the file &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;rpyc/servers/classic_server.py&lt;/span&gt;&lt;/tt&gt; using CPython.&lt;/li&gt;
&lt;li&gt;Execute your PyQt application on PyPy.&lt;/li&gt;
&lt;/ol&gt;
&lt;/blockquote&gt;
&lt;p&gt;PyPy will automatically connect to CPython and use its PyQt libraries.&lt;/p&gt;
&lt;p&gt;Note that this scheme works with nearly every extension library. Look
at &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;pypy/lib/sip.py&lt;/span&gt;&lt;/tt&gt; on how to add new libraries (you need to create
such a file for every proxied extension module).&lt;/p&gt;
&lt;p&gt;Have fun with PyQt&lt;/p&gt;
&lt;p&gt;Alexander Schremmer&lt;/p&gt;
&lt;/div&gt;</description><category>CPython</category><category>extension modules</category><category>PyQt4</category><category>RPyC</category><guid>https://www.pypy.org/posts/2009/11/using-cpython-extension-modules-with-4951018896657992031.html</guid><pubDate>Mon, 30 Nov 2009 11:19:00 GMT</pubDate></item></channel></rss>