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
Post a Comment