Question

I am attempting to use the tweepy api to make a twitter function and I have two issues. I have little experience with the terminal and Python in general.

1) It installed properly with Python 2.6, however I can't use it or install it with Python 3.1. When I attempt to install the module in 3.1 it gives me an error that there is no module setuptools. Originally I thought that perhaps I was unable to use tweepy module with 3.1, however in the readme it says "Python 3 branch (3.1)", which I assume means it is compatible. When I searched for the setuptools module, which I figured I could load into the new version, there was only modules for up to Python 2.7. How would I install the Tweepy api properly on Python 3.1?

2) My default Python when run from terminal is 2.6.1 and I would like to make it 3.1 so I don't have to type python3.1.

Was it helpful?

Solution

Install Distribute which is a compatible fork of setuptools that does support Python 3. When doing so, make sure you are using Python 3 instead of Python 2. Most Python 3 installations provide a symlimk or command named python3, whereas python refers to a Python 2 installation. Because of the incompatible differences between Python 2 and Python 3, it is recommended that you don't try to override this and have python refer to python3.

OTHER TIPS

Update: The comments below have some solid points against this technique.

2) What OS are you running? Generally, there is a symlink somewhere in your system, which points from 'python' to 'pythonx.x', where x.x is the version number preferred by your operating system. On Linux, there is a symlink /usr/bin/python, which points to (on Ubuntu 10.04) /usr/bin/python2.6 on a standard installation.

Just manually change the current link to point to the python3.1 binary, and you are fine.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top