Install web.py in Python 3.x
Recently decided to move from Python 2.7 to work on 3.x.
using the database, still chose before more interested in web. Py
but seemed to have all sorts of problems found when installation.
ImporError: No module named ‘utils’
ModuleNotFoundError: No module named ‘db’
I finally decided to give the dev version a try.
pip install web.py==0.40.dev0
It turns out that the dev version of web.py works perfectly on Python 3.x.
I personally tested Python 3.6
The code is as follows:
import pymysql
pymysql.install_as_MySQLdb()
import web
db = web.database(dbn='mysql', host='db_host', port=3306,
user='root', pw='password', db='db_name', charset='utf8')
results = db.query('select * from user where id = 1;')
for user in results:
print(user.name)
print(user.id_no)
Hopefully this article will help those of you who are looking for web.py available on Python 3.x.
Read More:
- Running Python 3.7 web.py Runtimeerror: generator raised stopiteration exception occurred during test
- module ‘win32com.gen_py.00020813-0000-0000-C000-000000000046x0x1x9‘ has no attribute ‘CLSIDToClassMa
- ERROR: Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-install-zsbbp6ce/mysq
- About Python setup.py Install error
- Python how does a. Py file call classes and functions in another. Py file
- PY3 install box2d PY
- Mac install pycurl error: python setup.py egg_info" failed with error code 1”
- Error encountered while executing PIP install: error: complete output from command Python setup.py egg_ info:
- Error: command error out with exit status 1: Python when installing mysqlclient in django2.0 setup.py egg_ info
- Error in Maven packaging web project: webxml attribute is required (or pre existing WEB-INF)/ web.xml if executing in update)
- Command “python setup.py egg_info” failed with error code 1 in /private/var/folders/14/4hz051qx0wqd3
- Error: command error out with exit status 1: Python when installing mysqlclient in centos7 setup.py egg_ info Check
- web.xml Web app error in file
- Running setup.py install for sasl … error
- Ubuntu has solved the error of h5py installation: building wheel for h5py( setup.py )… or error: failed building wheel for h5py
- Install. Net Framework 3.5 error 0x800f0950 in Windows 10
- The web project removal server reports an error, and the web project in eclipse cannot be automatically deployed to Tomcat
- 53 Command “python setup.py egg_info“ failed with error
- RuntimeError: Expected hidden[0] size (x, x, x), got(x, x, x)
- Fatal Python error: Py_Initialize: unable to load the file system codec.