如何安装pyinotify to python3.3环境?

时间:2013-11-24 06:35:56

标签: python

我在我的VPS中编译了PYTHON2.7和PYTHON3.3.3。 PYTHON2.7的编译是:

wget http://python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2
tar -jxvf Python-2.7.3.tar.bz2  
cd Python-2.7.3
./configure 
make            
make install  

PYTHON 3.3的编译:

wget http://python.org/ftp/python/3.3.3/Python-3.3.3.tar.bz2
tar -jxvf Python-3.3.3.tar.bz2  
cd Python-3.3.3
./configure --prefix=/usr/local/python-3.3.3
make            
make install 
ln -s /usr/local/python-3.3.3/bin/python3.3 /usr/local/bin/python3.3

as3:/usr/local/python-3.3.3/lib/python3.3# python3.3 letterpress.py ~/letterpress/press_folder
Traceback (most recent call last):
File "letterpress.py", line 27, in
import pyinotify
ImportError: No module named 'pyinotify'
as3:/usr/local/python-3.3.3/lib/python3.3# pip install pyinotify
Requirement already satisfied (use --upgrade to upgrade): pyinotify in /usr/local/lib/python2.7/site-packages/pyinotify-0.9.4-py2.7.egg
Cleaning up...
as3:/usr/local/python-3.3.3/lib/python3.3#

在上面,pyinotify安装到python2.7环境,现在如​​何安装pyinotify to python3.3 ENVIRONMENT?

2 个答案:

答案 0 :(得分:1)

一种方法是使用Python 3实例安装pip的第二个副本。然后使用pip为Python 3安装pynotify的副本。

答案 1 :(得分:0)

我自己解决了。 点击此处:https://github.com/seb-m/pyinotify

git clone https://github.com/seb-m/pyinotify.git
cd pyinotify
python3.3 setup.py install 

(因此我可以成功地将pyinotify安装到python3.3环境中)

或:

wget http://python-distribute.org/distribute_setup.py
python3.3 distribute_setup.py 

它会显示:

...
Installing easy_install script to /usr/local/python-3.3.3/bin
Installing easy_install-3.3 script to /usr/local/python-3.3.3/bin
...

/usr/local/python-3.3.3/bin/easy_install-3.3 pyinotify (因此我可以成功地将pyinotify安装到python3.3环境中)