By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,907 Members | 2,039 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,907 IT Pros & Developers. It's quick & easy.

Re: Easy install / setuptools

P: n/a
En Thu, 29 May 2008 06:29:00 -0300, <Do*****************@ch.delarue.com>
escribió:
I'm trying to figure out the "best" way to distribute my own python
packages. Basicly, what I want is to have something like an
"installer.exe" (on windows) which puts my package under
Python/Lib/site-packages (so that it can be found via the PYTHONPATH).

I've played around a bit with "easy install" and "setuptools" and the
.egg format. I've already managed to create a "myPackage.egg" file with
setup tools and "install" (it's just a copying) it ito the site-packages
directory using "easy install".
You don't need setuptools at all. Just write a setup.py file using the
standard distutils module, and execute:

python setup.py bdist_wininst

It will create an executable installer. A simple setup.py script looks
like this:

---begin setup.py---
from distutils.core import setup

setup(name='My Package',
version='1.0',
description='This is the description of myPackage',
packages=['myPackage'],
)
---end setup.py---

Read the "Distributing Python Modules" document in your Python
installation, or at <http://docs.python.org/dist/dist.html>
What I was wondering now is if there's a way to actually EXTRACT the egg
file and put the extracted file (i.e. the .py file) under site-packages.
And not the .egg?
Well... don't use an egg in the first place :)
The problem with egg files is that you can't use
"open(os.path.join(os.path.dirname(__file__),'myFi le')" and I'd need to
rewrite such code which I'd like to avoid if possible. Also, I don't
know whether leaving the python scripts packed inside the egg file is
slower for execution or not...
There are many other problems with egg files... (did I menction that I
hate eggs?)

--
Gabriel Genellina

Jun 27 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Gabriel Genellina wrote:
En Thu, 29 May 2008 06:29:00 -0300, <Do*****************@ch.delarue.com>
escribió:
>I'm trying to figure out the "best" way to distribute my own python
packages.

Well... don't use an egg in the first place :)
"easy install" usually isn't. It tends to do the wrong thing,
then leave things in a confused state. Too many things have to
be set up right before "easy install" works easily.

"python setup.py" is the de-facto standard.

Yes, there's no really good, standard solution for Python
installation.

John Nagle
Jun 27 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.