0

I compiled Python 2.7 and Python 3.3.3 in my VPS. The compilation of Python 2.7 is:

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:

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?

Lorraine
  • 1,189
  • 14
  • 30
fisherman
  • 10,739
  • 5
  • 20
  • 16
  • ummm, may I ask what distribution are you using? https://launchpad.net/~fta/+archive/dev https://launchpad.net/~ubuntu-rebuilds/+archive/py3.3/+index?batch=75&memo=75&start=75 ubuntu has 3.3 python supported in their ppa – user1462442 Nov 24 '13 at 06:49
  • possible duplicate of [Flattening a shallow list in Python](http://stackoverflow.com/questions/406121/flattening-a-shallow-list-in-python) – oefe Nov 25 '13 at 21:52
  • @oefe. Are you sure you got the right duplicate? – ekhumoro Dec 20 '13 at 21:07
  • Oops, no, this doesn't make sense. Don't know what went wrong here, sorry. So I retracted my close vote. – oefe Dec 20 '13 at 21:36

2 Answers2

1

One way is to install a second copy of pip using your Python 3 instance. Then use that pip to install a copy of pynotify for Python 3.

Ned Deily
  • 83,389
  • 16
  • 128
  • 151
0

I solved it myself. Check here: 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)

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)

rgettman
  • 176,041
  • 30
  • 275
  • 357
fisherman
  • 10,739
  • 5
  • 20
  • 16