entropybit / slaprinter

A combinaton of an app and server for a sla 3d printer
0 stars 2 forks source link

Last: python package installer #13

Open Aslan0 opened 9 years ago

Aslan0 commented 9 years ago

Whoever will download this software later on will thank us for automatically downloading and installing all needed python packages on first use of the printer.

entropybit commented 9 years ago

this can easily be solved by a combination of virtual_env and pip Virtual env is a tool for creating virtual enivornments in which you can install python packages and run your applications without polluting your host system with these packages. And pip is a console tool for downloading + installing the latest python packages (similiar to debian yet the python packages are more up to date).

The normal way is to write a requriements.txt like the one I have begun for the sla_client I will upload one for the sla_printer as well and update the README.md

entropybit commented 9 years ago

As a remark this seems to be more of an problem than initially thought since PyQt can not be installed via pip ... maybe we could build a combination of a pip requirement file and an build script which will download and build PyQt automatically

entropybit commented 9 years ago

PyQt installation done like described here http://stackoverflow.com/questions/19856927/install-sip-pyqt-on-virtualenv I packed this into an script make_env which upon execution creates an virtual environment installs all dependendcies via pip if possible and installs SIP + PyQt as described in above stackoverflow link (you have to scroll a bit down). The only limitations for this are that pip as well as virtualenv hast to be installed. Also the compilation of PyQt can take a while.

If we do the same with the printer software now I believe that this issue can be closed. I've not done this yet since for testing I obviously would like to do this directly on the raspberry pi.

Aslan0 commented 9 years ago

Good. But shouldnt we leave that till the end? We dont actually know which packages we will be using in the end.

entropybit commented 9 years ago

I also thought so but with my last python projects I learned that it is much simpler to do this during the project and incrementally update your requirements.txt This is because if you do not run your project within an virtual environment the only way to find out which packages you have to install and therefore write into the requirements.txt is to iteratively try it out. Although ther is a method of printing all installed packages with pip (pip freeze) this will also output many dependent packages you actually wont have to add to the requirements. So essentially doing this at the end is very very tedious ^^