2014-07-12 88 views
-1

當我試圖安裝MYSQL-python到virtualenv在我的linux,我得到這些類型的錯誤。(fightvaw)是我的virtualenv。我tyr pip安裝mysql-python命令在virtualenv裏面安裝MYSQL-python。比如,我怎樣才能連接這個數據庫與Django?一些演示將有助於啓動我的項目。我如何安裝MYSQL-python數據庫在Django與virtualenv

(fightvaw)[email protected] /var/www/fightvaw $ pip install mysql-python 
    Downloading/unpacking mysql-python 
    Downloading MySQL-python-1.2.5.zip (108kB): 108kB downloaded 
    Running setup.py (path:/var/www/fightvaw/build/mysql-python/setup.py) egg_info for package mysql-python 
    sh: 1: mysql_config: not found 
    Traceback (most recent call last): 
    File "<string>", line 17, in <module> 
    File "/var/www/fightvaw/build/mysql-python/setup.py", line 17, in <module> 
    metadata, options = get_config() 
    File "setup_posix.py", line 43, in get_config 
    libs = mysql_config("libs_r") 
    File "setup_posix.py", line 25, in mysql_config 
    raise EnvironmentError("%s not found" % (mysql_config.path,)) 
    EnvironmentError: mysql_config not found 
    Complete output from command python setup.py egg_info: 
    sh: 1: mysql_config: not found 

    Traceback (most recent call last): 

    File "<string>", line 17, in <module> 

    File "/var/www/fightvaw/build/mysql-python/setup.py", line 17, in <module> 

    metadata, options = get_config() 

File "setup_posix.py", line 43, in get_config 

libs = mysql_config("libs_r") 

File "setup_posix.py", line 25, in mysql_config 

raise EnvironmentError("%s not found" % (mysql_config.path,)) 

EnvironmentError: mysql_config not found 

---------------------------------------- 
    Cleaning up... 
    Command python setup.py egg_info failed with error code 1 in  /var/www/fightvaw/build/mysql-python 
Storing debug log for failure in /home/ramesh/.pip/pip.log 
(fightvaw)[email protected] /va 
+0

你使用什麼操作系統?如果linux嘗試安裝'libmysqlclient-dev' –

+0

請勿將代碼放入'/ var/www /'中。 –

回答

1

您需要先安裝mysql本身,然後才能安裝Python庫。