473,700 Members | 2,565 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Re: Easy install / setuptools

En Thu, 29 May 2008 06:29:00 -0300, <Do************ *****@ch.delaru e.com>
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',
description='Th is is the description of myPackage',
---end setup.py---

Read the "Distributi ng 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.j oin(os.path.dir name(__file__), 'myFile')" 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 1227
Gabriel Genellina wrote:
En Thu, 29 May 2008 06:29:00 -0300, <Do************ *****@ch.delaru e.com>
>I'm trying to figure out the "best" way to distribute my own python

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

John Nagle
Jun 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

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 erasing stuff under site-packages I can do a COMPLETE uninstallation of an Egg? Chris
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 few authorized downloaders obtain tarballs and put them in a depot and b) other users get tarballs from the depot and build from source. Historically, python packages played well in this context. Install was a simple download, untar, setup.py...
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 bbfreeze-0.95.2-py2.4-win32.egg Traceback (most recent call last): File "C:\Python24\Lib\site-packages\ez_setup.py", line 226, in ? main(sys.argv)
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 the repository, but not into site-packages/ as Distutils wants to do. For instance there are some administrative scripts I want to put in ~/ admin/ and some programs that I want in ~/public_html/ . I also want to run some post-install...
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.