Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python - Ubuntu install for SQLAlchemy not working

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...

like image 575
Jay Gattuso Avatar asked May 26 '12 07:05

Jay Gattuso


People also ask

Can I PIP install SQLAlchemy?

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.

How install SQLAlchemy in Linux?

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.

How do I download SQLAlchemy in Python?

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.

Does pandas install SQLAlchemy?

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.


1 Answers

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)

like image 140
mata Avatar answered Oct 06 '22 00:10

mata