Here is how to get Python 3 autocompletion to work in Anjuta 3.4.0 running on Xubuntu 12.04:
sudo apt-get install anjuta anjuta-extras python3 python3-pkg-resources
Download the latest version of rope for python3 from here: https://pypi.python.org/pypi/rope_py3k. Install rope (possibly adjust version number):
tar zxvf rope_py3k-0.9.4-1.tar.gz
cd rope_py3k-0.9.4-1/
sudo python3 setup.py install --prefix=/usr --install-lib=/usr/lib/python3/dist-packages
sudo ln /usr/lib/python3/dist-packages/rope_py3k-0.9.4_1-py3.2.egg-info /usr/lib/python3/dist-packages/rope-0.9.4_1-py3.2.egg-info
Now run python3
in command line and check that these statements are valid:
import rope
import pkg_resources
pkg_resources.get_distribution('rope').version
Now patch the autocomplete script to work under both Python 2 and 3 versions:
sudo nano /usr/lib/anjuta/anjuta-python-autocomplete.py
add the very first line:
from __future__ import print_function
then modify all print blahblah
commands to Python 3 syntax print(blahblah)
. The print
commands are at lines 124, 143 and 144.
Now start Anjuta and point Edit->Preferences->Python->Environment: to /usr/bin/python3
. Restart Anjuta and autocompletion should work.
If more debugging is needed, try running anjuta
from command line, get to the point where you expect autocompletion, and see the output in terminal. If it still complains about anjuta-python-autocomplete.py
, try running this script in python3
manually.