dependencies - How to make python compatible on all computers? -


i wrote interesting script want share people, won't run on other computers unless have same dependencies installed. how bundle dependencies script package other people don't need install dependencies run script? like, maybe let script reference dependencies in same folder script packaged in.

i want keep open source , share code, don't want use cx_freeze turn exe.

i'd suggest create virtual environment.

 step 1:      >> pip install virtualenv   step 2:      >> cd my_project_folder      >> virtualenv env      note: in case named environment "env"       can call whatever want.   step 3: activate virtual environment      >> source env/bin/activate   step 4: install whatever libraries program needs.        ex. >> pip install flask   step 5: create requirements doc.       >> pip freeze > requirements.txt       note: sure update requirements.txt doc        whenever install new packages. 

when post project on open source forums people can pip install requirements.txt file have same environment had when made it.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -