Bespin setup on Windows (Vista)

29 views
Skip to first unread message

JamesDi

unread,
Jun 7, 2009, 2:47:44 PM6/7/09
to Bespin
Hey,

I'm a keen Java and JavaScript developer looking to contribute to
Bespin, but with virtually no python experience I seem to have fallen
at the first hurdle!

I'm trying to setup Bespin on a Windows Vista machine, following the
guidelines in README.txt. The python script seems to download and
install a few packages, then fail when trying to compile the c files
using link.exe with the error 'cannot open file python26.lib'.

Python is installed in C:\python, and bespin is in C:\Users\James
\bespin.

Any ideas? I've included the output below.

Thanks,

James

c:\Users\James\bespin>python bootstrap.py --no-site-packages
New python executable in .\Scripts\python.exe
Installing setuptools................done.
Searching for paver>=1.0a4
Best match: paver 1.0.1
Processing paver-1.0.1-py2.6.egg
paver 1.0.1 is already the active version in easy-install.pth
Installing paver-script.py script to c:\Users\James\bespin\Scripts
Installing paver.exe script to c:\Users\James\bespin\Scripts

Using c:\users\james\bespin\lib\site-packages\paver-1.0.1-py2.6.egg
Processing dependencies for paver>=1.0a4
Finished processing dependencies for paver>=1.0a4
Searching for pip
Best match: pip 0.4
Processing pip-0.4-py2.6.egg
pip 0.4 is already the active version in easy-install.pth
Installing pip-script.py script to c:\Users\James\bespin\Scripts
Installing pip.exe script to c:\Users\James\bespin\Scripts

Using c:\users\james\bespin\lib\site-packages\pip-0.4-py2.6.egg
Processing dependencies for pip
Finished processing dependencies for pip
---> pavement.required
Scripts\pip install -U --install-option="--install-data=backend/python/
installed
-package-data" -r requirements.txt
Downloading/unpacking http://pypi.python.org/packages/source/s/simplejson/simple
json-2.0.9.tar.gz#egg=simplejson (from -r requirements.txt (line 5))
Downloading simplejson-2.0.9.tar.gz (115Kb): 115Kb downloaded
Running setup.py egg_info for package from http://pypi.python.org/packages/sou
rce/s/simplejson/simplejson-2.0.9.tar.gz#egg=simplejson
Unpacking c:\users\james\bespin\ext\paste-1.7.3dev-r7791.tar.gz
Running setup.py egg_info for package from file:///c%7C%5Cusers%5Cjames%5Cbesp
in%5Cext%5Cpaste-1.7.3dev-r7791.tar.gz
Downloading/unpacking http://httplib2.googlecode.com/files/httplib2-0.4.0.tar.gz
(from -r requirements.txt (line 11))
Downloading httplib2-0.4.0.tar.gz
Running setup.py egg_info for package from http://httplib2.googlecode.com/file
s/httplib2-0.4.0.tar.gz
Downloading/unpacking http://pypi.python.org/packages/source/p/path.py/path-2.2.
zip#md5=941660081788282887f652510d80e64e (from -r requirements.txt
(line 12))
Downloading path-2.2.zip
Running setup.py egg_info for package from http://pypi.python.org/packages/sou
rce/p/path.py/path-2.2.zip#md5=941660081788282887f652510d80e64e
Downloading/unpacking virtualenv (from -r requirements.txt (line 10))
Downloading virtualenv-1.3.3.tar.gz (1.0Mb): 1.0Mb downloaded
Running setup.py egg_info for package virtualenv
Downloading/unpacking sqlalchemy-migrate>0.5.1 (from -r
requirements.txt (line 7
))
Could not fetch URL http://trac.erosson.com/migrate (from http://pypi.python.o
rg/simple/sqlalchemy-migrate/): <urlopen error [Errno 11001]
getaddrinfo failed>

Will skip URL http://trac.erosson.com/migrate when looking for
download links
for sqlalchemy-migrate>0.5.1 (from -r requirements.txt (line 7))
Downloading sqlalchemy-migrate-0.5.4.tar.gz (83Kb): 83Kb downloaded
Running setup.py egg_info for package sqlalchemy-migrate
Downloading/unpacking PyCrypto (from -r requirements.txt (line 13))
Running setup.py egg_info for package PyCrypto
Downloading/unpacking urlrelay>0.7 (from -r requirements.txt (line 1))
Running setup.py egg_info for package urlrelay
package init file 'tests\__init__.py' not found (or not a regular
file)
Downloading/unpacking WebTest (from -r requirements.txt (line 3))
Running setup.py egg_info for package WebTest
Downloading/unpacking SQLAlchemy (from -r requirements.txt (line 6))
Running setup.py egg_info for package SQLAlchemy
no previously-included directories found matching 'doc\build
\output'
Downloading/unpacking static (from -r requirements.txt (line 9))
Running setup.py egg_info for package static
Downloading/unpacking nose (from -r requirements.txt (line 4))
Running setup.py egg_info for package nose
no previously-included directories found matching 'doc\.build'
Downloading/unpacking uvc (from -r requirements.txt (line 14))
Running setup.py egg_info for package uvc
Downloading/unpacking WebOb (from -r requirements.txt (line 2))
Running setup.py egg_info for package WebOb
Downloading/unpacking decorator (from sqlalchemy-migrate>0.5.1->-r
requirements.
txt (line 7))
Running setup.py egg_info for package decorator
warning: no previously-included files found matching 'Makefile'
Downloading/unpacking wsgiref (from static->-r requirements.txt (line
9))
Running setup.py egg_info for package wsgiref
Installing collected packages: decorator, httplib2, nose, Paste, path,
PyCrypto,
simplejson, SQLAlchemy, sqlalchemy-migrate, static, urlrelay, uvc,
virtualenv,
WebOb, WebTest, wsgiref
Running setup.py install for virtualenv
Installing virtualenv-script.py script to c:\Users\James\bespin
\Scripts
Installing virtualenv.exe script to c:\Users\James\bespin\Scripts
Running setup.py install for sqlalchemy-migrate
Installing migrate-script.py script to c:\Users\James\bespin
\Scripts
Installing migrate.exe script to c:\Users\James\bespin\Scripts
Installing migrate-repository-script.py script to c:\Users\James
\bespin\Scri
pts
Installing migrate-repository.exe script to c:\Users\James\bespin
\Scripts
Running setup.py install for simplejson
building 'simplejson._speedups' extension
c:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /
nologo /Ox /M
D /W3 /GS- /DNDEBUG -IC:\python\include -Ic:\Users\James\bespin\PC /
Tcsimplejson
/_speedups.c /Fobuild\temp.win32-2.6\Release\simplejson/_speedups.obj
_speedups.c
simplejson/_speedups.c(1834) : warning C4028: formal parameter 1
different f
rom declaration
c:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\link.exe /DLL /
nologo /I
NCREMENTAL:NO /LIBPATH:c:\Users\James\bespin\libs /LIBPATH:c:\Users
\James\bespin
\PCbuild /EXPORT:init_speedups build\temp.win32-2.6\Release\simplejson/
_speedups
.obj /OUT:build\lib.win32-2.6\simplejson\_speedups.pyd /IMPLIB:build
\temp.win32-
2.6\Release\simplejson\_speedups.lib /MANIFESTFILE:build
\temp.win32-2.6\Release\
simplejson\_speedups.pyd.manifest
LINK : fatal error LNK1104: cannot open file 'python26.lib'

***************************************************************************
WARNING: The C extension could not be compiled, speedups are not
enabled.
Failure information, if any, is above.
I'm retrying the build without the C extension now.

***************************************************************************

***************************************************************************
WARNING: The C extension could not be compiled, speedups are not
enabled.
Plain-Python installation succeeded.

***************************************************************************
Running setup.py install for PyCrypto
building 'Crypto.Hash.MD2' extension
c:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\link.exe /DLL /
nologo /I
NCREMENTAL:NO /LIBPATH:c:\Users\James\bespin\libs /LIBPATH:c:\Users
\James\bespin
\PCbuild /EXPORT:initMD2 build\temp.win32-2.6\Release\src/MD2.obj /
OUT:build\lib
.win32-2.6\Crypto\Hash\MD2.pyd /IMPLIB:build\temp.win32-2.6\Release\src
\MD2.lib
/MANIFESTFILE:build\temp.win32-2.6\Release\src\MD2.pyd.manifest
LINK : fatal error LNK1104: cannot open file 'python26.lib'
error: command '"c:\Program Files\Microsoft Visual Studio 9.0\VC
\BIN\link.ex
e"' failed with exit status 1104
Complete output from command c:\Users\James\bespin\Scripts
\python.exe -c "im
port setuptools; __file__='c:\\Users\\James\\bespin\\build\\PyCrypto\
\setup.py';
execfile('c:\\Users\\James\\bespin\\build\\PyCrypto\\setup.py')"
install --sing
le-version-externally-managed --record c:\users\james\appdata\local
\temp\pip-zzm
nab-record\install-record.txt --install-headers c:\Users\James\bespin
\lib\includ
e --install-data=backend/python/installed-package-data:
running install

running build

running build_py

running build_ext

building 'Crypto.Hash.MD2' extension

c:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\link.exe /DLL /
nologo /INCRE
MENTAL:NO /LIBPATH:c:\Users\James\bespin\libs /LIBPATH:c:\Users\James
\bespin\PCb
uild /EXPORT:initMD2 build\temp.win32-2.6\Release\src/MD2.obj /
OUT:build\lib.win
32-2.6\Crypto\Hash\MD2.pyd /IMPLIB:build\temp.win32-2.6\Release\src
\MD2.lib /MAN
IFESTFILE:build\temp.win32-2.6\Release\src\MD2.pyd.manifest

LINK : fatal error LNK1104: cannot open file 'python26.lib'

error: command '"c:\Program Files\Microsoft Visual Studio 9.0\VC\BIN
\link.exe"'
failed with exit status 1104

----------------------------------------
Command c:\Users\James\bespin\Scripts\python.exe -c "import
setuptools; __file__
='c:\\Users\\James\\bespin\\build\\PyCrypto\\setup.py'; execfile('c:\
\Users\\Jam
es\\bespin\\build\\PyCrypto\\setup.py')" install --single-version-
externally-man
aged --record c:\users\james\appdata\local\temp\pip-zzmnab-record
\install-record
.txt --install-headers c:\Users\James\bespin\lib\include --install-
data=backend/
python/installed-package-data failed with error code 1
Storing complete log in ./pip-log.txt


Captured Task Output:
---------------------

---> pavement.required
Scripts\pip install -U --install-option="--install-data=backend/python/
installed
-package-data" -r requirements.txt

Build failed running pavement.required: Subprocess return code: 1

Kevin Dangoor

unread,
Jun 8, 2009, 7:07:59 AM6/8/09
to bes...@googlegroups.com
Hi James,

Welcome! And sorry to hear you're have a bit of trouble getting the
Python running. I've sliced the log output you sent along to the bare
essentials:

On Sun, Jun 7, 2009 at 2:47 PM, JamesDi<james....@gmail.com> wrote:
> running build_ext
>
> building 'Crypto.Hash.MD2' extension
>
> c:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\link.exe /DLL /
> nologo /INCRE
> MENTAL:NO /LIBPATH:c:\Users\James\bespin\libs /LIBPATH:c:\Users\James
> \bespin\PCb
> uild /EXPORT:initMD2 build\temp.win32-2.6\Release\src/MD2.obj /
> OUT:build\lib.win
> 32-2.6\Crypto\Hash\MD2.pyd /IMPLIB:build\temp.win32-2.6\Release\src
> \MD2.lib /MAN
> IFESTFILE:build\temp.win32-2.6\Release\src\MD2.pyd.manifest
>
> LINK : fatal error LNK1104: cannot open file 'python26.lib'
>
> error: command '"c:\Program Files\Microsoft Visual Studio 9.0\VC\BIN
> \link.exe"'
> failed with exit status 1104

The Python server uses the PyCrypto module, which is written in C. It
looks like you already have Microsoft's compiler, so you're a step
ahead of most Windows users in that regard. Looking here:

http://docs.python.org/extending/windows.html#using-dlls-in-practice

that seems to describe the problem you're having. Unfortunately, it
doesn't seem to *help* with the problem you're having, because it
doesn't tell you how to inform setup.py to let Microsoft's linker know
where the python26.lib library is. I discovered this page:

http://www.mehmetalierturk.com/2009/01/10/building-python-modules-on-windows/

where he opted for MinGW (and his example was actually building PyCrypto).

Most directly useful may be this, though:

http://www.voidspace.org.uk/python/modules.shtml#pycrypto

There's a .exe installer for PyCrypto for Python 2.6. That should just work...

Kevin


--
Kevin Dangoor

work: http://labs.mozilla.com/
email: k...@blazingthings.com
blog: http://www.BlueSkyOnMars.com

JamesDi

unread,
Jun 9, 2009, 3:09:03 PM6/9/09
to Bespin
Great response, thank you!

Okay, after a few attempts I managed to get it working, so I figured
I'd document it here for others. I'm not sure whether this is the most
suitable approach, I'd appreciate any feedback you might have!

1) I downloaded and installed the exe installer for PyCrypto (http://
www.voidspace.org.uk/python/modules.shtml#pycrypto)
2) I had to copy the 'Crypto' folder from C:\Python\Lib\site-packages
to <bespin directory>\Lib\site-packages
3) I removed the PyCrypto entry from requirements.txt (in the bespin
root directory)
4) I then ran python bootstrap.py (see README.txt) NOTE: I left off
the --no-site-packages argument here, I'm not sure how important this
is, but since PyCrypto was added to the site-packages folder I figured
I would probably have to exclude it.
5) I added <bespin directory>\Scripts to my PATH (set PATH=%path%;c:
\Users\James\bespin\Scripts)
6) Ran: paver dojo create_db
7) Ran: paver start

I have a few questions re steps 2 and 4:

2) Prior to copying PyCrypto over, I opened the python Command Line
and checked it was working (I created an MD5 hash using Crypto.Hash).
When I ran bootstrap.py for the first time, it failed with the same
error as before (python26.lib cannot be found), hence why I removed
PyCrypto from requirements.txt and copied it over manually. Should it
be checking for dependencies in Python\Lib as well as bespin\Lib? I
wondered why it couldn't find it in Python\Lib (I added it to my
classpath, and it the server wouldn't start until I copied PyCrypto
over).
4) Why does it recommend the --no-site-packages argument in
README.txt? Is it an issue that I removed it?

Also, while running bootstrap.py I noticed the following errors
(related to the same problem but a different package), is this likely
to cause me any issues?

simplejson/_speedups.c(1834) : warning C4028: formal parameter 1
different f
rom declaration
c:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\link.exe /DLL /
nologo /I
NCREMENTAL:NO /LIBPATH:c:\Users\James\bespin\libs /LIBPATH:c:\Users
\James\bespin
\PCbuild /EXPORT:init_speedups build\temp.win32-2.6\Release\simplejson/
_speedups
.obj /OUT:build\lib.win32-2.6\simplejson\_speedups.pyd /IMPLIB:build
\temp.win32-
2.6\Release\simplejson\_speedups.lib /MANIFESTFILE:build
\temp.win32-2.6\Release\
simplejson\_speedups.pyd.manifest
LINK : fatal error LNK1104: cannot open file 'python26.lib'

***************************************************************************
WARNING: The C extension could not be compiled, speedups are not
enabled.
Failure information, if any, is above.
I'm retrying the build without the C extension now.

***************************************************************************

***************************************************************************
WARNING: The C extension could not be compiled, speedups are not
enabled.
Plain-Python installation succeeded.

***************************************************************************
Running setup.py install for Paste
Skipping installation of c:\Users\James\bespin\Lib\site-packages
\paste\__ini
t__.py (namespace package)
Installing c:\Users\James\bespin\Lib\site-packages
\Paste-1.7.3dev_r7791-py2.
6-nspkg.pth

Any thoughts welcome!

Thanks,

James
> http://www.mehmetalierturk.com/2009/01/10/building-python-modules-on-...

Kevin Dangoor

unread,
Jun 9, 2009, 3:57:06 PM6/9/09
to bes...@googlegroups.com
On Tue, Jun 9, 2009 at 3:09 PM, JamesDi<james....@gmail.com> wrote:
> 2) I had to copy the 'Crypto' folder from C:\Python\Lib\site-packages
> to <bespin directory>\Lib\site-packages
> 4) I then ran python bootstrap.py (see README.txt) NOTE: I left off
> the --no-site-packages argument here, I'm not sure how important this
> is, but since PyCrypto was added to the site-packages folder I figured
> I would probably have to exclude it.
> 5) I added <bespin directory>\Scripts to my PATH (set PATH=%path%;c:
> \Users\James\bespin\Scripts)
> 6) Ran: paver dojo create_db
> 7) Ran: paver start
>
> I have a few questions re steps 2 and 4:
>
>  2) Prior to copying PyCrypto over, I opened the python Command Line
> and checked it was working (I created an MD5 hash using Crypto.Hash).
> When I ran bootstrap.py for the first time, it failed with the same
> error as before (python26.lib cannot be found), hence why I removed
> PyCrypto from requirements.txt and copied it over manually. Should it
> be checking for dependencies in Python\Lib as well as bespin\Lib? I
> wondered why it couldn't find it in Python\Lib (I added it to my
> classpath, and it the server wouldn't start until I copied PyCrypto
> over).
>  4) Why does it recommend the --no-site-packages argument in
> README.txt? Is it an issue that I removed it?

I have found in the past that people often have other random versions
of things installed into their Python library directories, and pip
(the installer run by bootstrap.py) will use those, rather than going
to get the proper versions from elsewhere.

Adding --no-site-packages means that it won't look in the system-wide
Python library, which is why you needed to copy PyCrypto over.

> Also, while running bootstrap.py I noticed the following errors
> (related to the same problem but a different package), is this likely
> to cause me any issues?

It shouldn't. Those errors just say that simplejson's C speedups could
not be installed, so you'll be using the "pure Python" version of
simplejson. It works the same way, but is slower. If you manage to get
a C compiler environment going, you wouldn't need to hassle with
PyCrypto and you wouldn't see these simplejson warnings... but there's
no reason to go through that hassle if you can avoid it.

Reply all
Reply to author
Forward
0 new messages