0

enter image description here

I am working with Ubuntu 14.4 Trusty Tahr LTS on EC2. I want to use the Python 3.4.0 interpreter which is installed by default. I want to be able to be able to add git repositories to be accessed by python3.4.

I previously ran:

~$ sudo apt-get -y install git-core

but this appears to associate git repos with python2.7 How can I associate them with python3.4?

1 Answer 1

2

There is a python library used to interact with Git repositories

It can be used in Fetching Remote Git Repo with Python, e.g..

There's also the old fashioned way

cd /path/to/git/repo
python3 my_favorite.py

But I think you will find Git to be Python version independent, and that possibly you want to associate Python code, files and extensions with Python 3.4 rather than 2.7, and that would be via mime.types

How is it determined which application is to open a file of specific mime-type?

How to change the default application for a given type of file in Ubuntu Linux

For example, I use Idlex as an IDE. I've added text/x-python=idlex3.desktop to the ~/.local/share/applications/mimeapps.list file. Now, double clicking on a Python file opens that file in the IDE to be looked at, edited, and/or run.

2
  • Thank you! Regarding gitorious.org/git-python. I havre to figure out how to get easy install for python 3 . I tried : sudo easy_install GitPython which installs in python2.7 directory. Feb 26, 2015 at 15:32
  • @user61629 there are some troubles with GitPython . e.g., util.py has a few parts needing modification for P3 and dependency gitdb doesn't play nicely. I'm a bit sorry I mentioned it.
    – Nodak
    Feb 26, 2015 at 16:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.