问题
How do I set the command run tool for a second environment of python in Komodo Edit?
By default the windows environmentals guide Komodo to X:\folder1\Anaconda\python.exe
(py version 3.7.4, MKL 2019.10(service 2.3.0).
Let say I have: X:\folder1\Anaconda\envs\MKL2018
and includes python version 3.6.4. and MKL 2018.0.2 (service 1.1.2) From below cmd-line instructions at the Anaconda command prompt I get the expected result:
conda activate MKL2018
python X:\folder2\Examples\LookupTable.py
File : LookupTable.py | "python version" : 3.7.4.
..snippet...
But not from the editor when I try to implement the python path to X:\folder1\Anaconda\envs\MKL2018
. Changing %(python3)
to %(X:\folder1\Anaconda\envs\MKL2018\python3)
doesn't work.
The ktf-file I have is as follows:
komodo.doCommand('cmd_saveAll');
ko.run.output.kill(-1);
setTimeout(function(){
ko.run.runEncodedCommand(window, '%(python3) \"%F\" {\'cwd\': u\'%D\'}');
}, 100);
I assume I have to change something there and save the ktf under another name (e.g. mklpy)... but what to change?
回答1:
It was quite cumbersome to find a fitting short-cut solution (keeping it in the python3 environments) but if you don't use python version 2.x any longer and haven't installed it; the following can be done:
- Go to Edit\Preferences
- then under subheading "Languages" go to "Python" Default Python Interpreter
- here you select the right path, for example "X:\folder1\Anaconda\envs\MKL2018\python.exe"
- apply and close the tab.
Thereafter you can create a new ktf-file with:
komodo.doCommand('cmd_saveAll');
ko.run.output.kill(-1);
setTimeout(function(){
ko.run.runEncodedCommand(window, '%(python) \"%F\" {\'cwd\': u\'%D\'}');
}, 100);
... now keep in mind to use the '%(python)
instead of '%(python3)
... voila and you're done...
来源:https://stackoverflow.com/questions/59340807/how-to-set-and-run-different-python3-environment-versions-from-komodo-edit-while