top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration

Facebook Login
Site Registration

How to package a private project in python?

+1 vote

What is the best way to distribute a private, pure python, Python 3 project that needs several modules (some available on pypi but some private and used by several separate projects) in order to run?

I'd like to include everything that my project needs to run in a single package. The best way to do this seems to be to be to create symlinks to the source code of the "3rd party" modules I need and create a file that includes them in its "packages" list. Is this what other people do?

But even more ideally, I'd like to package my script and its dependencies in a single zip file that can be executed by python directly. I see several declarations that this is possible online, but I can't find a simple recipe for converting a script and its dependencies into this kind of distribution. Could someone give me a
pointer to a description of "the right way to do it".

I'm making life harder for myself by using python 3 (PyInstaller still only supports Python 2) and by the fact that I can't release some of the necessary code publicly.

posted Dec 16, 2013 by Sumit Pokharna

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

2 Answers

+1 vote

For pure python code its as simple as putting the code in a zip file with a script called Then you can run the zip file with python as if it was a python script.

answer Dec 16, 2013 by Jai Prakash
+1 vote

Well, pyzzer comes to mind (you find it on pypi). It creates an executable zip-archive containing all the stuff that you need (at least the pure python modules).

The problem remains: how to find all the modules and packages that need to be included?

Python's modulefinder can do this for you. If you want to live on the cutting edge you could try the new one that I've written for Python3. It currently lives in

It has several advantages against the standard library's modulefinder; for example it finds and is able to extract the bytecode even from zipped eggs.
For examples how it can be used, you could peek into the module in the same directory, method build_library of class Runtime.

I guess for an experienced developer it takes around one day to take these pieces and build a script that scans a python script, finds all the needed modules and packages, and uses pyzzer to build an executable
archive from it.

answer Dec 17, 2013 by Deepankar Dubey
Similar Questions
+1 vote

I want to install in my Python 3.4 environment on a Centos 5 box. My /usr/local/bin/ contains:


We are behind a proxy server and I tried this:

# /usr/local/bin/easy_install-3.4 

Searching for 
Download error on hostname '  
' doesn't match either of '', '', '',  
'', '', '', '',  
'', '', '', '',  
'', '', '', '' --  
Some packages may not be found! 

Couldn't find index page for '' (maybe misspelled?), Am I best to use pip or easy_install? also if easy_install, how can I fix the above error?

+1 vote

I want to read the combo box in excel by using "xlrd" but in the output it is showing empty message, its not reading the combo box can u guys help me how to read the combo box in excel by "xlrd"

code written like this

workbook = xlrd.open_workbook('path of the file')
worksheet = workbook.sheet_by_name('sheetname')
TargetSystem = worksheet.cell_value(4, 2)
+1 vote

I'm trying to work through Skienna's algorithms handbook, and note that the author often uses graphical representations of the diagrams to help understand (and even debug) the algorithms. I'd like to reproduce this in python.

How would you go about this? pyQt, pygame and pyglet immediately come to mind, but if I go that route the number of people that I can share my work with becomes quite limited, as compared to the portability of javascript projects.

I guess my question really is: has anyone had success creating an interactive graphical project in the browser using python?

0 votes

I'm trying to come up with more project ideas for intermediate learners, somewhat along the lines of .

So here's a question for people who remember coming up from beginner: as you moved from exercises like those in Learn Python the Hard Way, up to your own self-guided work on small projects, what project were you working on that made you feel independent and skilled? What program first felt like your own work rather than an exercise the teacher had assigned?

I don't want anything too large, but big enough that there's room for design, and multiple approaches, etc.

Contact Us
+91 9880187415
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Karnataka INDIA.