Re: Python Versions and manage.py

2009-02-18 Thread Karen Tracey
On Wed, Feb 18, 2009 at 10:44 AM, djandrow wrote:

>
> Hello,
>
> I have python 2.5 and 2.6 installed on my computer and when i try to
> run manage.py sqlall I get an error:
>
> raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
> django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb
> module: Module use of python25.dll conflicts with this version of
> Python.
>
> This is because it is using python 2.6 and the mysql backend is for
> 2.5, there isn't an exe backend for windows.
>

Actually, there is an exe for 2.6, see:

http://groups.google.com/group/django-users/msg/5b5f4dee148d0fc3

I gave that a brief try and it worked for me (ignoring some deprecation
warnings about sets).


> I'm using the command line and want to know how i can change the
> python versions. I have my system path set up for 2.5 so I don't know
> what effect that has.
>

Apparently you've put something in your system PATH setting that is pulling
in Python 2.5 stuff even when you are running Python 2.6, but I'm not sure
what.  I've found it fairly easy to switch between two Pythons on Windows by
letting the last install (2.6 in my case) set up the file association for
.py to the 2.6 Python executable and having the 2.5 Python directory (just
the location of python.exe, nothing else) in the PATH.  Then when I issue a
command like 'python script.py', script.py runs under Python 2.5, but if I
run just 'script.py', it runs under 2.6.  (I've also got 2.3 and 2.4
installed for testing purposes, when I want one of them I have to specify
the full path to the correct python.exe I want to use.)

Prior to getting that mysqldb exe for 2.6, if I tried to use MySQL with
Python2.6 I'd get an error "No module named MySQLdb", since there was no
MySQLdb installed under 2.6. The fact that in your case it's finding some
MySQLdb but then running into trouble with the Python version makes me think
you've put something on your system path that really shouldn't be there and
isn't necessary.  If you just put the base Python directory in the path,
that is the python that will be used when you prefix commands with "python",
and it will correctly search its tree (and only its tree) for extensions.

Karen

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Python Versions and manage.py

2009-02-18 Thread Ramiro Morales

On Wed, Feb 18, 2009 at 3:50 PM, djandrow  wrote:
>
> I've had some success by specifying the path manually
>
> python "C:\ProgLangs\Python25\Lib\site-packages\django\conf
> \project_template\manage.py" sqlall

If you are using manage.py then the most common scenario
is the one when you already are at the directory containing it
so you don't need to specify its full path.

What you need to specify is the full path to the python
binary you want to use:

C:\python25\python manage.py help

or

C:\python26\python manage.py help

(obviously, you need to have Django installed
under both Python versions)

Yo can create your own  .BAT files containing just
that if you want to save some keystrokes.

Regards,

-- 
 Ramiro Morales

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Python Versions and manage.py

2009-02-18 Thread djandrow

I've had some success by specifying the path manually

python "C:\ProgLangs\Python25\Lib\site-packages\django\conf
\project_template\manage.py" sqlall

I'm still getting an error but i'm 90% sure its unrelated.

Thanks,

Andrew

On Feb 18, 4:00 pm, Alex Gaynor  wrote:
> On Wed, Feb 18, 2009 at 10:44 AM, djandrow wrote:
>
>
>
>
>
> > Hello,
>
> > I have python 2.5 and 2.6 installed on my computer and when i try to
> > run manage.py sqlall I get an error:
>
> > raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
> > django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb
> > module: Module use of python25.dll conflicts with this version of
> > Python.
>
> > This is because it is using python 2.6 and the mysql backend is for
> > 2.5, there isn't an exe backend for windows.
>
> > I'm using the command line and want to know how i can change the
> > python versions. I have my system path set up for 2.5 so I don't know
> > what effect that has.
>
> > Would it be possible to just list the path in the command line when i
> > run manage.py? since other commands don't have this problem
>
> > Andrew
>
> I'm not super familiar with how windows handles it's path, but if you do
> ./manage.py on unix it will use your default python installed, however you
> can also do python manage.py or python2.5 manage.py or python2.6 manage.py
> to specify which version to use.  Hopefully that helps somewhat.
>
> Alex
>
> --
> "I disapprove of what you say, but I will defend to the death your right to
> say it." --Voltaire
> "The people's good is the highest law."--Cicero
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Python Versions and manage.py

2009-02-18 Thread Alex Gaynor
On Wed, Feb 18, 2009 at 10:44 AM, djandrow wrote:

>
> Hello,
>
> I have python 2.5 and 2.6 installed on my computer and when i try to
> run manage.py sqlall I get an error:
>
> raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
> django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb
> module: Module use of python25.dll conflicts with this version of
> Python.
>
> This is because it is using python 2.6 and the mysql backend is for
> 2.5, there isn't an exe backend for windows.
>
> I'm using the command line and want to know how i can change the
> python versions. I have my system path set up for 2.5 so I don't know
> what effect that has.
>
> Would it be possible to just list the path in the command line when i
> run manage.py? since other commands don't have this problem
>
> Andrew
> >
>
I'm not super familiar with how windows handles it's path, but if you do
./manage.py on unix it will use your default python installed, however you
can also do python manage.py or python2.5 manage.py or python2.6 manage.py
to specify which version to use.  Hopefully that helps somewhat.

Alex

-- 
"I disapprove of what you say, but I will defend to the death your right to
say it." --Voltaire
"The people's good is the highest law."--Cicero

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Python Versions and manage.py

2009-02-18 Thread djandrow

Hello,

I have python 2.5 and 2.6 installed on my computer and when i try to
run manage.py sqlall I get an error:

raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb
module: Module use of python25.dll conflicts with this version of
Python.

This is because it is using python 2.6 and the mysql backend is for
2.5, there isn't an exe backend for windows.

I'm using the command line and want to know how i can change the
python versions. I have my system path set up for 2.5 so I don't know
what effect that has.

Would it be possible to just list the path in the command line when i
run manage.py? since other commands don't have this problem

Andrew
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---