Install cython on python 3.x

6

1

I need to install cython for python3.x .I have an ubuntu installation with python 2.6, 2.7 and 3.2 on it. Trying to apt-get the cython package installs pymodules only in 2.x versions. Is there a way to target a specific version?

kaiseroskilo

Posted 2012-02-11T18:41:02.463

Reputation: 215

Answers

1

According to the Cython Wiki, you have a few choices for installing. One of them is:

sudo apt-get install python-dev build-essential

You can also download the latest version from Cython. Just untar/unzip the package, and then run (as superuser/sudo/root):

python setup.py install

Simon Sheehan

Posted 2012-02-11T18:41:02.463

Reputation: 8 641

The apt-get command did not install cython. I suppose that I should browse the cython source code for available options. As for the second, the python alias is bound to python2.7, should I try something like python3.2 setup.py install ? – kaiseroskilo – 2012-02-11T19:11:23.190

@kaiseroskilo you could try that, I don't believe it matters, it seems – Simon Sheehan – 2012-02-11T19:36:38.090

6

python 2 and 3 are in separate packages so for normal python 2.7.6

sudo apt-get install  cython

and for python3

sudo apt-get install  cython3

Scott Stensland

Posted 2012-02-11T18:41:02.463

Reputation: 334

0

Try this:

$ sudo apt-get update

$ sudo apt-get upgrade

$ sudo apt-get install python3-pip

$ pip3 install --no-cache-dir Cython

Find the version of Cython and check whether Cython is installed for Python3

$ python3 -c "import Cython; print(Cython.version)"

S Habeeb Ullah

Posted 2012-02-11T18:41:02.463

Reputation: 11