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
To use different interpreters on pycharm is easy, follow these steps bellow:
To change the interpreter, you need to follow this another steps
After these steps, you can change the interpreter any time.
Not sure if this applies in Community Edition, but in Professional, this is straightforward. We use it to have a separately managed virtualenv + interpreter for each of several Google Cloud Functions under the same Git + PyCharm projects.
Assuming you have a project structure like mine:
myproject
│ ├── function1
│ │ ├── requirements.txt
│ │ └── main.py
│ └── function2
│ ├── requirements.txt
│ └── main.py
├── README.md
myproject/venv
)
function1
and function2
.function1
) -> OK -> "Attach"open in a new window
instead of attach
, then close the new window and try again.myproject
and the subfolder function1
.
myproject/function1/venv
. These now act as totally independent interpreters and PyCharm plays nicely with both.function2
in my example.If everything went well, you'll notice that the subfolders are bolded, indicating that they are really separate projects.
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'])
This is actually possible with a bit of hacking.
$PROJECT/.idea/modules.xml
and add another module with a different name like this:<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/jobs.iml" filepath="$PROJECT_DIR$/.idea/jobs.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/synonymer.iml" filepath="$PROJECT_DIR$/.idea/synonymer.iml" />
</modules>
$PROJECT/.idea
.Caveat: This is a hack which has no GUI in pycharm. This could stop working at any upgrade to pycharm. However, I don't think it will for various reasons.