For some reason I had assumed that pypy could be a drop in replacement for python. I am on Debian Unstable and I am suspected that my assumption is being thwarted. In particular in trying to run SCons. |> python /home/Checkouts/Mercurial/SCons/bootstrap/src/script/scons.py scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... stopServerIfNeedBe(["allPDFs"], []) scons: done building targets. |> pypy /home/Checkouts/Mercurial/SCons/bootstrap/src/script/scons.py Traceback (most recent call last): File "app_main.py", line 51, in run_toplevel File "/home/Checkouts/Mercurial/SCons/bootstrap/src/script/scons.py", line 187, in <module> import SCons.Script ImportError: No module named SCons This may be a SCons problem or a Debian Python packaging issue but higher likelihood is a PyPy configuration issue? Basically I am not sure where to start. I use SCons from a Mercurial clone, Python from Debian packages, PyPy from then downloaded binary distribution. |> python --version Python 2.7.2+ |> pypy --version Python 2.7.1 (7773f8fc4223, Nov 18 2011, 18:47:11) [PyPy 1.7.0 with GCC 4.4.3] Help and guidance greatfully received. Thanks. -- Russel. ============================================================================= Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder@ekiga.net 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel@russel.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
On Wed, Feb 8, 2012 at 7:40 PM, Russel Winder <russel@russel.org.uk> wrote:
For some reason I had assumed that pypy could be a drop in replacement for python. I am on Debian Unstable and I am suspected that my assumption is being thwarted. In particular in trying to run SCons.
|> python /home/Checkouts/Mercurial/SCons/bootstrap/src/script/scons.py scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... stopServerIfNeedBe(["allPDFs"], []) scons: done building targets.
|> pypy /home/Checkouts/Mercurial/SCons/bootstrap/src/script/scons.py Traceback (most recent call last): File "app_main.py", line 51, in run_toplevel File "/home/Checkouts/Mercurial/SCons/bootstrap/src/script/scons.py", line 187, in <module> import SCons.Script ImportError: No module named SCons
This may be a SCons problem or a Debian Python packaging issue but higher likelihood is a PyPy configuration issue? Basically I am not sure where to start.
I use SCons from a Mercurial clone, Python from Debian packages, PyPy from then downloaded binary distribution.
|> python --version Python 2.7.2+
|> pypy --version Python 2.7.1 (7773f8fc4223, Nov 18 2011, 18:47:11) [PyPy 1.7.0 with GCC 4.4.3]
Help and guidance greatfully received. Thanks. -- Russel. ============================================================================= Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder@ekiga.net 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel@russel.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
_______________________________________________ pypy-dev mailing list pypy-dev@python.org http://mail.python.org/mailman/listinfo/pypy-dev
Hey PyPy does not automatically pick up python packages installed for the system python. The same would actually be true for CPython if you installed it from sources. I suggest using virtualenv and creating one with pypy as an executable and then installing stuff using pip or easy_install. Cheers, fijal
Maciej, Armin, A combined response... On Wed, 2012-02-08 at 19:51 +0200, Maciej Fijalkowski wrote:
PyPy does not automatically pick up python packages installed for the system python. The same would actually be true for CPython if you installed it from sources. I suggest using virtualenv and creating one with pypy as an executable and then installing stuff using pip or easy_install.
On Wed, 2012-02-08 at 18:57 +0100, Armin Rigo wrote: Hi Russel,
On Wed, Feb 8, 2012 at 18:40, Russel Winder <russel@russel.org.uk>
wrote:
ImportError: No module named SCons
You need to install SCons for this PyPy. That's just the same as installing it manually for the particular version of CPython you're testing: you get its sources and run "pypy setup.py install". The difference is that SCons is also available as a package in your Linux distribution; this package is for CPython 2.7 --- a particular version of CPython. The Debian package of SCons would not work with a different version of CPython, nor with PyPy.
I understand the points being made above, and I really appreciate the speedy replies, thanks to you both. However, due to my bad explanation I suspect, I think we may be at cross purposes. I do indeed have the Debian SCons package installed, but as far as I know I am not actually making use of any of it -- but this is more an hypothesis than any actual fact. If I was installing SCons then clearly it would need installing separately for CPython and PyPy as each Python installation maintains its own package set (*). However I am running SCons directly from a Mercurial repository, using the boostrap.py code which manipulates paths and spawns a subprocess to ensure the subprocess has the right "environment". What I should perhaps have said more explicitly is that my problem is that python executes this script and everything works whereas pypy doesn't execute the script in the same way. The script in question is: https://bitbucket.org/scons/scons/src/cdc0f05249c6/bootstrap.py I don't immediately see why PyPy would behave different executing this script that the CPython 2.7.2 that works fine. I am increasingly of the view that I am looking but not seeing... (*) Though I do like the Debian solution of depositing things in a shared location and then appearing to install them for each installed Python. -- Russel. ============================================================================= Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder@ekiga.net 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel@russel.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
On Wed, 2012-02-08 at 18:24 +0000, Russel Winder wrote: [...]
whereas pypy doesn't execute the script in the same way. The script in question is:
https://bitbucket.org/scons/scons/src/cdc0f05249c6/bootstrap.py
I don't immediately see why PyPy would behave different executing this script that the CPython 2.7.2 that works fine. I am increasingly of the view that I am looking but not seeing...
Aha... that is the point, that script is behaving exactly the same in both cases, I was using the wrong command line. |> python /home/Checkouts/Mercurial/SCons/bootstrap.py /usr/bin/python /home/Checkouts/Mercurial/SCons/bootstrap/src/script/scons.py scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... stopServerIfNeedBe(["allPDFs"], []) scons: done building targets. |> pypy /home/Checkouts/Mercurial/SCons/bootstrap.py /home/users/russel/bin.Linux.x86_64/pypy /home/Checkouts/Mercurial/SCons/bootstrap/src/script/scons.py scons: Reading SConscript files ... ImportError: No module named uno: File "/home/users/russel/Work/Courses/Groovy_OneDayWorkshop/SConstruct", line 21: import odfConverterServer File "/home/users/russel/lib/Python/lib/python2.7/odfConverterServer.py", line 27: from PyODFConverter import DEFAULT_OPENOFFICE_PORT , DocumentConverter , DocumentConversionException File "/home/users/russel/lib/Python/lib/python2.7/PyODFConverter.py", line 40: from uno import getComponentContext , systemPathToFileUrl Now that makes much more sense. Now I just need to get some packages into the PyPy tree that are not there yet. Maciej, Armin, thanks for indirectly pointing me in the right direction. -- Russel. ============================================================================= Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder@ekiga.net 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel@russel.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
On Wed, 2012-02-08 at 18:32 +0000, Russel Winder wrote: [...]
|> pypy /home/Checkouts/Mercurial/SCons/bootstrap.py /home/users/russel/bin.Linux.x86_64/pypy /home/Checkouts/Mercurial/SCons/bootstrap/src/script/scons.py scons: Reading SConscript files ... ImportError: No module named uno: [...]
Is there any chance of getting PyPy back in the Debian distribution? If it can get in with CPython then all modules such as uno would just appear in the PyPy tree as part of installation via the Debian packaging system. Thanks. -- Russel. ============================================================================= Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder@ekiga.net 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel@winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
On Wed, Mar 7, 2012 at 11:16 AM, Russel Winder <russel@winder.org.uk> wrote:
On Wed, 2012-02-08 at 18:32 +0000, Russel Winder wrote: [...]
|> pypy /home/Checkouts/Mercurial/SCons/bootstrap.py /home/users/russel/bin.Linux.x86_64/pypy /home/Checkouts/Mercurial/SCons/bootstrap/src/script/scons.py scons: Reading SConscript files ... ImportError: No module named uno: [...]
Is there any chance of getting PyPy back in the Debian distribution? If it can get in with CPython then all modules such as uno would just appear in the PyPy tree as part of installation via the Debian packaging system.
PyPy is in debian (experimental I think), but it will *not* automatically pick up whatever is installed on CPython, having separate package directories. Cheers, fijal
On Wed, 2012-03-07 at 11:27 -0800, Maciej Fijalkowski wrote: [...]
PyPy is in debian (experimental I think), but it will *not* automatically pick up whatever is installed on CPython, having separate package directories.
I'll see if I can install from there. When you install a shared package such as python-uno, the install checks for all installed Pythons and does an install for each -- so it gets installed for Python 2.6 and Python 2.7 for me. Also some will install for Python 3.2 as well. So you are right in saying that a PyPy execution will not automatically search for stuff in the CPython trees, but what I am saying is that shared package sources get multiply installed, once to each appropriate tree. -- Russel. ============================================================================= Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder@ekiga.net 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel@winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
On Wed, 2012-03-07 at 20:42 +0000, Russel Winder wrote: [...]
I'll see if I can install from there.
pypy packages install find from experimental. Sadly the python-uno package assumes it is only going to install for CPython 2.7 :-(((( I'll tinker more and see what I can do. Now to start the campaign to get PyPy moved from experimental to unstable... -- Russel. ============================================================================= Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder@ekiga.net 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel@winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
Hi Russel, On Wed, Feb 8, 2012 at 18:40, Russel Winder <russel@russel.org.uk> wrote:
ImportError: No module named SCons
You need to install SCons for this PyPy. That's just the same as installing it manually for the particular version of CPython you're testing: you get its sources and run "pypy setup.py install". The difference is that SCons is also available as a package in your Linux distribution; this package is for CPython 2.7 --- a particular version of CPython. The Debian package of SCons would not work with a different version of CPython, nor with PyPy. A bientôt, Armin.
participants (4)
-
Armin Rigo
-
Maciej Fijalkowski
-
Russel Winder
-
Russel Winder