bernardo.g
bernardo.g

Reputation: 758

How do I install web2py in a virtualenv in Windows 7?

I'm new to Python and I'm trying to install web2py in a virtualenv. I'm running a 32 bit python 2.7.3 installation on a 64 bit Windows 7.

From what I read, this should be the process:

First and foremost: is that right? If so, then...

I tried installing pywin32 through

'''easy_install pywin32-218.win32-py2.7.exe'''

It went fine. Then, I checked the virtual environment's site-packages for a pywin32 folder and it was there, but I couldn't import it into python ('''ther's no module pywin32'''). The environment was definitely active (I double-checked).

As a test, without using virtualenv, I double-click-installed the pywin32 binary (downloaded the 32 bit version for python 2.7 -- pywin32-218.win32-py2.7.exe) but got an error at the end:

'''close failed in file object destructor:

sys.excepthook is missing

lost sys.stderr'''

I downloaded the file again (could be corrupted), tried installing it again but got the same result.

Could anybody guide me or point me to a step-by-step install of pywin32 (if necessary) and then web2py for windows 7? I'd really appreciate it.

Upvotes: 4

Views: 944

Answers (2)

ldfa
ldfa

Reputation: 28

In my experience, the command easy_install pywin32-218.win32-py2.7.exe under an active virtualenv works fine.

To test the installation of pywin32, from python you can try:

from win32api import GetVersionEx
print GetVersionEx()

Obtaining something similar to (windows major version, minor version, build number, platform id, additional informations):

(6, 1, 7601, 2, 'Service Pack 1')

You cannot import module pywin32 because it doesn't exist.

After the installation of pywin32, you can install web2py under the active virtualenv (I tested it until to opening the admin interface, no guarantee after this :-):

  • download the source code from http://www.web2py.com/init/default/download
  • unzip it to ...\virtualenvdir\Lib\site-packages\ (obtaining: ...\virtualenvdir\Lib\site-packages\web2py\...)
  • cd to ...\virtualenvdir\Lib\site-packages\web2py
  • start the web2py server: python web2py.py

At the date, I couldn't install web2py using pip. First of all, it grabs an old version of web2py from PyPy. When I tryed to use this version of web2py I got an error ImportError: No module named .... The same using pip on a copy of the web2py source file.

Upvotes: 0

Related Questions