I have a CentOS server (rel6) that had python installed (2.6), but I needed a few features in 3.3+. I installed 3.3 into a seperate folder and made a symbolic link to execute it:
- I installed setup tools: yum install python-setuptools
- I installed a needed module"pandas" easy_install pandas
- I executed my pyton script, which encountered an error that required i use a newer version
- I downloaded and installed Python 3.3.5 to it's own folder so as to not override my default python
- wget http://www.python.org/ftp/python/3.3.5/Python-3.3.5.tar.xz
- tar xJf ./Python-3.3.5.tar.xz
- cd ./Python-3.3.5
- ./configure --prefix=/opt/python
- make install
- Made s symbolic link to allow me to execute this new python:
- ln -s /opt/python3.3/bin/python3.3 ~/bin/py
The problem is that when I execute the python script with my new py alias, it does not have all the addons needed (explicitly MySQLdb) which the default install does.
How do i go about installing the MySQLdb module, or any for that matter, to be reachable or useable for the new Python 3.3.5 installation? Or is there a way to make the current modules in 2.6 available to 3.3.5 as well?
My virtual environment has the following installed
root@server [/]# source ./root/python3.3/bin/activate (python3.3)root@server [/]# (python3.3)root@server [/]# pip freeze MySQL-python==1.2.5 numpy==1.8.1 pandas==0.14.0 python-dateutil==2.2 pytz==2014.4 six==1.6.1
But when I execute the import, it still fails
(python3.3)root@server [/]# python3.3 -c "import MySQLdb" Traceback (most recent call last): File "<string>", line 1, in <module> ImportError: No module named 'MySQLdb'