0
votes

I have several PyCharm projects, each customized with the applicable Python interpreter (2.6, 2.7, 3, etc.).

On a project that is almost Python 3 code, there is a single Python 2 script.

Can the settings be configured for this particular executable file to be interpreted with a Python 2 interpreter?

1

1 Answers

1
votes

You can run that Python 2 script, if it has a main, with a custom interpreter by creating a run configuration (eg. in the top menus, Run | Edit Configurations... for this particular file.

Now if there is Python 3 code in your project that depends on this Python 2 script, I don't believe you can run it, even when forgetting about Pycharm and just talking Python in general.