[英]HOW TO INSTALL pyinotify TO python3.3 ENVIRONMENT?
I compiled Python 2.7 and Python 3.3.3 in my VPS.我在 VPS 中编译了 Python 2.7 和 Python 3.3.3。 The compilation of Python 2.7 is:
Python 2.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
The compilation of Python 3.3 is: 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#
In the above, pyinotify is installed to Python 2.7 environment, now how can I install pyinotify to Python 3.3 environment?上面pyinotify是安装在Python 2.7环境下的,现在如何安装pyinotify到Python 3.3环境呢?
One way is to install a second copy of pip
using your Python 3 instance.一种方法是使用 Python 3 实例安装
pip
的第二个副本。 Then use that pip
to install a copy of pynotify
for Python 3.然后使用该
pip
为 Python 3 安装pynotify
的副本。
I solved it myself.我自己解决了。 Check here: https://github.com/seb-m/pyinotify
在这里查看: https : //github.com/seb-m/pyinotify
git clone https://github.com/seb-m/pyinotify.git
cd pyinotify
python3.3 setup.py install
(thus I can install pyinotify to python3.3 environment successfully) (这样我就可以成功安装pyinotify到python3.3环境了)
or:或:
wget http://python-distribute.org/distribute_setup.py
python3.3 distribute_setup.py
it will show:它会显示:
...
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 (thus I can install pyinotify to python3.3 environment successfully) /usr/local/python-3.3.3/bin/easy_install-3.3 pyinotify(这样我就可以成功安装pyinotify到python3.3环境了)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.