Python – How to make pip or easy_install use aliases

apache-2.2easy-installpippython

I have some trouble installing python-mysqldb.
The error I get is

E: Could not perform immediate configuration on 'gcc'. Please see man 5 apt.conf under APT::Immediate-Configure for details. (2)

So I tried installing it using pip or easy_install and then I get this error:

unable to execute i486-linux-gnu-gcc: No such file or directory

error: command 'i486-linux-gnu-gcc' failed with exit status 1

And then I found out that I actually can't use 'i486-linux-gnu-gcc' but after finding the file I noticed that there is no such command but there is 'i486-linux-gnu-gcc-4.3'

So I created an alias and when I try it it works but pip and easy_install still say that the command can't be found so I assumed that they don't use my aliases.
I tried to do an export but it says my identifier is not valid (while the alias works).

Please help me.

Edit:

just tried

env 'i486-linux-gnu-gcc=i486-linux-gnu-gcc-4.3' pip install mysql-python

and still the same error.

Best Answer

Your .bashrc is not sourced by other programs or scripts. So aliases are not available. They are usually just for your interactive shells. You could link to the real command:

 $ cd /path/to/your/gcc-bin
 $ ln -s i486-linux-gnu-gcc-4.3 i486-linux-gnu-gcc

The ln command probably needs root rights.

If the path is not in your $PATH you have to add it. Take a look here.