|
From: Stef M. <s.m...@ru...> - 2008-12-21 19:52:10
|
hello, Sorry, I think this is question is asked before (might be even done by me ;-) but I can't find it anymore, so it must have had an unclear subject-line. If I remember well the answer was, install V3+Python 2.4 and V5 + Python 2.5. But why isn't it possible to install both with 2.5 (as this is by now the main stream) ? Although I never used it myself, there seems to be something like a pth-file. I also wouldn't mind to explicitly add the path of either v3 or v5 to the python path, before running a program (because this can easily be automated). I would love to go to V5, but a number of features of V3 is not (yet) implemented in V5. thanks, Stef Mientki |
|
From: Bruce S. <Bru...@nc...> - 2008-12-21 20:39:43
|
The problem with installing two Visuals for one Python is the conflict between the name "visual" being then ambiguous. I just tried a little experiment of changing the name of the new site-packages/visual to visual5 and installing Visual 3 as well, then trying to do "from visual5 import *", but that didn't work. Maybe someone else will figure out how to fight through the name problems. Another workaround is to install Visual 3, save a copy of the relevant materials from site-packages, then delete from site-packages. Then install Visual 5, save a copy of these materials. Now you can swithc back and forth by copying the desired files into site-packages from the saved copies. Bruce Sherwood Stef Mientki wrote: > hello, > > Sorry, I think this is question is asked before (might be even done by > me ;-) > but I can't find it anymore, so it must have had an unclear subject-line. > > If I remember well the answer was, install V3+Python 2.4 and V5 + Python > 2.5. > But why isn't it possible to install both with 2.5 (as this is by now > the main stream) ? > > Although I never used it myself, there seems to be something like a > pth-file. > I also wouldn't mind to explicitly add the path of either v3 or v5 to > the python path, > before running a program (because this can easily be automated). > > I would love to go to V5, > but a number of features of V3 is not (yet) implemented in V5. > > thanks, > Stef Mientki > > > ------------------------------------------------------------------------------ > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users > |
|
From: Stef M. <s.m...@ru...> - 2008-12-21 22:43:34
|
thanks Bruce,
Bruce Sherwood wrote:
> The problem with installing two Visuals for one Python is the conflict
> between the name "visual" being then ambiguous. I just tried a little
> experiment of changing the name of the new site-packages/visual to
> visual5 and installing Visual 3 as well, then trying to do "from
> visual5 import *", but that didn't work. Maybe someone else will
> figure out how to fight through the name problems.
>
> Another workaround is to install Visual 3, save a copy of the relevant
> materials from site-packages, then delete from site-packages. Then
> install Visual 5, save a copy of these materials. Now you can swithc
> back and forth by copying the desired files into site-packages from
> the saved copies.
>
I played around, and found the following work around:
- I installed Vpython version 5 on a different computer (afraid of
harming my own work-PC ;-)
- called the visual directory "visual5"
- copied that visual5 directory to site-packages
- created the function below, which I place on a central place where all
programs can reach it
- and add a line to all VPython programs "Get_Visual ( ... )" before
importing visual, seems to work great.
cheers,
Stef
def Get_Visual ( Version = 3 ) :
import os, sys
print sys.path
for path in sys.path :
if path.endswith ( 'site-packages') :
print path
break
vpath = os.path.join ( path, 'visual' )
if ( Version == 3 ) and os.path.exists ( vpath + '3' ) :
print 'Visual ==> V3', vpath
os.rename ( vpath, vpath + '5' )
os.rename ( vpath + '3', vpath )
elif ( Version == 5 ) and os.path.exists ( vpath + '5' ) :
print 'Visual ==> V5', vpath
os.rename ( vpath, vpath + '3' )
os.rename ( vpath + '5', vpath )
Get_Visual ( 3 )
from visual import *
...
|
|
From: Bruce S. <Bru...@nc...> - 2008-12-22 00:22:42
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Thanks much for figuring this out!<br>
<br>
Bruce Sherwood<br>
<br>
Stef Mientki wrote:
<blockquote cite="mid:494...@ru..." type="cite">
<pre wrap="">thanks Bruce,
Bruce Sherwood wrote:
</pre>
<blockquote type="cite">
<pre wrap="">The problem with installing two Visuals for one Python is the conflict
between the name "visual" being then ambiguous. I just tried a little
experiment of changing the name of the new site-packages/visual to
visual5 and installing Visual 3 as well, then trying to do "from
visual5 import *", but that didn't work. Maybe someone else will
figure out how to fight through the name problems.
Another workaround is to install Visual 3, save a copy of the relevant
materials from site-packages, then delete from site-packages. Then
install Visual 5, save a copy of these materials. Now you can swithc
back and forth by copying the desired files into site-packages from
the saved copies.
</pre>
</blockquote>
<pre wrap=""><!---->I played around, and found the following work around:
- I installed Vpython version 5 on a different computer (afraid of
harming my own work-PC ;-)
- called the visual directory "visual5"
- copied that visual5 directory to site-packages
- created the function below, which I place on a central place where all
programs can reach it
- and add a line to all VPython programs "Get_Visual ( ... )" before
importing visual, seems to work great.
cheers,
Stef
def Get_Visual ( Version = 3 ) :
import os, sys
print sys.path
for path in sys.path :
if path.endswith ( 'site-packages') :
print path
break
vpath = os.path.join ( path, 'visual' )
if ( Version == 3 ) and os.path.exists ( vpath + '3' ) :
print 'Visual ==> V3', vpath
os.rename ( vpath, vpath + '5' )
os.rename ( vpath + '3', vpath )
elif ( Version == 5 ) and os.path.exists ( vpath + '5' ) :
print 'Visual ==> V5', vpath
os.rename ( vpath, vpath + '3' )
os.rename ( vpath + '5', vpath )
Get_Visual ( 3 )
from visual import *
...
------------------------------------------------------------------------------
_______________________________________________
Visualpython-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Vis...@li...">Vis...@li...</a>
<a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/visualpython-users">https://lists.sourceforge.net/lists/listinfo/visualpython-users</a>
</pre>
</blockquote>
</body>
</html>
|