python wand安装_安装PythonMagick和pythonmagickwand 步骤
在centos6.0上測試安裝,安裝前準備工作:
###############################################################################
服務(wù)器如果沒有安裝Jpeg v6b、libPng、FreeType 的要在安裝imagemagick之前先裝好,否則imagemagick沒法讀取jpeg和png圖片,字體文
件也讀不了.
python的版本須>=2.6
需要升級python, 能在/usr/include/pythonX/下找到python.h文件
yum install python-devel -y
yum install ImageMagick* -y
yum install ImageMagick-devel ImageMagick-c++ ImageMagick-c++-devel -y? ****校驗一下 解決找不到MagickCore問題
查看ImageMagick的版本號
convert -version
安裝或升級boost
yum install boost*
yum install boost-python ##校驗boost-python是否安裝
###############################################################################
安裝PythonMagick
PythonMagick的下載地址
wget http://www.imagemagick.org/download/python/legacy/PythonMagick-0.9.3.tar.gz
wget http://www.imagemagick.org/download/python/PythonMagick-0.9.7.tar.gz
tar zxvf PythonMagick-0.9.7.tar.gz
tar zxvf PythonMagick-0.9.3.tar.gz
cd PythonMagick-0.9.7
./autogen.pl
mkdir /usr/local/python
./configure? #2012.2.12進行到此步了
make? ##時間漫長,耐心等待...
出現(xiàn)一些的問題:
_Image.cpp? -fPIC -DPIC -o .libs/libpymagick_la-_Image.o
_Image.cpp: In function ‘void Export_pyste_src_Image()’:
_Image.cpp:89: error: address of overloaded function with no contextual type information
_Image.cpp:90: error: address of overloaded function with no contextual type information
_Image.cpp:97: error: address of overloaded function with no contextual type information
_Image.cpp:114: error: address of overloaded function with no contextual type information
.............
make出錯了就make clean
然后
解決辦法:
從PythonMagick-0.9.3/pythonmagick_src/將以下文件cp到PythonMagick-0.9.7/pythonmagick_src/下覆蓋原有的
_Image.cpp
_DrawableDashArray.cpp
_DrawableMiterLimit.cpp
_DrawableViewbox.cpp
_Geometry.cpp
參考:http://www.geero.net/2011/03/install-pythonmagick-mac-os-x.html
./autogen.pl
./configure
make?##時間漫長,耐心等待...
在libtool: compile:? g++ -DHAVE_CONFIG_H -I. -I../config -I/usr/include/python2.6 -I/usr/include -fopenmp -
I/usr/include/ImageMagick -g -O2 -DBOOST_PYTHON_DYNAMIC_LIB -MT libpymagick_la-_Image.lo -MD -MP -MF .deps/libpymagick_la-
_Image.Tpo -c _Image.cpp? -fPIC -DPIC -o .libs/libpymagick_la-_Image.o
的時候慢點讓人無法忍受...干...
make install
成功安裝后的正確提示:
Libraries have been installed in:
/usr/local/lib64/python2.6/site-packages/PythonMagick
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
重要一步:
cp -rp? /usr/local/lib64/python2.6/site-packages/PythonMagick/ /usr/lib64/python2.6/site-packages/PythonMagick/
驗證是否已經(jīng)安裝上了PythonMagick
[root@localhost?~]#?python
Python?2.6.6?(r266:84292,?Dec??7?2011,?20:48:22)
[GCC?4.4.6?20110731?(Red?Hat?4.4.6-3)]?on?linux2
Type?"help",?"copyright",?"credits"?or?"license"?for?more?information.
>>>?import?PythonMagick
>>>
import無錯誤返回?表示模塊?PythonMagick安裝成功
也可以
[root@localhost ~]# pydoc -p2008
pydoc server ready at http://localhost:2008/
從瀏覽器看看支持的模塊
################################################################################
################################################################################
總結(jié)
以上是生活随笔為你收集整理的python wand安装_安装PythonMagick和pythonmagickwand 步骤的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 消防荷载楼板按弹性还是塑性计算_第二节
- 下一篇: character-level OCR之