0

i'm facing a problem with python , after i created my script , there is some library i download it and i install it in my ubuntu and i used in my script , now if i give the script to client or any other user maybe he don't know what libraries are there and how to install it , i want an idea to create install.py this file should install all libraries that script need it , is it possible ?

also other question , if i use PYQT is there any way to convert all script to one executable file for mac and windows and linux even they did not install QT ??

Thanks advance .

Fahad

Mr.Geeker
  • 395
  • 3
  • 13

1 Answers1

1

This is a simple bash script for unix that will do your job:

per module:

#!/bin/sh
while read p; do
  pip install $p
done < requirements.txt

or you can simple pass:

pip install -r requirements.txt

in requirements.txt, enter the modules name:

django
numpy
lxml
#.... so on

You can then run the bash script ./script.sh

If you want to do the installation of the modules from your python script, you can use setup:

from setuptools import setup

setup(
    # ...
    install_requires=['module']
)
  • thanks , i will try it now , but what about other part of my question ? – Mr.Geeker Nov 09 '13 at 15:39
  • I'm not familiar with PyQT and it's a different question.. I think it's better if you post a new question with a title including PyQT so that SO users familiar with PyQT will answer you. –  Nov 09 '13 at 15:40
  • check this [PyQT link](http://stackoverflow.com/questions/5888870/how-do-i-compile-a-pyqt-script-py-to-a-single-standalone-executable-file-for). –  Nov 09 '13 at 15:45