0

I currently have python 2.6 (default) installed on my VPS (Plesk). I have also installed python 2.7 which is the version I want to use 99% of the time. I need to install python-dev on python 2.7 but running

sudo apt-get install python-dev

installs under python 2.6

How do I install python-dev for python 2.7?

PrestonDocks
  • 4,851
  • 9
  • 47
  • 82

1 Answers1

0

Just try sudo apt-get install python2.7-dev. Before doing this, don't miss to get your apt repository fresh! sudo apt-get update

If you're going to use different python envrionment, I strongly recommend you to use virtualenv.

Younggun Kim
  • 938
  • 10
  • 26
  • Thanks,that worked. On a more general note and the main source of my problem how do I install packages on a none default version of Python. i.e sudo apt-get install MySQLdb-python installs under 2.6 how do I force it to install under python2.7? – PrestonDocks Feb 23 '14 at 21:00
  • That's why I recommend you to use virtualenv. I think [this](http://stackoverflow.com/questions/1534210/use-different-python-version-with-virtualenv) is very useful to you. ;) – Younggun Kim Feb 23 '14 at 21:03