Re: a new Linux install solution for Visual Python

pataphor <[email protected]> Sat, 12 Oct 2013 11:11:30 +0200
Newsgroups gmane.comp.python.visualpython.user
Message-ID <[email protected]>
On 10/12/2013 07:37 AM, Bruce Sherwood wrote:
> I did a fresh build from source of VPython 6.05 on Ubuntu 12.04, using
> wxPython 2.9.5. The example programs opacity-test1.py and opacity-test4.py
> run correctly (fully opaque), as expected. The only possible explanation
> has to be the graphics driver, yet this explanation seems to be ruled out
> by the box being opaque with VPython 5.12. ?????

Thank you for testing my script. Since we're now on the public mailing 
list I'll just copy it here for those who are reading:

"""
from visual import *
import itertools

scene.range = 3
scene.background = .5,.5,.5
scene.forward = 1,-1,-1

A,B,C,D,E,F,G,H = itertools.product([-1,1],[-1,1],[-1,1])

data ={(A,B,D,A,D,C) : color.red, (A,C,G,A,G,E) : color.green,
             (A,E,F,A,F,B) : color.blue, (H,G,C,H,C,D) : color.white,
             (H,D,B,H,B,F) : color.yellow, (H,F,E,H,E,G) : color.orange}

for P,C in data.items():
     faces(pos = P, color = C, normal = [1,1,1])

sphere(color = color.yellow, radius = .5, normal = [1,1,1])
"""

On my vPython 6.5 installation this results in the sphere being visible 
even if it is completely inside the colored box.

Another possible explanation, apart from your idea that this could be 
caused by my graphic drivers, is I built it with wxPython 2.9.4.0, with 
the patch that can be found here:

http://sourceforge.net/projects/wxpython/files/wxPython/2.9.4.0/

While you built it with wxPython 2.9.5.0, which doesn't seem to need a 
patch.

So I tried downloading the new version, and built wxPython 2.9.5.0 with 
the command:

sudo python2.7 build-wxpython.py --build_dir=../bld

and this succeeded.

However, when I next tried to install wxPython 2.9.5.0 with the command:

sudo python2.7 build-wxpython.py --build_dir=../bld --install

This fails with a python traceback. (this same command succeeded in the 
corresponding wxPython 2.9.4.0 directory)

After inspecting the relevant parts of the the traceback:

Traceback (most recent call last):
   File "build-wxpython.py", line 378, in <module>
     wxbuild.main(wxscript, build_options)
   File 
"/home/xxxx/src/wxPython-src-2.9.5.0/build/tools/build-wxwidgets.py", 
line 485, in main
     wxBuilder.install(dir=buildDir, options=extra)
   File "/home/xxxx/src/wxPython-src-2.9.5.0/build/tools/builder.py", 
line 134, in install
     args.extend(options)
TypeError: 'NoneType' object is not iterable

and looking this up in the referenced python file build-wxwidgets.py
I see this code around line 485:

     if options.install:
         extra=None
         if installDir:
             extra = ['DESTDIR='+installDir]
         wxBuilder.install(dir=buildDir, options=extra)

it seems that if installDir is false (and the empty string is false in 
python!), extra remains to be None.

This seems to be a bug in wxPython 2.9.5.0, or maybe there is something 
wrong with my system. I tried to get feedback about this on freenode IRC 
in the wxPython channel but there was no one active at that time.

Then I looked up the wxPython user group on gmane. Incidentally, I 
noticed that even though they are using google groups, they still are 
synced to gmane. Maybe this is also a good idea for the vPython user group?

Meanwhile, I have two other options for exploring this possibility, that 
the opacity difference could be caused by different wxPython versions, 
one is to subscribe to the wxPython mailing list/google groups/gmane 
interface and ask about the possible bug in wxPython there, and the 
other is to just look at my list of installed files from 2.9.4.0 and 
copy over the corresponding files from 2.9.5.0 manually.

I'm curious about whether you also had this traceback, and if not, why not?

P.









------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk