Multiple Python Interpreters used in the same project?

后端 未结 4 2163
甜味超标
甜味超标 2021-01-04 02:08

I am using pycharm and it only lets you use one interpreter for example Python 2.7.5 or Python 3.5.1.

The problem is I have certain modules one from google to access

4条回答
  •  清酒与你
    2021-01-04 03:03

    One idea is to write two seperate scripts; one for analytics and one for docxfactory. Decide which of these is the driver, and have that driver shell the other -- being sure to invoke the appropriate version of python.

    ex:

    #/usr/bin/env python2.7
    import subprocess
    # Do something with analytics
    # ...
    # Now call docxfactory script
    subprocess.call(['python3', 'docxcript.py'])
    

提交回复
热议问题