how to set and run different python3 environment versions from komodo edit while in anaconda\env?

半世苍凉 提交于 2019-12-25 01:37:58

问题


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:

  1. Go to Edit\Preferences
  2. then under subheading "Languages" go to "Python" Default Python Interpreter
  3. here you select the right path, for example "X:\folder1\Anaconda\envs\MKL2018\python.exe"
  4. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!