Solved

python / django with mssql

Posted on 2014-02-23
8
522 Views
Last Modified: 2014-02-25
i'm getting errors setting up a ms sql db

Python 3.3 & Django 1.7 on Windows 7 Pro & Ms Sql 2008

this is my starting point: http://django-mssql.readthedocs.org/en/latest/ 

first i pip install django-mssql

see attached image for error
error details
0
Comment
Question by:dgrafx
  • 5
  • 3
8 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 39880653
the message indicates that the failure is logged into a pip.log file, which you should check for further details ...
0
 
LVL 25

Author Comment

by:dgrafx
ID: 39880662
is this log file re.py?

and what do i do about this?
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 39880678
I found this explanation:  
 ... because of the following code from line 7 of setup.py in the traceback:

version = re.search('__version__ = "(.+?)"', f.read()).group(1)

This should work if the search pattern was a bytes object. A byte literal can be created by simply pre-pending the string literal with a b like the following:

version = re.search(b'__version__ = "(.+?)"', f.read()).group(1) 

Open in new window


not sure if that will solve your case, but it looks like it's the same issue: the package is not correctly tested, visibly...
0
 
LVL 25

Author Comment

by:dgrafx
ID: 39880701
here are the lines of code:

158: def search(pattern, string, flags=0):
159: """Scan through string looking for a match to the pattern, returning
160: a match object, or None if no match was found."""
161: return _compile(pattern, flags).search(string)

what are the edits you are suggesting?

thanks
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 25

Author Comment

by:dgrafx
ID: 39882647
or if not suggesting edits are you saying forget it?
0
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 39882760
I am not strong in phython at all, I may only be a "reader" of source code.
from what I have read so far, instead of b' .... '  you may want to use str( ... ) instead, especially if you are working with a variable.
hope it helps, otherwise you may want to use an older package ...
0
 
LVL 25

Author Comment

by:dgrafx
ID: 39887462
So I discovered that the newest version of Python that works with the unofficial django-mssql is 2.7

Thanks
0
 
LVL 25

Author Closing Comment

by:dgrafx
ID: 39887463
using an older version of Python was the solution
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Dictionaries contain key:value pairs. Which means a collection of tuples with an attribute name and an assigned value to it. The semicolon present in between each key and values and attribute with values are delimited with a comma.  In python we can…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now