Così ho installato Python 2.7 e setuptools sul mio laptop Windows 7. Ho anche installato Visual Studio 2008 Express e MySQL con gli strumenti di sviluppo.Compilare mysql-python su Windows con PIP
Sto cercando di installare MySQL-python tramite pip come:
pip install mysql-python
sto ottenendo gli errori di collegamento:
Creating library build\temp.win32-2.7\Release\_mysql.lib and object build\temp.win32-2.7\Release\_mysql.exp
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function __mysql_Exception
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function __mysql_Exception
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function __mysql_server_init
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function __mysql_server_end
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function __mysql_thread_safe
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function __mysql_ResultObject_Initialize
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function __mysql_ResultObject_Initialize
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function __mysql_ResultObject_Initialize
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function __mysql_ResultObject_Initialize
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function __mysql_ResultObject_Initialize
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function __mysql_ConnectionObject_Initialize
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function __mysql_ConnectionObject_Initialize
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function __mysql_ConnectionObject_Initialize
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function __mysql_ConnectionObject_Initialize
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function __mysql_ConnectionObject_close
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function __mysql_ConnectionObject_affected_rows
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function __mysql_debug
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function __mysql_ConnectionObject_dump_debug_info
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function __mysql_ConnectionObject_autocommit
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function __mysql_ConnectionObject_commit
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function __mysql_ConnectionObject_rollback
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function __mysql_ConnectionObject_next_result
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function __mysql_ConnectionObject_set_server_option
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function __mysql_ConnectionObject_sqlstate
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function __mysql_ConnectionObject_warning_count
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function __mysql_escape_string
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function __mysql_escape_string
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function __mysql_row_to_tuple
_mysql.obj : error LNK2019: unresolved external symbol __imp__strncpy referenced in function __mysql_row_to_dict
_mysql.obj : error LNK2019: unresolved external symbol __imp__strncat referenced in function __mysql_row_to_dict
_mysql.obj : error LNK2019: unresolved external symbol _memset referenced in function __mysql_row_to_dict_old
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function __mysql__fetch_row
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function __mysql_ResultObject_fetch_row
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function __mysql_ConnectionObject_change_user
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function __mysql_ConnectionObject_character_set_name
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function __mysql_ConnectionObject_set_character_set
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function __mysql_ConnectionObject_get_character_set_info
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function __mysql_get_client_info
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function __mysql_ConnectionObject_get_host_info
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function __mysql_ConnectionObject_get_proto_info
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function __mysql_ConnectionObject_get_server_info
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function __mysql_ConnectionObject_info
_mysql.obj : error LNK2019: unresolved external symbol _mysql_insert_id[email protected] referenced in function __mysql_ConnectionObject_insert_id
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function __mysql_ConnectionObject_kill
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function __mysql_ConnectionObject_ping
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function __mysql_ConnectionObject_query
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function __mysql_ConnectionObject_select_db
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function __mysql_ConnectionObject_shutdown
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function __mysql_ConnectionObject_stat
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function __mysql_ConnectionObject_thread_id
_mysql.obj : error LNK2019: unresolved external symbol __imp__sprintf referenced in function __mysql_ConnectionObject_repr
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function __mysql_ResultObject_data_seek
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function __mysql_ResultObject_row_seek
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function __mysql_ResultObject_row_seek
_mysql.obj : error LNK2019: unresolved external symbol [email protected] referenced in function __mysql_ResultObject_dealloc
LINK : error LNK2001: unresolved external symbol [email protected]
build\lib.win32-2.7\_mysql.pyd : fatal error LNK1120: 56 unresolved externals
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\BIN\\link.exe' failed with exit status 1120
Tutte le idee come risolvere questo problema? Grazie
Abbia un'occhiata a questi: http://stackoverflow.com/questions/9951260/the-python-module-psutil-failed-to-build-on-windows-7-vs2008sp1-environment http://stackoverflow.com/questions/18296525/build-python-package-with-c-bindings-in-windows-vc90-causes-lnk1181-fatal-erro http://stackoverflow.com/ a/12590280/3755171 –
Nessuna delle soluzioni collegate risolve il problema. – canadiancreed
C'è un motivo particolare per cui è necessario installare dall'origine? È più tipico su Windows installare moduli basati su C (come questo) in forma binaria precompilata, ad es. scarica da https://pypi.python.org/pypi/MySQL-python/1.2.5 e installa. L'unica volta che dovresti installare dal sorgente è se vuoi hackerare il codice C, ecc. –