473,549 Members | 2,719 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PyOpenGL without SetupTools

Hi,
I am distributing a package with a precompiled collection of modules
and packages useful for Python based medical/biological/astronomical
image analysis and algorithm development. (Codename: Priithon).
For Priithon I put all modules/packages in a simple / single directory
(tree) including one starting batch/script file. This script sets up
PYTHONPATH to find modules at this place.
It works fine for Windows,Linux and Mac-OSX.

Now I want to upgrade everything to Python 2.5 and thought it might
be time get PyOpengl version 3 (aka. pyOpengl-ctypes).

The problem at hand is now that PyOpenGL uses "all this setup-tools
machinery" just to initialize the formathandlers for the different
ways to deal with arrays. (I really need only numpy support !)
This is done via the pkg_resources mechanism called "entry_poin ts".

Can I include a simple non-system-install of pkg_resources that makes
at least the entry_point stuff work ? Where do I put pyOpenGL's
"entry_points.t xt" file ?

Thanks,
Sebastian Haase
MDC Berlin

Oct 1 '07 #1
2 2229
On Oct 1, 4:04 am, seb.ha...@gmail .com wrote:
Hi,
I am distributing a package with a precompiled collection of modules
and packages useful for Python based medical/biological/astronomical
image analysis and algorithm development. (Codename: Priithon).
For Priithon I put all modules/packages in a simple / single directory
(tree) including one starting batch/script file. This script sets up
PYTHONPATH to find modules at this place.
It works fine for Windows,Linux and Mac-OSX.

Now I want to upgrade everything to Python 2.5 and thought it might
be time get PyOpengl version 3 (aka. pyOpengl-ctypes).

The problem at hand is now that PyOpenGL uses "all this setup-tools
machinery" just to initialize the formathandlers for the different
ways to deal with arrays. (I really need only numpy support !)
This is done via the pkg_resources mechanism called "entry_poin ts".

Can I include a simple non-system-install of pkg_resources that makes
at least the entry_point stuff work ? Where do I put pyOpenGL's
"entry_points.t xt" file ?

The simple answer is "don't bother with PyOpenGL-ctypes if you don't
have to". Besides the hassles with binary packaging, it's quite a bit
slower then PyOpenGL 2.0.

Anyways, when I saw that I couldn't easily figure out how to register
a setuptools package by hand (the point you seem to be at now), I
resorted to using the same hack that setuptools uses to register its
packages. Setuptools puts a pth file, something like
"ezsetup_XXXX.p th", in the site-packages directory. The file has a
couple lines of Python code that mark the start and end of the eggs on
sys.path; then they call setuptools to postprocess and register the
eggs.

What I did was to duplicate the effect of these lines in my main
script. I don't have it in front of me, but it was something along
these lines:

sys.__eggindex = len(sys.path)
sys.path.append ("OpenGL-cytpes-3.0.0a7-whatever.egg")
setuptools.regi ster_packages()

I copied the OpenGL egg to my distro directory, and it worked.

Another possibility is to do it the "setuptools " way: by not packaging
PyOpenGL 3.0 at all, and instead marking it as a dependency. Then,
setuptools will helpfully download it for the user. (Personally, I
hate that scripts can recklessly download and install stuff into your
site packages without even asking; seems like a possible security hole
as well.) But it's an option.

Carl Banks

Oct 1 '07 #2


Are there PyOpenGL 2.0 (I guess 2.0.1.09 is goood) binaries available
for Python 2.5 ? Anywhere ?

Thanks for the reply

-Sebastian Haase

On Oct 1, 11:49 am, Carl Banks <pavlovevide... @gmail.comwrote :
On Oct 1, 4:04 am, seb.ha...@gmail .com wrote:
Hi,
I am distributing a package with a precompiled collection of modules
and packages useful for Python based medical/biological/astronomical
image analysis and algorithm development. (Codename: Priithon).
For Priithon I put all modules/packages in a simple / single directory
(tree) including one starting batch/script file. This script sets up
PYTHONPATH to find modules at this place.
It works fine for Windows,Linux and Mac-OSX.
Now I want to upgrade everything to Python 2.5 and thought it might
be time get PyOpengl version 3 (aka. pyOpengl-ctypes).
The problem at hand is now that PyOpenGL uses "all this setup-tools
machinery" just to initialize the formathandlers for the different
ways to deal with arrays. (I really need only numpy support !)
This is done via the pkg_resources mechanism called "entry_poin ts".
Can I include a simple non-system-install of pkg_resources that makes
at least the entry_point stuff work ? Where do I put pyOpenGL's
"entry_points.t xt" file ?

The simple answer is "don't bother with PyOpenGL-ctypes if you don't
have to". Besides the hassles with binary packaging, it's quite a bit
slower then PyOpenGL 2.0.

Anyways, when I saw that I couldn't easily figure out how to register
a setuptools package by hand (the point you seem to be at now), I
resorted to using the same hack that setuptools uses to register its
packages. Setuptools puts a pth file, something like
"ezsetup_XXXX.p th", in the site-packages directory. The file has a
couple lines of Python code that mark the start and end of the eggs on
sys.path; then they call setuptools to postprocess and register the
eggs.

What I did was to duplicate the effect of these lines in my main
script. I don't have it in front of me, but it was something along
these lines:

sys.__eggindex = len(sys.path)
sys.path.append ("OpenGL-cytpes-3.0.0a7-whatever.egg")
setuptools.regi ster_packages()

I copied the OpenGL egg to my distro directory, and it worked.

Another possibility is to do it the "setuptools " way: by not packaging
PyOpenGL 3.0 at all, and instead marking it as a dependency. Then,
setuptools will helpfully download it for the user. (Personally, I
hate that scripts can recklessly download and install stuff into your
site packages without even asking; seems like a possible security hole
as well.) But it's an option.

Carl Banks

Oct 1 '07 #3

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

Similar topics

2
4047
by: Erik Max Francis | last post by:
I was interesting in adding selection and hit testing to ZOE, and was looking at the PyOpenGL wrappers' handling of selection and picking. I see glSelectBuffer to specify the size of the buffer, and glRenderMode properly returns the number of hits when put back into GL_RENDER mode, but I don't see any way within PyOpenGL itself to access the...
1
1426
by: Ilias Lazaridis | last post by:
If I understood things right, setuptools extends the functionality of distutils Thus replacing within a setup.py: from distutils.core import setup with try:
5
1758
by: Sébastien Ramage | last post by:
Bonjour à tous, Dans la folie j'ai installé le nouveau python, impatient de voir les nouveautés mais je pense que j'ai été un peu rapide car j'ai voulu utiliser pyOpenGL et là problème il n'existe pas pour python 2.5 ?!!! de plus il semble que pyopengl est été abandonné depuis 2005 ? plus rien ne bouge sur le site... je suis sous...
0
1442
by: sweetmelon | last post by:
(I'm a newbie in Python and pyOpenGL.) Environment: WinXP SP2 Python ver. 2.5 WingIDE easy_install is installed PIL, pyNum is installed Download PyOpenGL-3.0.0a5-py2.5.egg run: easy_install PyOpenGL-3.0.0a5-py2.5.egg pyOpenGL is installed in
0
1424
by: Calvin Spealman | last post by:
I am trying to install the newest setuptools on my macbook. 2.3 was installed by default, and 2.4 is installed and is my default version now. However, when I try to import setuptools, which is required to _install_ setuptools, I get this error: macbkpro1:~/Desktop/setuptools-0.6c7 ironfroggy$ python setup.py install Traceback (most recent...
7
2305
by: Thorsten Kampe | last post by:
Date: Fri, 23 Nov 2007 19:35:21 -0000 Message-ID: <MPG.21b13bd5fda74bd3989729@news.individual.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit User-Agent: MicroPlanet-Gravity/2.70.2067 Hi, can anyone give me a short code snippet how to install a missing
0
1499
by: =?ISO-8859-1?Q?S=E9bastien_Ramage?= | last post by:
Hi ! How can I make an exe that use the new pyopengl 3.0.0b1 ??? I use py2exe 0.6.6 with the 3.0.0a6 version I have make it working by copying the egg and by forcing loading it at the start of the app but it doesn't work with this version
4
3369
by: Alia Khouri | last post by:
Can we open up the discussion here about how to improve setuptools which has become the de facto standard for distributing / installing python software. I've been playing around with ruby's gems which seems to be more more mature and usable. From my perspective, the relative immaturity of setuptools and its simultaneous widespread use is a...
0
1045
by: Colin J. Williams | last post by:
I have just installed PyOpenGL and get a series of warning messages: Best match: PyOpenGL 3.0.0b3 Downloading http://downloads.sourceforge.net/pyopengl/PyOpenGL-3.0.0b3.zip?modtime=1213363873&big_mirror=0 Processing PyOpenGL-3.0.0b3.zip Running PyOpenGL-3.0.0b3\setup.py -q bdist_egg --dist-dir...
0
7520
marktang
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...
0
7450
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...
0
7957
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7809
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 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...
0
6043
agi2029
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...
1
5368
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5088
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3481
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1059
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.