I want to install Python and SQLAlchemy on Ubuntu. This is my command:
sudo easy_install sqlalchemy
But it has failed, what should I do?
The easiest way to install is by using Python Package Manager, pip. This utility is bundled with standard distribution of Python. Using the above command, we can download the latest released version of SQLAlchemy from python.org and install it to your system.
To check which version of sqlalchemy is installed, use pip show sqlalchemy or pip3 show sqlalchemy in your CMD/Powershell (Windows), or terminal (macOS/Linux/Ubuntu) to obtain the output major.
Flask-SQLAlchemy is an extension for Flask that adds support for SQLAlchemy to your application. It aims to simplify using SQLAlchemy with Flask by providing useful defaults and extra helpers that make it easier to accomplish common tasks.
SQLAlchemy is a library that facilitates the communication between Python programs and databases. Most of the times, this library is used as an Object Relational Mapper (ORM) tool that translates Python classes to tables on relational databases and automatically converts function calls to SQL statements.
Aha,sir,I can help you. First step,you should intall the MySql,like these:
sudo apt-get install mysql-server
sudo apt-get install mysql-client
sudo apt-get install libmysqlclient15-dev
Second step,install the python-mysqldb:
sudo apt-get install python-mysqldb
Third step,install the easy_install:
sudo wget http://peak.telecommunity.com/dist/ez_setup.py
sudo python ez_setup.py
Forth step,install the MySQL-Python:
sudo easy_install MySQL-Python
Finally,sqlalchemy:
sudo easy_install SQLAlchemy
sudo pip install flask-sqlalchemy
This installs the SQLAlchemy package for Flask.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With