Solved

python / django with mssql

Posted on 2014-02-23
8
517 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 24

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 24

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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 24

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 24

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 24

Author Closing Comment

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

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

A set of related code is known to be a Module, it helps us to organize our code logically which is much easier for us to understand and use it. Module is an object with arbitrarily named attributes which can be used in binding and referencing. …
Article by: Swadhin
Introduction of Lists in Python: There are six built-in types of sequences. Lists and tuples are the most common one. In this article we will see how to use Lists in python and how we can utilize it while doing our own program. In general we can al…
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…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…

708 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

17 Experts available now in Live!

Get 1:1 Help Now