Python + Mysql-python 설치 질문입니다.

kihoori의 이미지

환경은 RedHat 7.3 이구여

APM을 DSO방식으로 설치를 하고 나서

Python-2.3.3.tgz
를 받아서 에러 없이 설치 하였습니다

그리고 cjkcodecs-1.0.3.tar.gz

또한 아무런 에러 없이 설치 하게 되었습니다..

그런데 MySQL-python-0.9.2.tar.gz 를 설치 하는데 다음과 같은 에러와 워닝이 납니다

Quote:

# python setup.py build
running build
running build_py
creating build
creating build/lib.linux-i686-2.3
copying CompatMysqldb.py -> build/lib.linux-i686-2.3
copying _mysql_exceptions.py -> build/lib.linux-i686-2.3
creating build/lib.linux-i686-2.3/MySQLdb
copying MySQLdb/__init__.py -> build/lib.linux-i686-2.3/MySQLdb
copying MySQLdb/converters.py -> build/lib.linux-i686-2.3/MySQLdb
copying MySQLdb/connections.py -> build/lib.linux-i686-2.3/MySQLdb
copying MySQLdb/cursors.py -> build/lib.linux-i686-2.3/MySQLdb
copying MySQLdb/sets.py -> build/lib.linux-i686-2.3/MySQLdb
copying MySQLdb/times.py -> build/lib.linux-i686-2.3/MySQLdb
creating build/lib.linux-i686-2.3/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.linux-i686-2.3/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.linux-i686-2.3/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-i686-2.3/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.linux-i686-2.3/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.linux-i686-2.3/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py -> build/lib.linux-i686-2.3/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.linux-i686-2.3/MySQLdb/constants
running build_ext
building '_mysql' extension
creating build/temp.linux-i686-2.3
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/mysql/include/mysql -I/usr/local/include/python2.3 -c _mysql.c -o build/temp.linux-i686-2.3/_mysql.o
_mysql.c: In function `_mysql_ConnectionObject_info':
_mysql.c:1150: warning: assignment discards qualifiers from pointer target type
_mysql.c: In function `_mysql_ConnectionObject_stat':
_mysql.c:1379: warning: assignment discards qualifiers from pointer target type
_mysql.c: At top level:
_mysql.c:2007: warning: initialization from incompatible pointer type
_mysql.c:2096: warning: initialization from incompatible pointer type
gcc -pthread -shared build/temp.linux-i686-2.3/_mysql.o -L/usr/local/mysql/lib/mysql -lmysqlclient_r -lz -o build/lib.linux-i686-2.3/_mysql.so
/usr/bin/ld: cannot find -lmysqlclient_r
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1

왠지 warning도 마니 나는것이 mysql설치가 잘못된것 같은데요.. 정확히 어떤점이 잘못되었는지 알수가 없네요 많은 분들의 도움바랍니다.. :oops:

ps. 파이썬 모임에 가서 설치 문서를 여러개 보았지만 모두 예전문서인듯 했습니다.
설정화일 생김새도 조금씩 틀리고 한데 저의 환경에 맞는 설치 문서의 링크도 같이 주셨으면 감사하겠습니다.. :D

feanor의 이미지

MySQL을 설치할 때 --enable-thread-safe-client 옵션을 주지 않으면 libmysqlclient_r 라이브러리가 생성되지 않습니다. mysql-python은 libmysqlclient_r 라이브러리를 필요로 합니다.

--feanor

kihoori의 이미지

우선 답변 주셔서 감사합니다..

가르쳐 주신데로 mysql을 다시 인스톨하였습니다..

하였더니 어찌어찌 해서 에러나며 아예 안되던것은 해결하였습니다

하지만 어떻게 된일인지

_mysql.c: In function `_mysql_ConnectionObject_info':
_mysql.c:1150: warning: assignment discards qualifiers from pointer target type
_mysql.c: In function `_mysql_ConnectionObject_stat':
_mysql.c:1379: warning: assignment discards qualifiers from pointer target type
_mysql.c: At top level:
_mysql.c:2007: warning: initialization from incompatible pointer type
_mysql.c:2096: warning: initialization from incompatible pointer type

이 warning들은 안없어지네요.. 그때문인지 여전히 mysql에는 연결이 안되네요..

이건 gcc의 문제일것 같은데 하.. 참 난감하고 그러네요..ㅜ.ㅜ

Quote:
# gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-113)
frenzy의 이미지

thread_safe_library 부분이 yes 되어 있으면, NO 또는 0 으로 변경한후에 다시 설치해 보세요.

.
++++++++++++++++++++++++++++++++++++++++++++++
혼자놀기의 도사가 되리라... http://geeklife.co.kr

kihoori의 이미지

헛.. 그렇게 고치니 되는군여... ;;;

import는 되는데

warning은 계속 나오는것이.. 아무레도 개발자의 오류인거 같은데.. 어찌 만져야 할지 모르겠네요..;;

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.