Publish python project with imported modules
Question: I would like to publish a python project, but i use modules in it like socket.
How do i add to the project code that is not mine? Is that even legal?


Answer: There's no need to add modules that are in the standard library. For other
dependencies, you can

  * test if the module is available (`try: import x except: error()`) and notify the user to install it or even automatically install it
  * [package your program](https://pypi.python.org/pypi) and [have pip install the dependencies for you](https://pip.readthedocs.io/en/stable/user_guide/#requirements-files)
  * use [cx_freeze](https://pypi.python.org/pypi/cx_Freeze) or similar to make a stand-alone package from your program that includes the modules

If you're on Windows, you could package it yourself with the minimal [Embedded
Distribution](https://docs.python.org/3/using/windows.html#embedded-
distribution) (from Python 3.5).

See the [Python wiki on deployment](https://wiki.python.org/moin/deployment)
for further reading.

Observe the licenses of your 3rd party modules.

