Web.py / No module named 'utils'` - python

I'm trying to install web.py, and I did the next steps:
Download web.py-0.3.7, and extract it on c://web.py-0.3.7
Run the next command:C:\>python C:\web.py-0.37\setup.py install
and it gives me the next error: import utils, db, net, wsgi, http, webapi, httpserver, debugerror ImportError: No module named 'utils'
How can I install and use web.py?

The issue is web.py is native for python 2.7+, however, there are several options.
Install python 2.7+ (recommend using virtualenv)
Check out this group that is porting web.py to python 3.x
Use bottle.py as an alternative (Native to 2.5+ and 3.x)
Aside from these options to directly address the issue of 'utils' not being found, you can download the package here. This does not get around the compatibility issues but just for reference.

I had this same Error using pip install. I just ran pip2 install web.py and it successfully installed. (for anyone still reading this in 2016)

web/__init__.py relies on relative path. Try this:
pip install web.py==0.40.dev0
A website had this solution

Related

AttributeError: module 'urllib3' has no attribute '__version__' error while executing py file

I'm very much new to Python and right now I'm trying to use Python for one of my automation tasks.
I'm trying to execute Execute.py while doing so I learned that my python setup should have modules requests (so downloaded 2.21.0),urllib3 (so downloaded 1.21.1), chardet(so downloaded 3.0.4).
My Python version is 3.7.3
When I execute my execute.py I get the following error:
File "C:\Users\ABC\Downloads\python-3.7.3-embed-amd64\requests\__init__.py", line 87, in <module>
check_compatibility(urllib3.__version__, chardet.__version__)
AttributeError: module 'urllib3' has no attribute '__version__'
So just like we have in chardet folder, I have created a version.py under urllib3 folder.
But still, I'm getting the same error.
Please, can someone help me with this? Which is taking my lot of time to find the resolution.
You can uninstall and then install again all required package, by pip uninstall and pip install .
you can also upgrade all specified packages to the newest available version. The handling of dependencies depends on the upgrade-strategy used (command require for this).
pip install --upgrade
You should use pip to install your libs, it will take care of the dependencies. It seems your urllib3 is not up to date...
Open a command prompt, and run:
pip install requests --upgrade
My answer is about probably where i might have gone wrong.(Nothing wrong in above two answers)
I had installed executable Python,in which i dint have PIP (though its 3.7 version)
so i was struggling to install PIP and all other modules(since im am new)
So ---I had used Web based installation (https://www.python.org/downloads/release/python-373/)
which had PIP and set the Python PATH on the go using which i upgraded required modules like others answered here.
Which has come handy to do the rest of the job ,where i dint come across any issues while executing.
Thanks
I had the same problem with the requests. It was for A circular dependency occurs when two or more modules depend on each other. This is for the fact that each module is defined in terms of the other.
Please try to rename your file. The error for this error is usually due to a conflict with the file name where you are trying to import the requests module.
I was also having same problem, where my file name was token.py and I was trying to import the requests module. I changed the file name and it worked.

Python import issues

I have never used Python before and am trying learn it on the fly. I have this file. I installed python 2.7 have added it the path. when I try python [filename].py I get errors saying
import requests,sys,csv,os,re,urllib2,urllib,time,traceback,string
ImportError: No module named requests.
Am I missing something here. Where would I find these and how do I get this running
You need to install the requests package:
pip install requests
Tutorial about installing packages here

What is importlib.util in python3?

I am trying to pip install importlib with python 3.6, but I get an Import Error saying: 'NO Module named "importlib.util"'. This also comes up when I try to pip install imagescanner, which is my real intention. Building an App that connects to Image Scanner Devices, but that's another problem...
Thanks for any help!
importlib is builtin with Python 3 (at least for me), you can import it directly without installing anything.
The error from pip install is possibly due to importlib is builtin and there's no distribution that's publicly available.
If your Python is from the last 5 years or so, then importlib is builtin. It is available as an external PyPI package for anyone using a much older Python that doesn't have it. You shouldn't be pip installing it, and modules that you are installing also shouldn't be pip installing it. That's a bug in the package you are trying to install, or one of the modules that it installs.

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.

ImportError: No Module named picklefield.fields (Yep pip install says it is there)

I am using vagrant to run my python environment. In my data models I am using django-picklefield module.
when I run my server it says
ImportError: No module named picklefield.fields.
I tried to uninstall and install the picklefield module. Still having the same problem.
You should be able install via:
/[your python install directory]/bin/pip install django-picklefield
If you do this directly instead of a general pip call to install django-picklefield, that will ensure that it is installed on the correct version of Python.
Based on your description my best guess is that you have multiple versions of Python installed, and that your install/uninstall is happening on the wrong one.

Categories

Resources