Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

There's a Python project I want to deploy on a production server which has no internet connection and no compiler. The project is using SQLAlchemy and pip install sqlalchemy requires a compiler to work.

The server is running a Debian stable version. Because Debian is what it is, packages are mainly outdated and using the system package manager is not an option.

I can create a local pip mirror and a build server with the same configuration than the production one (with a compiler). Note that I want to run the code from a virtualenv.
A Python virtualenv inserts absolute paths in files located in virtualenv/bin/ so if I wanted to create the virtualenv on the build server and copy it to the production server, I'd need to modify those files to update paths accordingly (which I try to avoid, even if making the modification is not really a big deal).

How should I package my application ? How the deployment is supposed to work, step by step ?

share|improve this question

closed as not constructive by Michael Hampton, mdpc, Ward, Khaled, Zoredache Jan 29 '13 at 17:50

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

    
If I were in your shoes, I would be extremely tempted to just build a chroot environment that includes everything you need. Then just tar up the chroot, and drop it in a folder on the server, and add a startup script that runs the chroot. –  Zoredache Jan 29 '13 at 17:49
    
This questions is really useful to a lot of people, and you may find your answer at stackoverflow.com/a/13754897/565999 –  Hugo Tavares Jan 29 '13 at 23:44

1 Answer 1

If virtualenv is the tool you want, you could check using the --relocatable option, though it may not work unless the two machines are mostly identical, possibly down to the dot version of Python:

virtualenv --relocatable ENV
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.