Local development of Google App Engine not importing built-in library - python

I followed the quickstart then I simply clone hello_world from here. I already downloaded google_appengine sdk from here. I extract it and now I have folder google_appengine alongside with hello_world
so I execute it like this:
It runs well apparently, until I start to request to localhost:8080.
then I got this error:
what's wrong with it? did I miss something?
google said that I can use the built-in library without manually install it with pip.
PS: it works when I just deploy it to my project on Google. and also it works if I manually install webapp2 inside lib inside hello_world like described here then request it locally.
my python version Python 2.7.6 on ubuntu 14.04 32bit
Please if anybody can solve this I would be appreciate it.

Seems like this is acknowledged bug in app engine SDK. As a temporary workaround, you may try this steps:
Uninstalling the following PIP packages resolved this issue for me.
sudo pip uninstall gcloud
sudo pip uninstall googleapis-common-protos
sudo pip uninstall protobuf
Credit to this thread:
https://groups.google.com/forum/?hl=nl#!topic/google-appengine/LucknWk8iaQ
Be sure to use correct executable of pip if you use virtualenv or have multiple python versions installed.

Thanks to #Dmytro Sadovnychyi for the answer. It doesn't work for me to uninstall those packages because I never installed it before, But that makes me think maybe built-in library conflict with other package so I decide to create Virtual Environment. just fresh environment no need to install any package.
activate the environment then execute dev_appserver.py hello_world now it works
for now I'll stick with it until next update like said here

Related

How to install modules with Python 2.4.3

I could not find anything on google about installing modules on this particular version 2.4.3 so I'm asking here.
I need to install python-ssl to use ssl package with python 2.4.3
I do not have any Scripts/pip.exe in my Python24 folder...
I've tried most commands yum / pip etc... nothing seems to work.
How to proceed please ?
You would probably need to make use of one of ancient methods of installation. Try download ssl file from PyPI, unpack it, go to catalog which was created when you unpacked it and do python setup.py install.

I cant install Flask

I am trying to install flask but everytime i get this error
ModuleNotFoundError: No module named 'flask'. I have added python to path and have even reinstalled it but it just isnt working. I followed steps of activating virtual environment and using pip install flask but it still doesn't seem to work. I need to get my a level coursework completed in a week! Please help.
To check if you have actually installed flask, try this command:pip freeze then check if it is actually listed.
Normal procedure to start a flask app would be:
- create a virtual environment.Make sure you are using python 3. check by using this command. python --version. It should print out the latest version.
- Install Flask. For good measure you could use pip3 to make sure you are using python3.
pip3 install Flask
- Run your app.
I can't tell what OS you're using, so I'll make a recommendation for you that's pretty easy to set up on the majority of OS's/Distros:
If you're really in a pinch use Anaconda.
I find Conda (Anaconda) quite nice for managing python pip environments.
Get it working in your operating system, then pip install Flask in a new Conda environment. This is a useful cheatsheet for Conda.
Once you've activated the environment for your Flask project development should be a breeze.
Good luck.

ImportError in bluemix

i am making a python app in IBM bluemix,but when i pushed it,it had an error:
i found my python version is 2.7.10 ,so i thought maybe the reason is the too low,and i change the version to 3.5.1 in runtime.txt like this:
python-3.5.1
but it still didn't work and had the same error.I know I should install this package, but how can i install this in bluemix?
Can anyone please give me a solution?
Looking at your error, it says you are missing the lxml library. This is not installed as part of the standard Python package, so you will need to install it with either pip or conda, depending on what you have setup.
pip install lxml
Yeah,I solved it. in bluemix, if you use some package that not as part of standard python package, you should write them in your requirements.txt, and then bluemix will download this package.
When you do the cf push, if there is a requirements.txt file on your root folder, it will install all the dependencies on Bluemix.

Getting ImportError: No module named azure.storage.blob when doing python manage.py syncdb

When I try to do python manage.py syncdb in my Django app, I get the error ImportError: No module named azure.storage.blob. But thing is, the following packages are installed if one does pip freeze:
azure-common==1.0.0
azure-mgmt==0.20.1
azure-mgmt-common==0.20.0
azure-mgmt-compute==0.20.0
azure-mgmt-network==0.20.1
azure-mgmt-nspkg==1.0.0
azure-mgmt-resource==0.20.1
azure-mgmt-storage==0.20.0
azure-nspkg==1.0.0
azure-servicebus==0.20.1
azure-servicemanagement-legacy==0.20.1
azure-storage==0.20.3
Clearly azure-storage is installed, as is evident. Why is azure.storage.blob not available for import? I even went into my .virtualenvs directory, and got in all the way to azure.storage.blob (i.e. ~/.virtualenvs/myvirtualenv/local/lib/python2.7/site-packages/azure/storage/blob$). It exists!
What do I do? This answer here has not helped: Install Azure Python api on linux: importError: No module named storage.blob
Note: please ask for more information in case you need it
I had a similar issue. To alleviate that, I followed this discussion here: https://github.com/Azure/azure-storage-python/issues/51#issuecomment-148151993
Basically, try pip install azure==0.11.1 before trying syncdb, and I'm confident it will work for you!
There is a thread similar with yours, please check my answer for the thread Unable to use azure SDK in Python.
Based on my experience, Python imports the third-party library packages from some library paths that you can check them thru codes import sys & sys.path in the python interpreter. So you can try to dynamically add the new path contains the installed azure packages into the sys.path in the Python runtime to solve the issue. For adding the new library path, you just code sys.path.append('<the new paths you want to add>') at the front of the code like import azure.
If the way has not helped, I suggest you can try to reinstall Python environment. On Ubuntu, you can use the command sudo apt-get remove python python-pip & sudo apt-get install python python-pip to reinstall Python 2.7 & pip 2.7.(Note: The current major Linux distributions use Python 2.7 as the system default version.)
If Python 3.4 as your runtime for Django, the apt package names for Ubuntu are python3 and python3-pip, and you can use sudo pip3 install azure for Python 3.4 on Ubuntu.
Any concern, please feel free to let me know.

Python-Jira installation without Admin rights

I am writing a python tool that should get information from Jira. I wanted to use Python-Jira but cannot install it properly. I am using (have to use) python 2.7 which doesn't come with pip and I cannot install pip because I do not have local admin rights (and won't get them without hassle).
Is there a way to install/use python-jira without the pip installation process? I tried copying the jira package to the site-packages folder but it seems I run into dependency problems ('ImportError: No module named six.moves' when I try import Jira from jira) which to resolve it seems I have to follow the pip installation process.
Thanks for your help.
Install Virtualenv and you will have your own version of Python and Pip, so you should be able to install jira-python properly.
There is a lot of guides how to do it.
For Linux I recommend this one.
General Python Guide

Categories

Resources