How to pack a python program

I am new to python programming. I am writing a simple twitter based command line application and I have to use external libraries like simplejson, tweepy etc. Is there a way I can package my python program to include these libraries, so when I distribute this program, the user does not need to install the necessary libraries first?

thank

+3
source share
1 answer

Python will search for modules in the current directory, so you can just pack the libraries into a subdirectory. For example, if you myprogram.pyuse the package foo:

import foo

that means either

  • a foo.py Python; , myprogram.py,
  • foo Python, __init__.py; (.py , .pyc) , myprogram.py.

, , , .

+4

Source: https://habr.com/ru/post/1758786/


All Articles