python 3.4

828 views
Skip to first unread message

Poul Riis

unread,
Apr 29, 2014, 7:07:41 AM4/29/14
to vpytho...@googlegroups.com
With a new harddisk on my computer I have to reinstall everything. Of course, one takes the most recent version of programs, so I chose Python3.4. But there does not seem to be a VPython module for Python 3.4. Will I have to install the older Python 3.2?

Poul Riis

Bruce Sherwood

unread,
Apr 29, 2014, 11:46:54 AM4/29/14
to vpytho...@googlegroups.com
Yes.

The situation is that we're waiting for an official release of a version of wxPython that runs on Python 3.x. Once that becomes available we'll resume our intent to keep abreast of new releases of Python.


On Tue, Apr 29, 2014 at 5:07 AM, Poul Riis <pri...@gmail.com> wrote:
With a new harddisk on my computer I have to reinstall everything. Of course, one takes the most recent version of programs, so I chose Python3.4. But there does not seem to be a VPython module for Python 3.4. Will I have to install the older Python 3.2?

Poul Riis

--
You received this message because you are subscribed to the Google Groups "VPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vpython-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Poul Riis

unread,
Oct 31, 2014, 3:52:43 AM10/31/14
to vpytho...@googlegroups.com
Will the mentioned official release of a Python 3.x version of wxPython ever come? Is anybody at all working on it?

Poul Riis

Bruce Sherwood

unread,
Oct 31, 2014, 10:37:18 AM10/31/14
to vpytho...@googlegroups.com
Ask the wxPython people. It's out of our control.

Poul Riis

unread,
Nov 19, 2014, 3:17:03 PM11/19/14
to vpytho...@googlegroups.com
I hope that a more prominent person will ask...

By the way, is Phoenix the Python3 version of wxpython? If yes, I would appreciate some hints as to how to install it under Windows.

Poul Riis

Bruce Sherwood

unread,
Nov 19, 2014, 4:43:22 PM11/19/14
to vpytho...@googlegroups.com

Yes, it is called Phoenix. Again, ask the wxPython people for help with wxPython.

--

Poul Riis

unread,
Nov 22, 2014, 12:41:49 PM11/22/14
to vpytho...@googlegroups.com
It seems that Phoenix can be installed with Python 3.3 and 3.4. Is there a VPython version for Python 3.4?

Poul Riis

Bruce Sherwood

unread,
Nov 22, 2014, 2:07:47 PM11/22/14
to vpytho...@googlegroups.com
No, there isn't a VPython version for Python 3.x. We're still waiting for a wxPython-Phoenix release; it appears that it is still the case that there has not been a formal release, only developmental "nightly builds", which we're reluctant to use.

I agree that it is desirable to have VPython work with Python 3, but could you say why you need Python 3?

Poul Riis

unread,
Jan 24, 2015, 2:19:43 PM1/24/15
to vpytho...@googlegroups.com
Now that wx (Phoenix) seems to work with Python 3.4, will there soon be a VPython 6 version available for Python 3.4?

You ask why I need Python 3. One simple reason is that it is a strange feeling to start a VPython course for students by asking them to install either an old version of Python or an old version of VPython.



Poul Riis

Bruce Sherwood

unread,
Jan 24, 2015, 4:17:50 PM1/24/15
to vpytho...@googlegroups.com
I'm confused by the wxPython situation. Perhaps you can enlighten me, Poul. If I go to


which claims to be the documentation for Phoenix, and I click on the link in

"You can download the Prebuild binary of wxPython which includes the source code for wxPython",

then I'm taken to the page for downloading the Python 2 version of wxPython.

I do find downloads at http://wxpython.org/Phoenix/snapshot-builds/ but all of them continue to bear the label "dev" which strongly implies that there still isn't a real release. It's unsettling that even the main site, wxpython.org makes no mention whatsoever of Phoenix. As a result, I continue to feel that it would be unwise to work on a Phoenix-based version of VPython and a serious distraction for the few of us already struggling to deal with many different flavors of Python environments.

Python 2.7 isn't really "old". It continues to undergo not just bug fixes but upgrades, such as the fact that the Python 2.7.9 version includes pip, which is a new addition for Python 2.7. I have the impression that there are still cases of significant Python modules that are not available for Python 3. 

The statement "from __future__ import division, print_function" takes care of the by far most important aspects of Python 3, especially for student programming.

However, if you feel that it is truly vitally important to use Python 3, you are of course free to build for Python 3 yourself. All of the code is open source.

Poul Riis

unread,
Jan 29, 2015, 4:21:10 AM1/29/15
to vpytho...@googlegroups.com
From python.org:
"Python 3.0 was released in 2008. The final 2.x version 2.7 release came out in mid-2010, with a statement of extended support for this end-of-life release. The 2.x branch will see no new major releases after that. 3.x is under active development and has already seen over five years of stable releases, including version 3.3 in 2012 and 3.4 in 2014. This means that all recent standard library improvements, for example, are only available by default in Python 3.x."

To me, that speaks for itself.


And here you'll find the phoenix installation files:

Poul Riis

Bruce Sherwood

unread,
Jan 29, 2015, 9:47:32 AM1/29/15
to vpytho...@googlegroups.com
Nothing you've said contradicts what I said, Poul.

Why are there only nightly builds of wxPython? Why is there no mention of these files at wxpython.org? Why does even the Phoenix documentation send me to the Python 2.7 downloads? Why is there no wxPython for Python 3 available at the major Windows module repository, http://www.lfd.uci.edu/~gohlke/pythonlibs/?

Nor do I know how to interpret "The final 2.x version 2.7 release came out in mid-2010, with a statement of extended support for this end-of-life release" since as I said 2.7.9 just recently became available and includes for the first time the important module pip.

Kevin Karplus

unread,
Jan 29, 2015, 10:56:13 AM1/29/15
to vpytho...@googlegroups.com
There are two philosophies among developers: those who want the latest and greatest, and those who want the most stable.  For many, the freezing of python 2.7 meant that it was now a stable language that one could count on behaving the same from now on (other than very minor bug fixes), and not have to rewrite code every time a language developer thought of a "better" way to do things.  The "end-of-life" release was seen more as the "beginning-of-stability" release.

Python 3 is beginning to stabilize after years of rapid development, but there is still the possibility of incompatible changes that would require painful updates to working code—so some developers still shy away from it.

Many (most?) developers try to work in the subset of Python 2.7 and 3.4 that is shared, so that they don't have to worry about which language their users prefer.


--
You received this message because you are subscribed to the Google Groups "VPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vpython-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Kevin Karplus   kar...@soe.ucsc.edu    http://www.soe.ucsc.edu/~karplus
Professor of Biomolecular Engineering, University of California, Santa Cruz
Program Chair and Undergraduate Director, Bioengineering
Vice Chair, Biomolecular Engineering Dept.
Undergraduate Director, Bioinformatics
Affiliations for identification only.

Mark Wilde

unread,
Feb 1, 2015, 7:27:25 PM2/1/15
to vpytho...@googlegroups.com
I would like to express my agreement with Poul here. I am teaching a course on computational physics this semester from the book Computational Physics by Mark Newman. Students are learning Python for the first time, and in fact, I am as well, having programmed in many other languages before yet desiring to learn what's interesting about Python. As part of Newman's book, he devotes some discussion to VPython because of its advanced 3D plotting capabilities. Being completely new to Python, I figured the best option would be to use the latest stable version of Python, which is 3.4. However, I was rather dismayed to learn that VPython does not keep up to date with the latest version of Python. I've lost hours googling, trying to figure out if there would be some alternative, only to see that I would have to use the older Python 2.7 or to read this suggestion in the forum to build everything myself. As all of this appears rather complicated / seems strange, I will be seeking out alternatives or might return to vpython after it is synchronized with Python 3.4. It would be great if things could stay synchronized but I understand that these kinds of things can be difficult when a project is open source and communities are relying on each other for updates and progress.

Bruce Sherwood

unread,
Feb 1, 2015, 10:56:43 PM2/1/15
to vpytho...@googlegroups.com
As I said, "I agree that it is desirable to have VPython work with Python 3, but could you say why you need Python 3?" You've given an answer, but in fact it is not the case that 3.4 is the "latest stable version of Python". It may be the most advanced by some measures, but 2.7.9 is also very recent and very stable and unlikely to be lacking anything you need even in an upper-level computational physics course. Probably the only significant issue is to make sure one puts the following at the start of every program, to make the programs compatible with both Python 2 and Python 3:

from __future__ import division, print_function

I'll say this more strongly: I don't know of anything in Python 3 that would be needed in an upper-level computational physics course that isn't available in Python 2. That being the situation, and no one has shown this to be false, it is no more unreasonable for there not to be a VPython for Python 3 than it is for there to be a stand that only Python 3 is acceptable.

As another comment on the current situation, I'll point out that the server component of Google App Engine can be written in various languages, including Python, and it is Python 2.7 -- one cannot use Python 3. Etc. So while it would be nice to have a VPython that runs on Python 3, it's just not the case that Python 2.7 is somehow to be shunned. Even Google hasn't made the switch, and Google has a lot more resources than Steve Spicklemire and I command, and Steve moreover is under the pressure of an unusually heavy teaching load this semester. If it's a really important problem, someone should step forward and deal with it. If no one else is willing to suffer through whatever problems there may be in working with an unreleased wxPython, so be it.

I do appreciate your statement of understanding of the difficulties. We're between rocks and hard places. We were forced to make rather drastic changes to go from VPython 5 to VPython 6 because Apple ended support for the Carbon framework that VPython depended on, and there was no way to make the VPython 5 architecture compatible with the Cocoa framework. And that wasn't even an issue of open source. The best environment available at the time (fully two years ago) seemed to be wxPython, and at the time we chose it  there was already a proof of concept of operating with Python 3, but unfortunately no release has occurred.

Bruce Sherwood

unread,
Feb 1, 2015, 11:11:02 PM2/1/15
to vpytho...@googlegroups.com
For completeness I should remind everyone that there are two other ways to use VPython, which don't require Python 2:

1) ivisual (https://pypi.python.org/pypi/IVisual/0.1.89) by John Coady is a pure Python implementation of VPython which runs in the IPython environment (http://ipython.org/) with any version of Python. The problem with VPython is that its core is written in C++ and moreover requires the Boost libraries, hence the need for complex builds tied to specific Pythons. An example of a scientific Python distribution that includes IPython is Anaconda. Although ivisual is significantly slower than classic VPython, due to being implemented in pure Python, Aaron Titus at High Point University used it successfully in a junior-level intermediate mechanics class last semester. (There are plans to use Cython to speed up ivisual, and Coady has already done some experiments with this.)

2) GlowScript (glowscript.org), which isn't really suitable for a computational physics course because it uses a Python-to-JavaScript compiler that doesn't permit importing from the large universe of Python modules.

Matt Craig

unread,
Feb 2, 2015, 1:06:38 AM2/2/15
to vpytho...@googlegroups.com
I know this partly echoes what Bruce has already said, but you can get essentially all of the python 3.4 behavior with a more expansive import:

from __future__ import print_function, division, unicode_literals, absolute_import

As far as I can tell, the roadblock to moving vpython to 3.4 is wxpython over which vpython has no control. 

If your roadblock is that you need python 3.4 for other work but also need vpython, which currently requires 2.7, using virtual environments is the way to go. I use them all the time with anaconda (a distribution that uses a variant of the more widely used python virtualenv).

If you'd like more information about virtual environments, let me know.

Matt Craig 

Poul Riis

unread,
Feb 16, 2015, 2:02:49 PM2/16/15
to vpytho...@googlegroups.com
The example below now works on my computer (windows8, Python3.4, VPython5.74, wxPython_Phoenix-3.03).

Doesn't that mean that it is now possible to make a VPython6 for Python3.4? And if it is easy enough to prepare, why not give it a try?

Poul Riis

PS: To be honest, my computer comes with a warning:

Warning (from warnings module):
  File "C:\Python34\lib\site-packages\vis\materials.py", line 70
    self.__setattr__(key, value)
FutureWarning: comparison to `None` will result in an elementwise object comparison in the future.

but it seems to be non-fatal. Nevertheless, if someone knows how to get rid of it, I would like to know get that information.




Here comes the example:



import wx

app=wx.App()
dialog=wx.TextEntryDialog(None,"Radius of sphere","Input window","100",style=wx.OK|wx.CANCEL)
if dialog.ShowModal()==wx.ID_OK:
    inputnumber=dialog.GetValue()
    

dialog.Destroy()


def axes(axisLength):
    xaxis=arrow(pos=(-axisLength,0,0),axis=(2*axisLength,0,0),color=color.red,fixedwidth=True,shaftwidth=0.1)
    yaxis=arrow(pos=(0,-axisLength,0),axis=(0,2*axisLength,0),color=color.green,fixedwidth=True,shaftwidth=0.1)
    zaxis=arrow(pos=(0,0,-axisLength),axis=(0,0,2*axisLength),color=color.blue,fixedwidth=True,shaftwidth=0.1)

          
from visual import *
scene = display(title="Test with wxpython",
     x=0, y=0, width=1400, height=800,
     center=(0,0,0), background=crayola.white,
     forward=(2,-7,1))

axes(10)

r=eval(inputnumber)
ball=sphere(pos=(0,0,0),radius=r,material=materials.earth)

DrBwts

unread,
Feb 16, 2015, 2:32:44 PM2/16/15
to vpytho...@googlegroups.com
For what its worth it may be beneficial to use Anaconda which allows you to have multiple Python installations ie 2.x and 3.x installations.

Most scientific code uses 2.7.x as this is the most stable version of Python & the one which alot of researchers have been using for the last 5 or so years. Even though SciPy/numpy now work with 3.2 and above.

As a result there is a reluctance to go to 3.x due to legacy issues.

Nic

Bruce Sherwood

unread,
Feb 17, 2015, 12:08:32 AM2/17/15
to vpytho...@googlegroups.com
I'll say it one more final time. I will not take the time to build installers for VPython 6 on Python 3 because 1) I'm waiting for an official release of wxPython for Python 3 and 2) the wxPython site is silent about a version for Python 3 and 3) no one has given an adequate reason for needing Python 3 beyond "it's the modern version" and 4) Python 2.7 is widely used professionally and scientifically. If you or someone else wants to build it yourself, do so. 

I will not respond to future posts on this topic other than ones that alert me that there is now an official release of wxPython for Python 3.

Bruce Sherwood

unread,
Feb 17, 2015, 1:15:55 AM2/17/15
to vpytho...@googlegroups.com

One other thing: Running 5.74 with wxPython 3 means nothing because 5.74 does not make any reference whatsoever to wxPython, which plays a role only in VPython 6.

Echo Baker

unread,
Jun 7, 2015, 4:45:55 AM6/7/15
to vpytho...@googlegroups.com
i get a method to get rid of the Warning:
first : find the file File "C:\Python34\lib\site-packages\vis\materials.py"
second: open the file in an editor ,then go to line 70
third: comment the two lines just like this

class raw_texture(cvisual.texture):
    def __init__(self, **kwargs):
        cvisual.texture.__init__(self)
##        for key, value in kwargs.items():
##            self.__setattr__(key, value)

forth: save the change

note!!! when you use the vpython to code a script, the first line must be like below:
from vis import *

Poul Riis

unread,
Jun 8, 2015, 7:40:47 AM6/8/15
to vpytho...@googlegroups.com
I just tried that - but then I cannot use texture!?

Poul Riis
Reply all
Reply to author
Forward
0 new messages