简体   繁体   中英

compiler error when installing mysql-python on os x lion in a virtualenv

I've found 101 threads on this but no solutions for my actual problem.

Here's the situation. virtualenv, installed yolk, checked out my code into that env, the code includes django so don't have to install it into the env.

I've added the project location into the activate script.

The next step is to install mysql-python but that will fail. However the source is downloaded so I can edit setup_posix.py put the mysql_config location in and then retry.

So the command is

pip install mysql-python -E focus02

with focus02 being the env name.

The error message is this

lipo: can't open input file: /var/folders/38/bjgqwdxn37lb1ytw3qtmrwxc0000gp/T//ccTgPn2I.out (No such file or directory)

error: command 'llvm-gcc-4.2' failed with exit status 1

most of the stuff I've found online focuses on the last line of that, stating the compiler doesn't exist. I can prove this isn't the case by running llvm-gcc-4.2 in terminal. I get a response of

i686-apple-darwin11-llvm-gcc-4.2: no input files

I think the error is in the line above. Note the double slash before the file name. I can't find an article on google that shows that someone has found a fix. Anyone know where that line is drawing its input from, as I'm not sure where the issue is coming from. I'm assuming I've edited a file and left a trailing slash that I didn't need, though there's a few instances of this error that leads me to believe maybe not.

I've found this article and it's not fixed the problem.

just in case google brings anyone to this page in search of an answer i managed to solve this one this morning.

the fix is to link the right mysq_config in when trying to install mysql-python

so line 24 of setup_posix.py is the line that fails the install process as you intall python-mysql the first time. you need to fixup the line then rerun the pip install command.

line 24 is the link to mysql_config. when you're running MAMP the binaries for mysql_config won't work for this, so make sure you've downloaded the mysql source elsewhere, stored it on your path or added the folder to your path and then link it in correctly inside the setup_posix.py file before installing mysql-python.

hope this helps someone.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM