0

I had the impression that 2.7 was backwards compatible with 2.6?

I have a python program that I need to run on a server. I have developed it on a python version 2.7.6 and the server has python version 2.6.6.

What happens is that my program stops running when I run it on the server after a few minutes. I get the message: ' No handlers could be found for logger "sickle.app" ' and then it quits. However I get this message when I run the program locally to, but the program keeps running.

The way I run the program is that I send the program and its requirements to the server. Create a virtual environment and pip install -r requirements.txt and then run the program. So everything should be similar on the server as on the development computer.

Am I doing something wrong here?

Arash Saidi
  • 2,228
  • 20
  • 36
  • 1
    2.7 is backwards compatible with 2.6, but 2.6 is not necessarily forwards compatible with 2.7. You should probably try to target the issue that is causing the error. – Alexander O'Mara Jan 10 '15 at 19:45
  • 1
    Python 2.7 being backwards compatiple with 2.6 does not imply that 2.6 is forward compatible with 2.7. See here for the changes you must look out for: https://docs.python.org/3/whatsnew/2.7.html – devsnd Jan 10 '15 at 19:45
  • 1
    You're in a virtualenv, why not install the Python version the code is developed for? See: http://stackoverflow.com/questions/1534210/use-different-python-version-with-virtualenv – dylrei Jan 10 '15 at 19:50
  • @dylrei Well, the server only has Python version 2.6.6, so that's not possible really. – Arash Saidi Jan 10 '15 at 19:52
  • @ArashSaidi Look at the link I provided, it addresses the topic of how to set up a venv with a newer version of Python than what's installed. – dylrei Jan 10 '15 at 19:54
  • @dylrei Did not scroll down and see that. I will mark this as duplicate, thank you for helping! – Arash Saidi Jan 10 '15 at 20:27

1 Answers1

1

That's not what backwards compatible means. You can run a 2.6 script on 2.7, but if you try it the other way round you're likely to run into problems with new features added in 2.7.

If it didn't work like that, it would be impossible ever to add new features.

Daniel Roseman
  • 588,541
  • 66
  • 880
  • 895
  • I feel so stupid right now. It's late, I have a script I have to run before monday, and I'm really frustrated. I guess I just have to wait until the admin can upgrade python on the server... Thanks for answering! – Arash Saidi Jan 10 '15 at 19:47