Nie jesteś zalogowany.
Jeśli nie posiadasz konta, zarejestruj je już teraz! Pozwoli Ci ono w pełni korzystać z naszego serwisu. Spamerom dziękujemy!

Ogłoszenie

Prosimy o pomoc dla małej Julki — przekaż 1% podatku na Fundacji Dzieciom zdazyć z Pomocą.
Więcej informacji na dug.net.pl/pomagamy/.

#1  2008-12-01 12:31:43

  kondzio14 - Użytkownik

kondzio14
Użytkownik
Zarejestrowany: 2008-02-14

jak ustawić zmienną PATH/ instalacja modułu MySQLdb

Pytanie za 100 punktów..

Jak ustawić zmienną PATH do mysql, które instalowałem ze źródeł, tj. paczki: mysql-server mysql-common mysql-client jeśli nie widzę podkatalogu /bin w katalogu mysql'a ?

Ostatnio edytowany przez kondzio14 (2009-05-28 23:31:17)

Offline

 

#2  2008-12-01 13:43:34

  rychu - elektryk dyżurny

rychu
elektryk dyżurny
Skąd: gdańsk/kalmar
Zarejestrowany: 2004-12-28

Re: jak ustawić zmienną PATH/ instalacja modułu MySQLdb

zrobiłeś make install?


linux regd. user #248790

Offline

 

#3  2008-12-01 15:11:00

  kondzio14 - Użytkownik

kondzio14
Użytkownik
Zarejestrowany: 2008-02-14

Re: jak ustawić zmienną PATH/ instalacja modułu MySQLdb

Echh.. przepraszam za błąd.

Poprawka:
Instalowałem z repozytorium za pomocą 'aptitude'.

Kod:

$ whereis mysql
mysql: /usr/bin/mysql /etc/mysql /usr/share/mysql /usr/share/man/man1/mysql.1.gz

Ale w żadnym z tych katalogów nie mam podkatalogu /bin..

Ostatnio edytowany przez kondzio14 (2008-12-01 15:14:01)

Offline

 

#4  2008-12-01 15:15:33

  Yampress - Imperator

Yampress
Imperator
Zarejestrowany: 2007-10-18

Re: jak ustawić zmienną PATH/ instalacja modułu MySQLdb

a po co maja byc te katalogi bin w kazdym podkatalogu ?

Offline

 

#5  2008-12-01 15:56:34

  kondzio14 - Użytkownik

kondzio14
Użytkownik
Zarejestrowany: 2008-02-14

Re: jak ustawić zmienną PATH/ instalacja modułu MySQLdb

Nie, że mają być .. i nie w każdym a chociażby w jednym .. wydawało mnie się słuszne ustawić zmienną PATH podając ścieżkę do podkatalogu /bin.. Zatem czy tak samo będzie funkcjonowało ustawienie tej zmiennej w tych przypadkach:

Kod:

#1
export PATH=${PATH}:/usr/share/mysql/bin
#2
export PATH=${PATH}:/usr/share/

?

Ostatnio edytowany przez kondzio14 (2008-12-01 15:56:54)

Offline

 

#6  2008-12-01 16:12:26

  Minio - Użyszkodnik

Minio
Użyszkodnik
Skąd: Poznań, Polska
Zarejestrowany: 2007-12-22
Serwis

Re: jak ustawić zmienną PATH/ instalacja modułu MySQLdb

Plik wykonywalny mysql znajduje się w katalogu /usr/bin/ i właśnie ten katalog powinieneś mieć w PATH.

Nie masz? Dlaczego? Musiałeś coś zmienić, gdyż domyślnie jest.

Offline

 

#7  2008-12-01 18:26:26

  kondzio14 - Użytkownik

kondzio14
Użytkownik
Zarejestrowany: 2008-02-14

Re: jak ustawić zmienną PATH/ instalacja modułu MySQLdb

To chyba wygląda na to, że jest bo ...

Kod:

$ printenv | grep PATH
PATH=/usr/local/bin:/usr/bin:/bin:/usr/games

Więc pewnie nie na tym polega mój problem.. ech..

Offline

 

#8  2008-12-01 20:25:41

  Minio - Użyszkodnik

Minio
Użyszkodnik
Skąd: Poznań, Polska
Zarejestrowany: 2007-12-22
Serwis

Re: jak ustawić zmienną PATH/ instalacja modułu MySQLdb

Primo: echo $PATH.
Secundo: pewnie nie. Może jak go opiszesz ktoś będzie w stanie Ci pomóc, bo chwilowo wszystkie forumowe szklane kule są wypożyczone.

Offline

 

#9  2008-12-01 23:45:56

  kondzio14 - Użytkownik

kondzio14
Użytkownik
Zarejestrowany: 2008-02-14

Re: jak ustawić zmienną PATH/ instalacja modułu MySQLdb

Offline

 

#10  2008-12-02 00:06:59

  rychu - elektryk dyżurny

rychu
elektryk dyżurny
Skąd: gdańsk/kalmar
Zarejestrowany: 2004-12-28

Re: jak ustawić zmienną PATH/ instalacja modułu MySQLdb

a próbowałeś mysqldb z paczek?

apt-get install python-mysqldb


linux regd. user #248790

Offline

 

#11  2008-12-02 09:27:07

  kondzio14 - Użytkownik

kondzio14
Użytkownik
Zarejestrowany: 2008-02-14

Re: jak ustawić zmienną PATH/ instalacja modułu MySQLdb

Próbowałem.. tylko, że mam zainstalowanego Pythona w wersji 2.4(repo) i 2.5(źródła). I w efekcie nie widać MySQLdb zainstalowanego z repo..

Offline

 

#12  2008-12-02 09:54:58

  czadman - Bicycle repairman

czadman
Bicycle repairman
Skąd: Wrocław
Zarejestrowany: 2005-07-08

Re: jak ustawić zmienną PATH/ instalacja modułu MySQLdb

zależy którego pythona używasz, zainstaluj setuptool do pythona którego używasz i potem np.

Kod:

easy_install-2.5 MySQL-python

http://www.debian.org/logos/openlogo-nd-50.png

Offline

 

#13  2008-12-02 15:20:18

  kondzio14 - Użytkownik

kondzio14
Użytkownik
Zarejestrowany: 2008-02-14

Re: jak ustawić zmienną PATH/ instalacja modułu MySQLdb

Używam Pythona 2.5. Niestety dalej pokazuje komunikat m.in 'mysql_config not found', a oto całość:

Kod:

# easy_install-2.5 MySQL-python
Searching for MySQL-python
Reading http://pypi.python.org/simple/MySQL-python/
Reading http://sourceforge.net/projects/mysql-python
Reading http://sourceforge.net/projects/mysql-python/
Best match: MySQL-python 1.2.2
Downloading http://internap.dl.sourceforge.net/sourceforge/mysql-python/MySQL-python-1.2.2.tar.gz
Processing MySQL-python-1.2.2.tar.gz
Running MySQL-python-1.2.2/setup.py -q bdist_egg --dist-dir /tmp/easy_install-ymAeKv/MySQL-python-1.2.2/egg-dist-tmp-c0nuFV
sh: mysql_config: command not found
Traceback (most recent call last):
  File "/usr/bin/easy_install-2.5", line 8, in <module>
    load_entry_point('setuptools==0.6c8', 'console_scripts', 'easy_install-2.5')()
  File "/usr/lib/python2.5/site-packages/setuptools/command/easy_install.py", line 1671, in main
    with_ei_usage(lambda:
  File "/usr/lib/python2.5/site-packages/setuptools/command/easy_install.py", line 1659, in with_ei_usage
    return f()
  File "/usr/lib/python2.5/site-packages/setuptools/command/easy_install.py", line 1675, in <lambda>
    distclass=DistributionWithoutHelpCommands, **kw
  File "/usr/lib/python2.5/distutils/core.py", line 151, in setup
    dist.run_commands()
  File "/usr/lib/python2.5/distutils/dist.py", line 974, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python2.5/distutils/dist.py", line 994, in run_command
    cmd_obj.run()
  File "/usr/lib/python2.5/site-packages/setuptools/command/easy_install.py", line 211, in run
    self.easy_install(spec, not self.no_deps)
  File "/usr/lib/python2.5/site-packages/setuptools/command/easy_install.py", line 446, in easy_install
    return self.install_item(spec, dist.location, tmpdir, deps)
  File "/usr/lib/python2.5/site-packages/setuptools/command/easy_install.py", line 476, in install_item
    dists = self.install_eggs(spec, download, tmpdir)
  File "/usr/lib/python2.5/site-packages/setuptools/command/easy_install.py", line 655, in install_eggs
    return self.build_and_install(setup_script, setup_base)
  File "/usr/lib/python2.5/site-packages/setuptools/command/easy_install.py", line 930, in build_and_install
    self.run_setup(setup_script, setup_base, args)
  File "/usr/lib/python2.5/site-packages/setuptools/command/easy_install.py", line 919, in run_setup
    run_setup(setup_script, args)
  File "/usr/lib/python2.5/site-packages/setuptools/sandbox.py", line 27, in run_setup
    lambda: execfile(
  File "/usr/lib/python2.5/site-packages/setuptools/sandbox.py", line 63, in run
    return func()
  File "/usr/lib/python2.5/site-packages/setuptools/sandbox.py", line 29, in <lambda>
    {'__file__':setup_script, '__name__':'__main__'}
  File "setup.py", line 16, in <module>
  File "/tmp/easy_install-ymAeKv/MySQL-python-1.2.2/setup_posix.py", line 43, in get_config
  File "/tmp/easy_install-ymAeKv/MySQL-python-1.2.2/setup_posix.py", line 24, in mysql_config
EnvironmentError: mysql_config not found

Ostatnio edytowany przez kondzio14 (2008-12-02 15:20:59)

Offline

 

#14  2008-12-02 16:51:42

  czadman - Bicycle repairman

czadman
Bicycle repairman
Skąd: Wrocław
Zarejestrowany: 2005-07-08

Re: jak ustawić zmienną PATH/ instalacja modułu MySQLdb

Nie ma pliku mysql_config. Doinstaluj pakiet libmysqlclient15-dev


http://www.debian.org/logos/openlogo-nd-50.png

Offline

 

#15  2008-12-02 17:11:31

  kondzio14 - Użytkownik

kondzio14
Użytkownik
Zarejestrowany: 2008-02-14

Re: jak ustawić zmienną PATH/ instalacja modułu MySQLdb

Po wydaniu polecenia:

Kod:

easy_install-2.5 MySQL-python

wywaliło:

Kod:

# easy_install-2.5 MySQL-python
Searching for MySQL-python
Reading http://pypi.python.org/simple/MySQL-python/
Reading http://sourceforge.net/projects/mysql-python
Reading http://sourceforge.net/projects/mysql-python/
Best match: MySQL-python 1.2.2
Downloading http://internap.dl.sourceforge.net/sourceforge/mysql-python/MySQL-python-1.2.2.tar.gz
Processing MySQL-python-1.2.2.tar.gz
Running MySQL-python-1.2.2/setup.py -q bdist_egg --dist-dir /tmp/easy_install-m7gKyx/MySQL-python-1.2.2/egg-dist-tmp-Oqqegr
In file included from _mysql.c:29:
pymemcompat.h:10:20: error: Python.h: Nie ma takiego pliku ani katalogu
_mysql.c:30:26: error: structmember.h: Nie ma takiego pliku ani katalogu
In file included from /usr/include/mysql/mysql.h:47,
                 from _mysql.c:40:
/usr/include/sys/types.h:153: error: duplicate ‘unsigned’
/usr/include/sys/types.h:153: error: two or more data types in declaration specifiers
_mysql.c:64: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:65: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:66: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:67: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:68: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:69: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:70: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:71: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:72: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:73: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:74: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:77: error: expected specifier-qualifier-list before ‘PyObject_HEAD’
_mysql.c:87: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_mysql_ConnectionObject_Type’
_mysql.c:90: error: expected specifier-qualifier-list before ‘PyObject_HEAD’
_mysql.c:98: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_mysql_ResultObject_Type’
_mysql.c:107: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:229: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:320: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:338: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:361: error: expected declaration specifiers or ‘...’ before ‘PyObject’
_mysql.c:362: error: expected declaration specifiers or ‘...’ before ‘PyObject’
_mysql.c: In function ‘_mysql_ResultObject_Initialize’:
_mysql.c:364: error: ‘NULL’ undeclared (first use in this function)
_mysql.c:364: error: (Each undeclared identifier is reported only once
_mysql.c:364: error: for each function it appears in.)
_mysql.c:366: warning: initialization from incompatible pointer type
_mysql.c:368: error: ‘PyObject’ undeclared (first use in this function)
_mysql.c:368: error: ‘conv’ undeclared (first use in this function)
_mysql.c:368: error: invalid operands to binary *
_mysql.c:368: warning: statement with no effect
_mysql.c:372: warning: implicit declaration of function ‘PyArg_ParseTupleAndKeywords’
_mysql.c:372: error: ‘args’ undeclared (first use in this function)
_mysql.c:372: error: ‘kwargs’ undeclared (first use in this function)
_mysql.c:375: warning: implicit declaration of function ‘PyDict_New’
_mysql.c:375: warning: statement with no effect
_mysql.c:377: error: ‘_mysql_ResultObject’ has no member named ‘conn’
_mysql.c:377: error: expected expression before ‘)’ token
_mysql.c:377: error: invalid operands to binary *
_mysql.c:377: warning: statement with no effect
_mysql.c:378: warning: implicit declaration of function ‘Py_INCREF’
_mysql.c:379: error: ‘_mysql_ResultObject’ has no member named ‘use’
_mysql.c:379: warning: statement with no effect
_mysql.c:380: error: ‘Py_BEGIN_ALLOW_THREADS’ undeclared (first use in this function)
_mysql.c:380: warning: statement with no effect
_mysql.c:382: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:382: warning: passing argument 1 of ‘mysql_use_result’ from incompatible pointer type
_mysql.c:384: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:384: warning: passing argument 1 of ‘mysql_store_result’ from incompatible pointer type
_mysql.c:385: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:385: warning: statement with no effect
_mysql.c:386: error: ‘Py_END_ALLOW_THREADS’ undeclared (first use in this function)
_mysql.c:386: warning: statement with no effect
_mysql.c:388: error: ‘_mysql_ResultObject’ has no member named ‘converter’
_mysql.c:388: warning: implicit declaration of function ‘PyTuple_New’
_mysql.c:388: warning: statement with no effect
_mysql.c:392: error: ‘_mysql_ResultObject’ has no member named ‘nfields’
_mysql.c:392: warning: statement with no effect
_mysql.c:393: error: ‘_mysql_ResultObject’ has no member named ‘converter’
_mysql.c:396: error: ‘tmp’ undeclared (first use in this function)
_mysql.c:396: error: invalid operands to binary *
_mysql.c:396: error: ‘fun’ undeclared (first use in this function)
_mysql.c:396: warning: left-hand operand of comma expression has no effect
_mysql.c:396: warning: statement with no effect
_mysql.c:397: warning: implicit declaration of function ‘PyInt_FromLong’
_mysql.c:397: warning: statement with no effect
_mysql.c:399: warning: implicit declaration of function ‘PyObject_GetItem’
_mysql.c:399: warning: statement with no effect
_mysql.c:400: warning: implicit declaration of function ‘Py_DECREF’
_mysql.c:402: warning: implicit declaration of function ‘PyErr_Clear’
_mysql.c:403: error: ‘Py_None’ undeclared (first use in this function)
_mysql.c:403: warning: statement with no effect
_mysql.c:406: warning: implicit declaration of function ‘PySequence_Check’
_mysql.c:407: warning: implicit declaration of function ‘PySequence_Size’
_mysql.c:408: error: ‘fun2’ undeclared (first use in this function)
_mysql.c:408: error: invalid operands to binary *
_mysql.c:408: warning: statement with no effect
_mysql.c:410: error: ‘t’ undeclared (first use in this function)
_mysql.c:410: error: invalid operands to binary *
_mysql.c:410: warning: implicit declaration of function ‘PySequence_GetItem’
_mysql.c:410: warning: statement with no effect
_mysql.c:412: warning: implicit declaration of function ‘PyTuple_Check’
_mysql.c:413: warning: implicit declaration of function ‘PyTuple_GET_SIZE’
_mysql.c:415: error: ‘pmask’ undeclared (first use in this function)
_mysql.c:415: error: invalid operands to binary *
_mysql.c:415: warning: statement with no effect
_mysql.c:416: warning: implicit declaration of function ‘PyTuple_GET_ITEM’
_mysql.c:416: warning: statement with no effect
_mysql.c:417: warning: statement with no effect
_mysql.c:418: warning: implicit declaration of function ‘PyInt_Check’
_mysql.c:419: warning: implicit declaration of function ‘PyInt_AS_LONG’
_mysql.c:433: warning: statement with no effect
_mysql.c:436: warning: statement with no effect
_mysql.c:438: warning: implicit declaration of function ‘PyTuple_SET_ITEM’
_mysql.c:438: error: ‘_mysql_ResultObject’ has no member named ‘converter’
_mysql.c: In function ‘_mysql_ResultObject_clear’:
_mysql.c:462: warning: implicit declaration of function ‘Py_XDECREF’
_mysql.c:462: error: ‘_mysql_ResultObject’ has no member named ‘converter’
_mysql.c:463: error: ‘_mysql_ResultObject’ has no member named ‘converter’
_mysql.c:463: error: ‘NULL’ undeclared (first use in this function)
_mysql.c:463: warning: statement with no effect
_mysql.c:464: error: ‘_mysql_ResultObject’ has no member named ‘conn’
_mysql.c:465: error: ‘_mysql_ResultObject’ has no member named ‘conn’
_mysql.c:465: warning: statement with no effect
_mysql.c: At top level:
_mysql.c:472: error: expected declaration specifiers or ‘...’ before ‘PyObject’
_mysql.c:473: error: expected declaration specifiers or ‘...’ before ‘PyObject’
_mysql.c: In function ‘_mysql_ConnectionObject_Initialize’:
_mysql.c:475: error: ‘NULL’ undeclared (first use in this function)
_mysql.c:475: warning: initialization from incompatible pointer type
_mysql.c:476: error: ‘PyObject’ undeclared (first use in this function)
_mysql.c:476: error: ‘conv’ undeclared (first use in this function)
_mysql.c:476: error: invalid operands to binary *
_mysql.c:476: warning: statement with no effect
_mysql.c:477: error: ‘ssl’ undeclared (first use in this function)
_mysql.c:477: error: invalid operands to binary *
_mysql.c:477: warning: statement with no effect
_mysql.c:479: warning: initialization from incompatible pointer type
_mysql.c:479: warning: initialization from incompatible pointer type
_mysql.c:479: warning: initialization from incompatible pointer type
_mysql.c:480: warning: initialization from incompatible pointer type
_mysql.c:480: warning: initialization from incompatible pointer type
_mysql.c:482: warning: initialization from incompatible pointer type
_mysql.c:482: warning: initialization from incompatible pointer type
_mysql.c:482: warning: initialization from incompatible pointer type
_mysql.c:483: warning: initialization from incompatible pointer type
_mysql.c:483: warning: initialization from incompatible pointer type
_mysql.c:493: error: initializer element is not constant
_mysql.c:493: error: (near initialization for ‘kwlist[16]’)
_mysql.c:496: warning: initialization from incompatible pointer type
_mysql.c:497: warning: initialization from incompatible pointer type
_mysql.c:498: warning: initialization from incompatible pointer type
_mysql.c:500: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’
_mysql.c:500: warning: statement with no effect
_mysql.c:501: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:501: warning: statement with no effect
_mysql.c:502: warning: implicit declaration of function ‘_mysql_Exception’
_mysql.c:503: error: ‘args’ undeclared (first use in this function)
_mysql.c:503: error: ‘kwargs’ undeclared (first use in this function)
_mysql.c:517: warning: statement with no effect
_mysql.c:524: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’
_mysql.c:524: warning: statement with no effect
_mysql.c:532: error: ‘value’ undeclared (first use in this function)
_mysql.c:532: error: invalid operands to binary *
_mysql.c:532: warning: statement with no effect
_mysql.c:533: warning: implicit declaration of function ‘PyMapping_GetItemString’
_mysql.c:533: warning: statement with no effect
_mysql.c:533: warning: implicit declaration of function ‘PyString_AsString’
_mysql.c:533: warning: assignment makes pointer from integer without a cast
_mysql.c:534: warning: statement with no effect
_mysql.c:534: warning: assignment makes pointer from integer without a cast
_mysql.c:535: warning: statement with no effect
_mysql.c:535: warning: assignment makes pointer from integer without a cast
_mysql.c:536: warning: statement with no effect
_mysql.c:536: warning: assignment makes pointer from integer without a cast
_mysql.c:537: warning: statement with no effect
_mysql.c:537: warning: assignment makes pointer from integer without a cast
_mysql.c:545: error: ‘Py_BEGIN_ALLOW_THREADS’ undeclared (first use in this function)
_mysql.c:545: warning: statement with no effect
_mysql.c:546: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:546: warning: passing argument 1 of ‘mysql_init’ from incompatible pointer type
_mysql.c:549: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:550: warning: passing argument 1 of ‘mysql_options’ from incompatible pointer type
_mysql.c:553: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:553: warning: passing argument 1 of ‘mysql_options’ from incompatible pointer type
_mysql.c:557: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:557: warning: passing argument 1 of ‘mysql_options’ from incompatible pointer type
_mysql.c:558: warning: comparison of distinct pointer types lacks a cast
_mysql.c:559: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:559: warning: passing argument 1 of ‘mysql_options’ from incompatible pointer type
_mysql.c:560: warning: comparison of distinct pointer types lacks a cast
_mysql.c:561: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:561: warning: passing argument 1 of ‘mysql_options’ from incompatible pointer type
_mysql.c:562: warning: comparison of distinct pointer types lacks a cast
_mysql.c:563: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:563: warning: passing argument 1 of ‘mysql_options’ from incompatible pointer type
_mysql.c:566: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:566: warning: passing argument 1 of ‘mysql_options’ from incompatible pointer type
_mysql.c:570: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:571: warning: passing argument 1 of ‘mysql_ssl_set’ from incompatible pointer type
_mysql.c:574: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:575: warning: passing argument 1 of ‘mysql_real_connect’ from incompatible pointer type
_mysql.c:577: error: ‘Py_END_ALLOW_THREADS’ undeclared (first use in this function)
_mysql.c:577: warning: statement with no effect
_mysql.c:589: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:589: warning: statement with no effect
_mysql.c: At top level:
_mysql.c:647: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c: In function ‘_mysql_ConnectionObject_clear’:
_mysql.c:679: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’
_mysql.c:680: error: ‘_mysql_ConnectionObject’ has no member named ‘converter’
_mysql.c:680: error: ‘NULL’ undeclared (first use in this function)
_mysql.c:680: warning: statement with no effect
_mysql.c: At top level:
_mysql.c:687: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:715: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:731: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:749: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:768: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:794: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:816: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:848: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:874: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:901: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:916: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:933: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:949: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:967: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1002: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1033: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1035: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1065: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1095: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1129: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1161: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1197: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1221: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1246: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1271: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1310: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1349: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1354: error: expected declaration specifiers or ‘...’ before ‘PyObject’
_mysql.c:1357: error: expected declaration specifiers or ‘...’ before ‘_PYFUNC’
_mysql.c: In function ‘_mysql__fetch_row’:
_mysql.c:1363: error: ‘PyObject’ undeclared (first use in this function)
_mysql.c:1363: error: ‘v’ undeclared (first use in this function)
_mysql.c:1363: error: invalid operands to binary *
_mysql.c:1363: warning: statement with no effect
_mysql.c:1364: error: ‘_mysql_ResultObject’ has no member named ‘use’
_mysql.c:1365: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:1365: warning: passing argument 1 of ‘mysql_fetch_row’ from incompatible pointer type
_mysql.c:1367: error: ‘Py_BEGIN_ALLOW_THREADS’ undeclared (first use in this function)
_mysql.c:1367: warning: statement with no effect
_mysql.c:1368: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:1368: warning: passing argument 1 of ‘mysql_fetch_row’ from incompatible pointer type
_mysql.c:1369: error: ‘Py_END_ALLOW_THREADS’ undeclared (first use in this function)
_mysql.c:1369: warning: statement with no effect
_mysql.c:1371: error: ‘_mysql_ResultObject’ has no member named ‘conn’
_mysql.c:1371: error: ‘_mysql_ConnectionObject’ has no member named ‘connection’
_mysql.c:1371: warning: passing argument 1 of ‘mysql_errno’ from incompatible pointer type
_mysql.c:1372: error: ‘_mysql_ResultObject’ has no member named ‘conn’
_mysql.c:1376: warning: implicit declaration of function ‘_PyTuple_Resize’
_mysql.c:1376: error: ‘r’ undeclared (first use in this function)
_mysql.c:1379: warning: implicit declaration of function ‘convert_row’
_mysql.c:1379: warning: statement with no effect
_mysql.c: At top level:
_mysql.c:1397: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1476: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1504: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1526: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1566: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1595: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1610: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1625: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1640: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1656: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1691: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1709: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1732: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1749: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1765: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1794: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1817: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1847: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1869: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1896: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1917: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1958: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:1978: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c: In function ‘_mysql_ConnectionObject_dealloc’:
_mysql.c:2012: error: ‘PyObject’ undeclared (first use in this function)
_mysql.c:2012: error: ‘o’ undeclared (first use in this function)
_mysql.c:2012: error: invalid operands to binary *
_mysql.c:2012: warning: statement with no effect
_mysql.c:2015: error: ‘_mysql_ConnectionObject’ has no member named ‘open’
_mysql.c:2016: warning: implicit declaration of function ‘_mysql_ConnectionObject_close’
_mysql.c:2016: error: ‘NULL’ undeclared (first use in this function)
_mysql.c:2016: warning: statement with no effect
_mysql.c:2019: warning: implicit declaration of function ‘PyMem_Free’
_mysql.c: At top level:
_mysql.c:2022: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:2039: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:2054: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:2076: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c: In function ‘_mysql_ResultObject_dealloc’:
_mysql.c:2098: error: ‘_mysql_ResultObject’ has no member named ‘result’
_mysql.c:2098: warning: passing argument 1 of ‘mysql_free_result’ from incompatible pointer type
_mysql.c: At top level:
_mysql.c:2103: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:2113: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_mysql_ConnectionObject_methods’
_mysql.c:2328: error: array type has incomplete element type
_mysql.c:2329: error: ‘T_INT’ undeclared here (not in a function)
_mysql.c:2329: warning: implicit declaration of function ‘offsetof’
_mysql.c:2329: error: expected expression before ‘_mysql_ConnectionObject’
_mysql.c:2329: error: ‘RO’ undeclared here (not in a function)
_mysql.c:2336: error: ‘T_OBJECT’ undeclared here (not in a function)
_mysql.c:2336: error: expected expression before ‘_mysql_ConnectionObject’
_mysql.c:2343: error: ‘T_UINT’ undeclared here (not in a function)
_mysql.c:2343: error: expected expression before ‘_mysql_ConnectionObject’
_mysql.c:2350: error: expected expression before ‘_mysql_ConnectionObject’
_mysql.c:2357: error: expected expression before ‘_mysql_ConnectionObject’
_mysql.c:2364: error: ‘NULL’ undeclared here (not in a function)
_mysql.c:2367: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_mysql_ResultObject_methods’
_mysql.c:2419: error: array type has incomplete element type
_mysql.c:2420: error: expected expression before ‘_mysql_ResultObject’
_mysql.c:2430: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:2458: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:2488: error: expected declaration specifiers or ‘...’ before ‘PyObject’
_mysql.c: In function ‘_mysql_ConnectionObject_setattr’:
_mysql.c:2490: error: ‘v’ undeclared (first use in this function)
_mysql.c:2491: warning: implicit declaration of function ‘PyErr_SetString’
_mysql.c:2491: error: ‘PyExc_AttributeError’ undeclared (first use in this function)
_mysql.c:2496: warning: implicit declaration of function ‘PyMember_Set’
_mysql.c: At top level:
_mysql.c:2513: error: expected declaration specifiers or ‘...’ before ‘PyObject’
_mysql.c: In function ‘_mysql_ResultObject_setattr’:
_mysql.c:2515: error: ‘v’ undeclared (first use in this function)
_mysql.c:2516: error: ‘PyExc_AttributeError’ undeclared (first use in this function)
_mysql.c: At top level:
_mysql.c:2534: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_mysql_ConnectionObject_Type’
_mysql.c:2618: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_mysql_ResultObject_Type’
_mysql.c:2704: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_mysql_methods’
_mysql.c:2776: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
_mysql.c:2808: warning: return type defaults to ‘int’
_mysql.c: In function ‘DL_EXPORT’:
_mysql.c:2808: error: expected declaration specifiers before ‘init_mysql’
_mysql.c:2886: error: expected ‘{’ at end of input
error: Setup script exited with error: command 'gcc' failed with exit status 1

Ale udało się ze źródeł w ten sposób:

Kod:

$ python setup.py build
$ python setup.py install

Teraz moduł się ładnie importuje .. dzięki wielkie czadman. Pozostaje tylko pytanie dlaczego nie chciało się zainstalować w pierwszy sposób..

Offline

 

#16  2009-05-27 13:44:58

  kondzio14 - Użytkownik

kondzio14
Użytkownik
Zarejestrowany: 2008-02-14

Re: jak ustawić zmienną PATH/ instalacja modułu MySQLdb

Witam, mam ten sam problem jak w temacie (no może nie do końca, bo chodzi o zainstalowanie modułu MySQLdb do Pythona) i powyżej z tym, że na innej maszynie.

Próbowałem paczek z repo, próbowałem easy_install, ale wypluwa podobne błędy jak wyżej, no i najbliżej mi do zainstalowania chyba ostatnią metodą tj.:

Mam źródła stąd (środkowy link): http://sourceforge.net/project/showfiles.php?group_ … ase_id=491012

Rozpakowałem, i będąc w katalogu jaki został utworzony wykonuję:

Kod:

python setup.py build
Traceback (most recent call last):
  File "setup.py", line 5, in <module>
    import ez_setup; ez_setup.use_setuptools()
  File "/home/kondzio14/MySQL-python-1.2.2/ez_setup.py", line 85, in use_setuptools
    import setuptools; setuptools.bootstrap_install_from = egg
zipimport.ZipImportError: can't decompress data; zlib not available

I pojawia się błąd jak powyżej... Szukałem po innych forach, ale problem pozostał. Jakieś pomysły?

Ostatnio edytowany przez kondzio14 (2009-05-27 14:32:10)

Offline

 

#17  2009-05-27 14:31:18

  Ryszard - Piwo DUG

Ryszard
Piwo DUG
Skąd: Zadupia
Zarejestrowany: 2006-06-30

Re: jak ustawić zmienną PATH/ instalacja modułu MySQLdb

zlib not available


http://img196.imageshack.us/img196/3770/freebsde.jpg

Offline

 

#18  2009-05-27 14:34:00

  kondzio14 - Użytkownik

kondzio14
Użytkownik
Zarejestrowany: 2008-02-14

Re: jak ustawić zmienną PATH/ instalacja modułu MySQLdb

No tak, to przeczytałem:

Kod:

i   gambas2-gb-compress-bzlib2              - The Gambas bzlib2 component
i   gambas2-gb-compress-zlib                - The Gambas zlib compression component
p   libcompress-raw-zlib-perl               - low-level interface to zlib compression library
p   libcompress-zlib-perl                   - Perl module for creation and manipulation of gzip
i   libghc6-zlib-dev                        - Compression and decompression in the gzip and zli
p   libghc6-zlib-doc                        - Compression and decompression in the gzip and zli
i   libghc6-zlib-prof                       - Compression and decompression in the gzip and zli
p   libio-compress-zlib-perl                - Perl interface to zlib
p   libio-zlib-perl                         - IO:: style interface to gzip/zlib compressed file
p   libjzlib-java                           - reimplementation of zlib in pure Java
p   libzlib-ruby                            - transitional dummy package
v   libzlib-ruby1.8                         -
i   zlib-bin                                - compression library - sample programs
p   zlib-gst                                - Zlib bindings for GNU Smalltalk
i   zlib1g                                  - compression library - runtime
i   zlib1g-dbg                              - compression library - development
i A zlib1g-dev                              - compression library - development
i   zlibc                                   - An on-fly auto-uncompressing C library

Offline

 

#19  2009-05-27 17:24:03

  kondzio14 - Użytkownik

kondzio14
Użytkownik
Zarejestrowany: 2008-02-14

Re: jak ustawić zmienną PATH/ instalacja modułu MySQLdb

Może pomogłoby gdybym w ten sposób wydał polecenie ./configure przed kompilacją Pythona (musi być samodzielnie skompilowany):

Kod:

./configure --with-zlib=/usr/include/

??

/usr/include/ - to ścieżka gdzie znajduje się plik zlib.h

Bo np. coś takiego odnośnie już modułu MySQLdb nic nie zmienia (nie wiem czy to w ogóle poprawne jest):

Kod:

python setup.py build --with-zlib=/usr/include/

Offline

 

#20  2009-05-27 18:08:13

  Ryszard - Piwo DUG

Ryszard
Piwo DUG
Skąd: Zadupia
Zarejestrowany: 2006-06-30

Re: jak ustawić zmienną PATH/ instalacja modułu MySQLdb


http://img196.imageshack.us/img196/3770/freebsde.jpg

Offline

 

#21  2009-05-28 14:11:50

  kondzio14 - Użytkownik

kondzio14
Użytkownik
Zarejestrowany: 2008-02-14

Re: jak ustawić zmienną PATH/ instalacja modułu MySQLdb

zlib'a zainstalowałem według opisu na podanej stronie, jednak ten sam błąd. Zatem pokusiłbym się o zainstalowanie wszystkiego wedle opisu ale przy MySQL komunikat: http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql- … patan.com.ar/

Nie mogę znaleźć .. tej paczki nigdzie ..

Offline

 

#22  2009-05-28 16:50:22

  kondzio14 - Użytkownik

kondzio14
Użytkownik
Zarejestrowany: 2008-02-14

Re: jak ustawić zmienną PATH/ instalacja modułu MySQLdb

Jest jakiś postęp.. tzn. po komendzie 'easy_install-2.5 MySQL-python-1.2.2' wyrzucał, że brak mu pewnych plików, więc zlokalizowałem, że powinny znajdować się w pakiecie 'python-dev' więc zainstalowałem z repozytorium.

I teraz:

Kod:

# easy_install-2.5 MySQL-python-1.2.2
Processing MySQL-python-1.2.2
Running setup.py -q bdist_egg --dist-dir /home/kondzio14/MySQL-python-1.2.2/egg-dist-tmp-HiB1R5
zip_safe flag not set; analyzing archive contents...
Removing MySQL-python 1.2.3c1 from easy-install.pth file
Adding MySQL-python 1.2.2 to easy-install.pth file

Installed /usr/lib/python2.5/site-packages/MySQL_python-1.2.2-py2.5-linux-i686.egg
Processing dependencies for MySQL-python==1.2.2
Finished processing dependencies for MySQL-python==1.2.2

No ale jeśli przykładowy skrypt uruchomię, najprościej:

Kod:

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import MySQLdb

To i tak nie widzi modułu:

$python proba.py
Traceback (most recent call last):
  File "proba.py", line 4, in <module>
    import MySQLdb
ImportError: No module named MySQLdb

Ostatnio edytowany przez kondzio14 (2009-05-28 16:51:49)

Offline

 

#23  2009-05-28 17:08:44

  czadman - Bicycle repairman

czadman
Bicycle repairman
Skąd: Wrocław
Zarejestrowany: 2005-07-08

Re: jak ustawić zmienną PATH/ instalacja modułu MySQLdb

Zobacz jaka jest domyślna wersja pythona w systemie. Być może inna niż 2.5. Poza tym raczej nie poleca się instalowania pakietów przez easy_install do katalogów systemowych. Lepiej zainstalować z pakietu debianiowego, albo utworzyć na ręcznie instalowane biblioteki inny katalog i dodać go do sys.path. Łatwiej później uprzątnąć ew. bałagan.


http://www.debian.org/logos/openlogo-nd-50.png

Offline

 

#24  2009-05-28 17:19:59

  kondzio14 - Użytkownik

kondzio14
Użytkownik
Zarejestrowany: 2008-02-14

Re: jak ustawić zmienną PATH/ instalacja modułu MySQLdb

W jaki sposób sprawdzić, która wersja jest wersją domyślną?

Offline

 

#25  2009-05-28 17:22:43

  czadman - Bicycle repairman

czadman
Bicycle repairman
Skąd: Wrocław
Zarejestrowany: 2005-07-08

Re: jak ustawić zmienną PATH/ instalacja modułu MySQLdb

wykonać polecenie python albo python -V ? :)


http://www.debian.org/logos/openlogo-nd-50.png

Offline

 

Stopka forum

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson
To nie jest tylko forum, to nasza mała ojczyzna ;-)