I'm trying to setup a ubuntu box so I can do some work, and I'm having a heck of a time trying to get SQLAlchemy installed.
I have tried pretty much everything I can find on tutorials etc, and the latest position I find myself in is:
easy_install SQLAchemy
seems to work ok, and installs version 0.7.4 (as far as I can tell)
If I go into python and try import sqlalchemy
I get no module named sqlalchemy
I also found a script that lists all the modules on the version of python, and its not listed there.
I am brand new to Ubuntu, so I am feeling my way around in the dark a little bit. I'm on Python 2.7 32bit (fresh install) Ubuntu 12.04 (all up to date). Any suggestions?
EDIT: I looked in /usr/bin, and saw that there are three folders that might be relevant - python
, python2
and python2.7
this might be relevant...
Under Linux or Mac OS X, it's recommended to install SQLAlchemy inside a virtualenv using pip since it's more convenient than installing it from the source code. While under Windows, you have to install it from the source code using a system-wide Python installation.
Again, the easiest way to install SQLAlchemy is via pip. Next, we can install SQLAlchemy via pip. Then, we can install the various DBAPI drivers for PostgreSQL and MySQL (python-psycopg2, python-mysqldb). SQLAlchemy requires these modules if working with PostgreSQL and MySQL.
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.
Conclusion. In this article, I have explained in detail about the SQLAlchemy module that is used by pandas in order to read and write data from various databases. This module can be installed when you install pandas on your machine. However, you need to explicitly import it in your programs if you want to use it.
you could also use the version directly from the ubuntu repositories:
sudo apt-get install python-sqlalchemy # or python3-sqlalchemy
if you used sudo easy_install
, then the packages usually get installed in /usr/local/lib/pythonX.X/
. The problem could be that easy_install
(and also pip
) doesn't set the file premissions right, so everyting installed is only readable by root.
You can avoid this by using the --user
option when installing, then the packages are installed in the user site directory (~/.local/lib/pythonX.X
)
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