0

I have a python 3.5x virtualenv, I have some older python 2.7 scripts I'd like to run inside this python 3.5x virtualenv, but obviously the two environments 2.7 vs 3x scripts are really different from simple things like print "" to print() to much more involved things.

Thus, how can I run these python 2.7 scripts inside this python 3.5 env (best case) without having to completely re-write these python 2.7 scripts (worse case) or would I have to run these python 2.7 scripts inside their own virtualenv (somewhat worse case) or something else entirely?

Thank you in advance

Jshee
  • 2,620
  • 6
  • 44
  • 60
  • 1
    Possible duplicate of [Installing python3 in a python2 virtual environment](http://stackoverflow.com/questions/41390053/installing-python3-in-a-python2-virtual-environment) – e4c5 Jan 06 '17 at 14:31
  • though 2 and 3 are interchanged, it's still the same – e4c5 Jan 06 '17 at 14:31
  • 2
    Not sure of the complexity of your python scripts but you could look into this: https://docs.python.org/3.0/library/2to3.html It does the conversion for you if I understand the documentation correctly. – Michael Platt Jan 06 '17 at 14:33
  • @MichaelPlatt - I'll check this out too. Thanks! – Jshee Jan 06 '17 at 15:13

0 Answers0