Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pip with fake computer architecture (64 bit instead 32 bit)

I host a Django website on a server where I have only FTP access. The server has a 64 bit architecture, my computer has a 32 bit architecture. For some modules, like MySQL-python, the architecture matters.

Is there a way to build a site-packages directory from my requirements.txt on my personal computer which is suitable for the server? I think it would be necessary to somehow fake the architecture for pip.

And ... Yes. I have access to some 64 bit machines. But for a good workflow it would better to have everything on my personal computer.

like image 387
Philipp Zedler Avatar asked Jan 11 '23 15:01

Philipp Zedler


1 Answers

Do local development in a VM

Use virtualbox and make your guest OS be 64-bit.

You can still edit locally (through sharing folders), but deploy to the virtual machine that matches the architecture. This will save you much pain down the road.

The biggest reason for doing this is that many of the libraries have to be compiled for the architecture. Pure python won't be a problem.

Use virtualenv on the remote host

Additionally, when you install the packages and deploy your code, you should use a virtual environment instead of site-packages. Any admin on the box can nuke your glorious site-packages away with system updates. We don't want that!

like image 143
Kyle Kelley Avatar answered Jan 17 '23 09:01

Kyle Kelley