Python3 support in Anjuta

I recently downloaded and installed Anjuta as a Python development tool. I am developing in Python 3.2.3 on the Ubuntu 12.04 platform.

Following the “Create a New Project” guidelines on the Gnome Dev Center website , I started following the instructions, but quickly realized that the project was using Python 2.7 (the default system).

I found the Python option in the "Edit Settings" section, but changing the path pointing to my required version of Python does not seem to have the desired effect. Now, every time I open Anjuta, a message appears about incorrectly configured paths.

I can not find information on the Internet about this.

Does anyone have experience configuring Anjuta for Python3? Please, help!

+5
source share
3 answers

Can an error message mention python-rope? If so, the error may be related to this library, not python per se .. I have on Ubuntu 12.04 and recently installed Anjuta and python3 and found a similar problem myself. I traced the error in python-rope lib Anjuta uses to autocomplete. I have python-rope installed from Ubuntu repositories, but the installed version only works for python2, so I had to manually install the python3 port from here , and installed it using 'sudo python3 setup.py install' (inside the lib library, of course) . After that, Anyuta stopped complaining.

Hope this helps.

+1
source

Python 3 Anjuta 3.4.0, Xubuntu 12.04:

sudo apt-get install anjuta anjuta-extras python3 python3-pkg-resources

python3 : https://pypi.python.org/pypi/rope_py3k. (, ):

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

python3 , :

import rope
import pkg_resources
pkg_resources.get_distribution('rope').version

script Python 2 3:

sudo nano /usr/lib/anjuta/anjuta-python-autocomplete.py

:

from __future__ import print_function

print blahblah Python 3 print(blahblah). print 124, 143 144.

Anjuta Edit- > Preferences- > Python- > Environment: to /usr/bin/python3. Anjuta .

, anjuta , , , . anjuta-python-autocomplete.py, script python3 .

+1

. . . execute. , python, . .py . , shebang

#!/usr/bin/python

#!/usr/bin/python3

- .

, .py , , .

, - .

He solved the problem for me. It took me a whole day of research, and I finally figured it out by reading the python manual at https://docs.python.org

Tons of great information in these documents, check them out!

Please let me know if this solves your problem.

+1
source

All Articles