why I am Getting Import error for eve.io.SQLAlchemy? - python-2.7

I am running the demo script available at
https://gist.github.com/Tefnet/5430309
I am getting following error, despite having all libraries
flask sqlalchemy validate SQL
File demo.py in line 2 , in <module>
from eve.io.sqlalchemy import SQLAlchemy, Validator
ImportError no module named sqlalchemy
Not sure why is it giving ? even though I have installed EVE, SQLAlchemy, flask

The SQLAlchemy branch is a work in progress. It has evolved quite a bit from the fork linked by codegeek and now is almost on par (feature-wise) with v0.4dev.
Eve-SQLAlchemy branch
So if you want to play around with it, make sure to pull that branch. Also, one thing it's not been done yet is update requirements.txt and setup.py, so you will want to pip install sqlalchemy on your own.
You can find a rather complete Eve-SQL log by checking out this very long lived ticket.

There is no eve.io.sqlalchemy by looking at the official source code of eve. The Gist that you are looking at is a fork from eve but the changes are not pulled in yet officially.
See the commit changes here.

Related

Facing an Error while trying to Import ModelStep

I am trying to import ModelStep using the code
from sagemaker.workflow.model_step import ModelStep
But it is throwing the error
ModuleNotFoundError: No module named 'sagemaker.workflow.model_step'
How can I resolve this issue?
This feature, in sagemaker-python-sdk, was introduced starting with release 2.90.0 (16 May 2022).
I suggest always keeping sagemaker updated, they come out with updates very frequently and quite important:
pip install -U sagemaker

Python Appengine - "ImportError: cannot import name OSRNG" when invoking the Endpoints tool

I am following this tutorial on Google Cloud Endpoints. I am having trouble at the "Generating the OpenApi configuration file" section. Specifically, when I invoke the Endpoints tool.
The Traceback is saying that the file on lib/Crypto/Random/init.py "from Crypto.Random import OSRNG" is producing the import error.
What I have done so far
Looked at the path lib/Crypto/Random and saw a folder named OSRNG - thus made sure that there was a folder called OSRNG (I didnt see any py file name OSRNG.py though)
Followed the answer for this question by putting the pycrypto version to "latest" in the app.yaml file.
Looked into this question but doesnt apply.
Looked into this question by specifying the version rather than "latest" in app.yaml.
I don't understand why it is saying there is an import error when I can literally see the package/module in the directory.
Can someone help why it is producing an import error?
Are you running on OSX?
I encountered a similar problem and the solution for me was installing google-endpoints (which for some reason is missing from the instructions):
pip install -t lib google-endpoints --ignore-installed

Error: cannot import name RemovedInDjango110Warning in django 1.9.5

So this code has been running for like a week now, today it is throwing this error. And this is not happening at the URL level, which many places seem to say.
I am using celery, djcelery and Django 1.9.5. In my celery task, in one part where I am trying to connect to my DB, it is throwing this error. The strange part is when I run the code line by line in shell, it works.
All this code runs inside a virtualenv being used by two projects which have exactly same requirements. to confirm, I just checked the django version in pip. It is 1.9.5
Please let me know if any extra info is required.

Git - How to deploy code from my central Git repo to my production server?

I'm new to Git. I need to setup Git to deploy a Django website to the production server. My question here is to know what is the best way of doing this.
By now I only have a Master branch. My problem here is that Development environment is not equal to the Production environment. How can I have the two environments(Development and Production) in Git? Should I use two new Branches(Development and Production). Please give me a clue on this.
Other question... when I finish to upload/push the code to the Production server I need to restart the Gunicorn(serves Django website). How can I do this?
And the most important question... Should I use Git to do this or I have better options?
Best Regards,
The first question you must solve is your project structure. Usually the difference between development and the production environment is setting.py and url.py. So why you firstly separate those? :) For example you can have one main settings.py where you define all the default settings which are in common. Then at the end of the file you just import the settings_dev.py and settting_prod.py for exemple:
try:
from settings_prod import *
except ImportError:
pass
try:
from settings_dev import *
except ImportError:
pass
Then simply you can overload all the setting you want and have custom settings of the project (for example installed apps). The same logic you can use for urls.py file.
Then you can simply ignore adding the *_dev files to repo and on the server side you can just checkout the code from repo and restart http server. To automatize this for now I can't give the right name of app to use. Sometimes simple python script could be solution like: watching if the file datetime changed and if yes, just run restart command for http.
Hope that helped.
Ignas
You can follow this brunching model - http://nvie.com/posts/a-successful-git-branching-model/
And, git is ok but use Fabric for deployment.

Installing Celery with Django

I'm trying to install celery with django and I'm get the following error:
from celery.task import sets
ImportError: cannot import name sets
How can I fix that?
Installing a newer version of celery might work. Or your install might not be complete.
But sets should be a part of celery.task.
Atleast, the latest docs indicate that this should be the case: http://ask.github.com/celery/reference/celery.task.sets.html
https://github.com/ask/celery/issues#issue/315
looks like an issue that has been reported.
You might be interested in these 2 pages of the #celery irc log
http://botland.oebfare.com/logger/celery/2011/3/4/2/
http://botland.oebfare.com/logger/celery/2011/3/4/3/