$ pypy manage.py runserver
'import site' failed
Traceback (most recent call last):
File "app_main.py", line 53, in run_toplevel
File "manage.py", line 2, in <module>
from django.core.management import execute_manager
ImportError: No module named django.core
$ pypy
'import site' failed
Python 2.7.1 (b590cf6de419, Apr 30 2011, 02:00:34)
[PyPy 1.5.0-alpha0 with GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
And now for something completely different: ``"3 + 3 = 8" Anto in the JIT
talk''
>>>> import django
>>>> django
<module 'django' from '/usr/share/pyshared/django/__init__.py'>
>>>>
Best to find a PyPy FAQ, mailing list, or IRC channel on which to ask.
Bill
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/fQx3WRQIiHIJ.
> To post to this group, send email to django...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
./pypy
Python 2.7.1 (b590cf6de419, Apr 30 2011, 02:00:34)
[PyPy 1.5.0-alpha0 with GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
And now for something completely different: ``PyPy is an exciting technology
that lets you to write fast, portable, multi-platform interpreters with less
effort''
>>>> from django.core.management import execute_manager
Traceback (most recent call last):
File "<console>", line 1, in <module>
ImportError: No module named django.core
>>>>
One possibility is that you are actually getting a different pypy
executable. Say (on *nix) "which pypy" from one of those other
directories and see if it mentions the correct pypy.
I don't know a lot about pypy per seh, but does running it from
pypy-dist/bin mean that you haven't run setup.py to install it in your
environment?
For python itself, there are a limited number of places it looks for
site.py on startup, which, in turn, builds up sys.path, so that it
knows where to get stuff for imports that aren't relative to the
current directory. Probably pypy is similar. I still think that it's
not installed correctly.
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/8aRQYvpY3lkJ.
/absolute/path/to/pypy-dist/bin/pypy
Error or no?
If no error, how about, while cd'ed to your django
project (where settings.py and manage.py are:
/absolute/path/to/pypy-dist/bin/pypy manage.py shell
Error or no?
If no error, how about (presuming bash or sh):
export PATH=/absolute/path/to/pypy-dist/bin:$PATH
pypy manage.py shell
(or the equivalent for your shell.) You could make this
permanent, if it works and you like it, in ~/.bash_profile .
Or if you don't want to change your PATH environment
variable, you could edit manage.py to begin with:
#!/absolute/path/to/pypy-dist/bin/pypy
Then do:
chmod +x manage.py
And you can then say:
manage.py shell
(or syncdb, runserver, whatever).
Or you can make a shell script called, say, manage, that
cd's to your django project directory, and invokes
manage.py with the appropriate pypy, passing on any
command line arguments that the script got, put the
script somewhere on your path, and you can say:
manage shell
(If you put it somewhere like /usr/local/bin on a multi-user
machine, you may want to choose a better name.)
BTW, I'm not sure, but I don't expect that mod_wsgi would
be willing to run you using pypy.
Bill
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/OY8G3ppuqcgJ.
Try:
$ cd /to/whereever/manage.py/is
$ /home/wsgi/pypy-1.5/bin/pypy
...
>>>> import sys, pprint
>>>> pprint.pprint(sys.path)
Are the directories holding your django install there?
If not, are the directories here pretty much only within (I'm
guessing) /home/wsgi/pypy-1.5/lib ?
That is, the stuff that you've used easy_install or pip install to
install, or python setup.py to
install, may be installed in your python's lib directories, but pypy
may not be falling back to
use those when it doesn't find them in its own lib dirs (I don't know
if it is supposed to). If
this seems to be the problem, you have a number of options available,
including using
pypy to run ez_setup.py to get an easy_install that installs there,
and reinstalling stuff
using that easy_install, or getting packages from pypi and running
their setup.py files by
hand using pypy.
But before you go to far, find one simple package that you have
installed, something
without a lot of dependencies, in your python, that you can't import
from the pypy prompt,
and see what it takes to install that for pypy.
Bill
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/iAijeg2ZUIsJ.
$ /home/wsgi/pypy-1.5/bin/pypyPython 2.7.1 (b590cf6de419, Apr 30 2011, 02:00:34)[PyPy 1.5.0-alpha0 with GCC 4.4.3] on linux2Type "help", "copyright", "credits" or "license" for more information.
And now for something completely different: ``yes, but what't the sense of 0 <"duran duran"''>>>> import sys,pprint>>>> pprint.pprint(sys.path)['','/home/wsgi/pypy-1.5/lib_pypy','/home/wsgi/pypy-1.5/lib-python/modified-2.7','/home/wsgi/pypy-1.5/lib-python/2.7','/home/wsgi/pypy-1.5/lib-python/modified-2.7/lib-tk','/home/wsgi/pypy-1.5/lib-python/2.7/lib-tk','/home/wsgi/pypy-1.5/lib-python/2.7/plat-linux2','/home/wsgi/pypy-1.5/site-packages','/home/wsgi/pypy-1.5/site-packages/PIL']>>>>
/home/wsgi/pypy-1.5/site-packages -> /usr/share/pyshared/
$ export PYTHONPATH=/usr/share/pyshared
$ /home/wsgi/pypy-1.5/bin/pypyPython 2.7.1 (b590cf6de419, Apr 30 2011, 02:00:34)[PyPy 1.5.0-alpha0 with GCC 4.4.3] on linux2Type "help", "copyright", "credits" or "license" for more information.
And now for something completely different: ``to save a tree, eat a beaver''>>>> import pprint, sys>>>> pprint.pprint(sys.path)['','/usr/share/pyshared','/home/wsgi/pypy-1.5/lib_pypy','/home/wsgi/pypy-1.5/lib-python/modified-2.7','/home/wsgi/pypy-1.5/lib-python/2.7','/home/wsgi/pypy-1.5/lib-python/modified-2.7/lib-tk','/home/wsgi/pypy-1.5/lib-python/2.7/lib-tk','/home/wsgi/pypy-1.5/lib-python/2.7/plat-linux2','/home/wsgi/pypy-1.5/site-packages','/home/wsgi/pypy-1.5/site-packages/PIL']>>>>
$ /home/wsgi/pypy-1.5/bin/pypy manage.py shellTraceback (most recent call last):File "app_main.py", line 53, in run_toplevelFile "manage.py", line 2, in <module>from django.core.management import execute_managerImportError: No module named django.core
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/JkpNIjkA3qYJ.
Cheetah/Cheetah-2.4.2.1.egg-info/django/Django-1.2.3.egg-infoflup/flup-1.0.2.egg-info/lsb_release.pymx/PIL/PIL.pthpsycopg2/psycopg2-2.2.1.egg-infoweb/web.py-0.34.egg-info
$ ./pypy
Python 2.7.1 (b590cf6de419, Apr 30 2011, 02:00:34)[PyPy 1.5.0-alpha0 with GCC 4.4.3] on linux2Type "help", "copyright", "credits" or "license" for more information.
And now for something completely different: ``ECOOP is finished''>>>> import web.wsgi>>>> dir (web.wsgi)['__builtins__', '__doc__', '__file__', '__name__', '__package__', '_is_dev_mode', 'http', 'httpserver', 'listget', 'os', 'runfcgi', 'runscgi', 'runwsgi', 'sys', 'validaddr', 'validip', 'web']>>>> import django>>>> dir(django)['VERSION', '__builtins__', '__doc__', '__file__', '__name__', '__package__', '__path__', 'get_version']>>>> import psycopg2
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/home/wsgi/pypy-1.5/site-packages/psycopg2/__init__.py", line 69, in <module>from _psycopg import BINARY, NUMBER, STRING, DATETIME, ROWIDImportError: No module named _psycopg>>>>