473,395 Members | 1,335 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Re: Easy install / setuptools

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
1 1211
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: seberino | last post by:
It appears that apps distributed as Python Eggs are either a single compressed blob in site-packages directory or a directory under site-packages directory. Is this ALWAYS true? So by just...
17
by: Harry George | last post by:
....at least around here. I run a corporate Open Source Software Toolkit, which makes hundreds of libraries and apps available to thousands of technical employees. The rules are that a) a very...
0
by: vedrandekovic | last post by:
Hello, I was download egg file bbfreeze-0.95.2-py2.4-win32.egg ( for windows of course ),and I have setuptools version 0.6c6 after I try install this with setuptools: $ ez_setup...
3
by: commander_coder | last post by:
Hello, I have some materials for a project that I am working on that I keep in a source code control system (svn now, but I'm experimenting with mercurial). I want to install these things from...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.