python can load GDAL, but django can't - django

I was able to successfully install gdal 1.11 and load it from python shell on my windows 32 bit machine. I can also verify its success by typing "gdalinfo --version" and getting the correct version info: GDAL 1.11.4, released 2016/01/25
However, when running "python manage.py shell" in django 1.11, I got error 127 'the specified procedure could not be found'. The error occurred when django called function lgdal = CDLL(lib_path)
I printed out lib_path, it is correct. The same function worked fine in my python shell.
Any idea why loading gdal111.dll would fail in the django environment when it has no problem in the python shell? Thanks.

Related

Using google-cloud-tasks with python 2.7 on app-engine

I'm working on migrating a Python 2.7/1st Gen/GAE app to Python 3/2nd Gen/GAE.
My current step is replacing google.appengine.ext.deferred with the Python Client for Cloud Tasks API.
Here is where I'm at:
Still using Python 2.7
Latest updates with gcloud components update
Following the Python Client docs, I added google-cloud-tasks==1.5.0 to my requirements.txt
google-cloud-tasks needs grpcio so I added - name: grpcio\n version: latest to app.yaml
Now dev_appserver.py is giving me the error ImportError: No module named enum
I'm not finding much documentation online so I'm wondering... Is it possible to use google-cloud-tasks with Python 2.7 on app engine?
If so, how do I fix the last error above?

Django Runserver Crashes without Message

I've been working a project for months using Python3 & Django, never had issues regarding starting django but yesterday I formatted my Mac, I have the project in Github so today I clone the project and had bunch of issues with Psycopg2 and Pillow but eventually fixed it.
The problem now is that, when on the terminal I put python manage.py runserver, django simply crashes without any message and I don't know how to find the problem or view any logs regarding the crash, this is all I get:
(backend) ➜ src git:(master) ✗ python manage.py runserver
3Watching for file changes with StatReloader
Performing system checks...
After that it simply crashes and nothing else happens. Any ideas on how to debug this problem? I've tried cloning it again and building it but same results.

Error when running ./manage.py Validate

When I run the command
./manage.py validate
I get the error
Error:No module named debugger.debugger
I have debugger installed in my virtual environment via pip.
Actually the real problem was because of django-haystack version. Requires was version 2.0.0
So during validate somehow the real error was not showing up. The actual error was an import error during validate.
Thanks everyone for the help

Error loading cx_Oracle module with IIS and PyISAPIe

I have developed a Django application, and i am
trying to get it to run under IIS on Windows Server 2003. I'm
generally following the Django walkthrough but my db is Oracle.
If I run python from the command prompt and import cx_Oracle, it works
just fine. If I run the project with django's development server, everything works fine too.
I haven't managed to get it rum on IIS6 but when a test.py is loaded by IIS and
PyISAPIe, it says it cannot load cx_Oracle and displays the following
error:
Error loading cx_Oracle module: DLL load failed: The specified module
could not be found.
I'm using the 32-bit versions of the following:
Python 2.6.6,
PyISAPIe 1.1.0 rc4 py2.6,
Django 1.4.3,
Oracle Client 11.2,
cx_Oracle 5.1 (for Oracle 11g, Python 2.6)
Any thoughts on why this might be happening?
EDIT:I tried downgrading to cx_Oracle 4.4.1 and now I get the error:
ImportError: cannot import name utils

Python's Django could not connect to Oracle 11g

I am a newbie to Python trying out to quickly build a site using Django.
Following are the steps I have performed (Win 7):
Installed Python 2.7
Installed Django 1.4
Created a project and app
Started the server using 'python manage.py startserver' and accessed using the "http://127.0.0.1:8000" the basic page.
Now wanted to configure my Oracle 11g DB for my project. Hence, installed cx_Oracle 5.1-11g and tried 'python manage.py syncdb' which failed with cx_Oracle.DatabaseError: ORA-24315: illegal attribute type.
Got the same error even from a python interpretor.
import cx_Oracle
connection=cx_Oracle.Connection('python_user','python_user','(DESC..string..)')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
cx_Oracle.DatabaseError: ORA-24315: illegal attribute type
I am using the correct credentials and libraries as per my trouble shooting.
Any help is appreciated..
Checking which attribute is failing by raising an explicit exception might help you in the right direction
try:
connection=cx_Oracle.Connection('python_user','python_user','(DESC..string..)')
except cx_Oracle.DatabaseError, e:
print e[0].context
raise
The main problem is versions of the following should be compatible with each other.
Python 2.7, Django 1.4, Oracle DB 11g (which I connect to) and lib cx_Oracle 5.0.3+-11g should be in compatible with Oracle Xe 11.2 (which was 10.2 previously).
After installing the right version and setting the ORACLE_HOME to 'C:/oraclexe/.../11.2.0/server' it started connecting without any issues.