python-inotify 在linux上安裝,pythoninotify

來源:互聯網
上載者:User

python-inotify 在linux上安裝,pythoninotify
python-inotify 在linux上安裝0 下載

$ wget --no-check-certificate https://pypi.python.org/packages/source/p/pathlib/pathlib-1.0.1.tar.gz$ wget --no-check-certificate https://bitbucket.org/JanKanis/python-inotify/get/2193c8bdeb3b.zip

1 Ubuntu14.04

python2.7.6

gcc4.8.2

1.1 pathlib
$ cd pathlib-1.0.1$ sudo python setup.py install
1.2 python-inotify

$ cd JanKanis-python-inotify-2193c8bdeb3b$ sudo python setup.py install

1.3 測試
$ cd JanKanis-python-inotify-2193c8bdeb3b/examples$ python simple.py
2 RHEL6.4

python2.7.9

gcc-4.4.7

2.1 pathlib
# cd pathlib-1.0.1# python setup.py install
2.2 python-inotify
# cd JanKanis-python-inotify-2193c8bdeb3b# python setup.py install

出現IN_EXCL_UNLINK錯誤, 在JanKanis-python-inotify-2193c8bdeb3b/inotify/_inotify.c的開頭添加下面的代碼:

/* _inotify.c */.../* Exclude events on unlinked objects. */#ifndef IN_EXCL_UNLINK#  define IN_EXCL_UNLINK  0x04000000#endif

3 RHEL5.4

python2.5

gcc-4.1.x

3.1 首先升級python1) 從源碼安裝依賴zlib-devel:

## get zlib-devel source and build install it$ wget --no-check-certificate http://zlib.net/zlib-1.2.8.tar.gz$ tar -zxf zlib-1.2.8.tar.gz$ cd zlib-1.2.8$ ./configure$ make && make install#### /usr/local/include/zlib.h zconf.h

2) 從源碼安裝依賴python-devel:

$ wget --no-check-certificate https://www.python.org/ftp/python/2.7.9/Python-2.7.9.tgz$ tar -zxf Python-2.7.9.tgz$ cd Python-2.7.9$ ./configure -–with-zlib=/usr/local/include --enable-unicode=ucs4$ make && make install## test:$ python>>> import zlib
--enable-unicode=ucs4太重要了, 如果不指定這個, 安裝python-inotify後運行測試程式simple.py時會出現錯誤:

ERROR: undefined symbol: PyUnicodeUCS4_FromFormat

3.2 安裝python-inotify

參考2.1, 2,2.

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.