Scimonster
Scimonster

Reputation: 33399

How to package a web2py app with site-packages

I built a web2py app that i would like to distribute as an EXE. My app requires some external Python packages (numpy, scipy, et. al.). How can i force these to be included when downloading the EXE?

I installed these to web2py's site-packages folder on my computer (pip install -r requirements.txt --target ~/web2py/site-packages/) before packaging, but this folder is empty in the downloaded ZIP.

I'm downloading using Web2py's built-in package feature (admin -> manage -> pack custom -> download EXE).

Upvotes: 0

Views: 591

Answers (1)

Anthony
Anthony

Reputation: 25536

The "Download as .exe" button generates a zip file by retrieving the web2py Windows binary from http://www.web2py.com/examples/static/web2py_win.zip and adding your application folder (as well as a basic routes.py file) to the zip file. The simplest approach to copying the site-packages folder would be to add its contents to the downloaded zip file (using any zip file tool).

Alternatively, you could write your own Python script to mimic the "Download as .exe" feature -- the code for that function is here.

Upvotes: 1

Related Questions