Which python version do I use with "virtualenv"?

O

OldGrantonian

I have Windows Vista Home Premium.

As a non-techy, I want to use "virtualenv"

I had Python 2.6 on my laptop.

I needed "easyinstall" to install virtualenv. During installation of
easyinstall, I got the message "Python 2.5 not found"

So I installed Python 2.5, then installed virtualenv

So I now have c:\Python 2.5 and c:\Python 2.6

On the virtualenv web site, the instructions for use are:

$ python virtualenv.py ENV

My question is, which "python" should I use on this command line: 2.5
or 2.6?

BTW: I am currently running a Python app using 2.6. I want to install
a beta upagrade of this app, without interfering with my current
setup, so the app developer recommends using virtualenv.
 
S

Steven D'Aprano

So I now have c:\Python 2.5 and c:\Python 2.6

On the virtualenv web site, the instructions for use are:

$ python virtualenv.py ENV

My question is, which "python" should I use on this command line: 2.5 or
2.6?

I'm not an expert on virtualenv, nor do I use Windows, but I'd start off
with this:

$ c:\Python 2.5\python.exe vitualenv.py ENV


and if that doesn't do what you expect, report the precise error you get
and hopefully somebody who knows more about Windows can help.
 
A

Ant

I had Python 2.6 on my laptop.

I needed "easyinstall" to install virtualenv. During installation of
easyinstall, I got the message "Python 2.5 not found"

So I installed Python 2.5, then installed virtualenv

So I now have c:\Python 2.5 and c:\Python 2.6
....

Sounds like you've downloaded the Python 2.5 version of Easy Install.
If I were you I'd uninstall Python 2.5, and re-install easy_install
using the correct exe for Python 2.6.

Check that typing 'python' on the commandline still works, as
installing and uninstalling 2.5 may have messed up your path. if it
has, either manually add the Python install directory to the path, or
reinstall Python 2.6.

Note: have you changed the default install folder? I haven't got
Vista, but on XP it installs to c:\Python26 not "C:\Python 2.6". I'd
be carefull of changing the default install directory of Python,
particularly if you are "non-techy" as some packages installers may
look for Python in the default location.
 
O

OldGrantonian

Thanks to both Steven D'Aprano and Ant :)

There's no Python 2.6 version of EasyInstall :(

For 2.5, there is:

setuptools-0.6c9.win32-py2.5.exe

But for 2.6, it's:

setuptools-0.6c9-py2.6.egg

For any other egg file, I would use EasyInstall, but I don't think I
can use EasyInstall to install EasyInstall :)
 
K

Krishnakant

I have another question in this same context.
I have python 2.6 and want to set up a vertualenv
in /opt/turbogears/python2.5.
Then use this for all the things a turbogears based application would
need for project execution.

so I have decided that I will download python 2.5 and compile it
with ./configure --prefix=/opt/turbogears/python2.5 and then install
turbogears. Is this possible? will this kind of python compilation
help me to create a vertualenv in the place where I have python2.5?

or is there any other way to do this? I really need vertualenv and
would want to use python2.5 because I feel easy install won't work with
python2.6

happy hacking.
Krishnakant.
 
D

Diez B. Roggisch

Krishnakant said:
I have another question in this same context.
I have python 2.6 and want to set up a vertualenv
in /opt/turbogears/python2.5.
Then use this for all the things a turbogears based application would
need for project execution.

so I have decided that I will download python 2.5 and compile it
with ./configure --prefix=/opt/turbogears/python2.5 and then install
turbogears. Is this possible? will this kind of python compilation
help me to create a vertualenv in the place where I have python2.5?

You are confusing virtualenv with a custom-build python. You can of course
use VE with a custom-build python, but then there isn't as much use for it,
as you then have a distinct python-instance already - unless you are going
to share it amongst projects, which then leads to the question why you
don't use VE *without* the custom-build python.
or is there any other way to do this? I really need vertualenv and
would want to use python2.5 because I feel easy install won't work with
python2.6

Feelings are a fine thing in bed, on weddings or other social contexts.
Usually, they don't belong in the more mundane world of computers, and in
this case it's an outright wrong feeling. Easy_install works just fine with
py2.6

It might be though that there are some 3rd-party-libs that don't.

Diez
 
K

Krishnakant

You are confusing virtualenv with a custom-build python. You can of course
use VE with a custom-build python, but then there isn't as much use for it,
as you then have a distinct python-instance already - unless you are going
to share it amongst projects, which then leads to the question why you
don't use VE *without* the custom-build python.
Well, Turbogears works perfectly with python2.5, although there are
people who use it with 2.6 as well.
I have to keep 2.6 because my screen reader orca giave me some problem
with 2.5.

So I have no option but to keep a seperate python2.5 in some different
directory and have ve use it.

would just like to know how I can get ve to use that installation and
not the one on my system by default.

happy hacking.
Krishnakant.
 
D

Diez B. Roggisch

Krishnakant said:
Well, Turbogears works perfectly with python2.5, although there are
people who use it with 2.6 as well.
I have to keep 2.6 because my screen reader orca giave me some problem
with 2.5.

So I have no option but to keep a seperate python2.5 in some different
directory and have ve use it.

would just like to know how I can get ve to use that installation and
not the one on my system by default.

By *using* it?

/opt/my_python/bin/python2.5

and you're done. If you e.g. download ez_setup.py & execute that through
your custom python, you'll end up with an easy_install
in /opt/my_python/bin, which you then can use to e.g. install VE.

Diez
 
O

OldGrantonian

I wonder what I've been running then?




No, but you can use ez_setup.

Go tohttp://peak.telecommunity.com/dist/ez_setup.pyand save the content
of that file as ez_setup.py (cut and paste into your favourite editor may
be the simplest way) then run it with your chosen Python. It will find and
install the appropriate version of easy install.


ez_setup worked fine. Thanks for that :)

According to the web site:

http://pypi.python.org/pypi/virtualenv

the next step is to do:

virtualenv ENV

If I do that, I get the following message:

--------------------------------

C:\Python26\Scripts>virtualenv ENV
Traceback (most recent call last):
File "C:\Python26\Scripts\virtualenv-script.py", line 8, in <module>
load_entry_point('virtualenv==1.3.3', 'console_scripts',
'virtualenv')()
File "C:\Python26\lib\site-packages\virtualenv-1.3.3-py2.6.egg
\virtualenv.py", line 420
unzip_setuptools=options.unzip_setuptools)
File "C:\Python26\lib\site-packages\virtualenv-1.3.3-py2.6.egg
\virtualenv.py", line 499
home_dir, lib_dir, inc_dir, bin_dir = path_locations(home_dir)
File "C:\Python26\lib\site-packages\virtualenv-1.3.3-py2.6.egg
\virtualenv.py", line 521
import win32api
ImportError: No module named win32api

C:\Python26\Scripts>
 
E

Emile van Sebille

Thanks to both Steven D'Aprano and Ant :)
Sounds like you've downloaded the Python 2.5 version of Easy Install.
There's no Python 2.6 version of EasyInstall :(
I wonder what I've been running then?


For 2.5, there is:
setuptools-0.6c9.win32-py2.5.exe
But for 2.6, it's:
setuptools-0.6c9-py2.6.egg
For any other egg file, I would use EasyInstall, but I don't think I
can use EasyInstall to install EasyInstall :)
No, but you can use ez_setup.

Go tohttp://peak.telecommunity.com/dist/ez_setup.pyand save the content
of that file as ez_setup.py (cut and paste into your favourite editor may
be the simplest way) then run it with your chosen Python. It will find and
install the appropriate version of easy install.
[/QUOTE]


ez_setup worked fine. Thanks for that :)

According to the web site:

http://pypi.python.org/pypi/virtualenv

the next step is to do:

virtualenv ENV

If I do that, I get the following message:

--------------------------------

C:\Python26\Scripts>virtualenv ENV
Traceback (most recent call last):
File "C:\Python26\Scripts\virtualenv-script.py", line 8, in <module>
load_entry_point('virtualenv==1.3.3', 'console_scripts',
'virtualenv')()
File "C:\Python26\lib\site-packages\virtualenv-1.3.3-py2.6.egg
\virtualenv.py", line 420
unzip_setuptools=options.unzip_setuptools)
File "C:\Python26\lib\site-packages\virtualenv-1.3.3-py2.6.egg
\virtualenv.py", line 499
home_dir, lib_dir, inc_dir, bin_dir = path_locations(home_dir)
File "C:\Python26\lib\site-packages\virtualenv-1.3.3-py2.6.egg
\virtualenv.py", line 521
import win32api
ImportError: No module named win32api

C:\Python26\Scripts>
[/QUOTE]


Install the win32 extensions or install the 2.6 Activestate release.

Emile
 
O

OldGrantonian

On 5/7/2009 12:53 PM OldGrantonian said...








Install the win32 extensions or install the 2.6 Activestate release.

Emile


Thanks for the response :)

Where do I find the win32 extensions?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top