How to change the version of python that pyscripter uses

巧了我就是萌 提交于 2019-12-01 03:43:06

I don't know if this is the best way to do it, but those are the two ways I did it:

WAY 1 (The best of two)
Go to PyScripter>>Tools>>Options...>>Custom Parameters... and add the following values

 1. PythonDir = C:\Program Files\CustomPythonInstallation
 2. PythonExe = C:\Program Files\CustomPythonInstallation\python.exe
 3. PythonVer = 3.3.3

 Note: Adapt the Name = Value pairs above to your case.

And close the window with OK button. Now select PyScripter>>Run>>Python Engine>>Remote and your are ready to go.

WAY 2 (The more temporary solution)
Go to PyScripter>>Run>>Configure External Run... set the "Application:" field to your python.exe file Close the window with OK button. Make sure you run your scripts with PyScripter>>Run>>External Run (Alt+F9)

I hope this helped, good luck.

The easiest way I know (on Windows) is, having used the installer executable, I select from the Start menu's PyScripter folder whichever version of Python I want to run.

  • You can modify the PYTHONPATH (under Pyscripter>>Tools, for instance)
  • You can modify your External Python Interpreter with Pyscripter>>Modify Tools>>Python &Interpreter>>Modify
  • You can modify the default Python engine used with Pyscripter>>Options>>IDE Options>>Python Interpreter>>Python Engine Type

You can simply redirect Pyscripter to see the environment of a different Python distribution.

In Windows, do this by assigning PYTHONDLLPATH in the Pyscripter shortcut. You can r-click on the shortcut, access its properties and then set the target to:

[Pyscripter executable dir] --PYTHONDLLPATH [Python distribution dir]

See this image to help you out: setting a shortcut target

For example, in my Win10 64-bit computer I have a Python 2.7.8 installation back from when I installed ArcGIS, which is automatically recognized by my 32-bit Pyscripter installation.

In the same computer, I also have Anaconda installed with two environments that feature two 64-bit Python distributions:

2.7.14 in "C:\ProgramData\Anaconda2"
3.6 in "C:\Users\bouzi\AppData\Local\conda\conda\envs\py3"

When I installed a 64-bit version of Pyscripter, that Pyscripter version couldn't even open, as it couldn't find the conda distributions. I had to point them to it by replacing the shortcut target to:

"C:\Program Files\PyScripterx64\PyScripter.exe" --PYTHONDLLPATH "C:\ProgramData\Anaconda2"

You can create three Pyscripter shortcuts that point to these different installations of Python within your system. It's probably not the optimal way to deal with this but it works, and allows you to combine Anaconda environments with Pyscripter.

You can also read more on opening non-standard python distributions with PyScripter from this link.

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