How to change the version of python that pyscripter uses
Asked Answered
M

4

8

I am a newb with python and just learning what to do.

I am using pyscripter and have been for a while whilst learning.

I am now going through an online course which is taught in 2.6, yet my pyscripter uses the latest. I need to know how to change it to use an older version, I have seen replies about changing the PATH variable but not where it is or how to do it.

I have 3 versions of python on my machine, 25,26 and 33.

Mahla answered 17/6, 2013 at 19:37 Comment(1)
There is a much better answer to this question here : #6974854Gog
R
12

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.

Ronaldronalda answered 12/1, 2014 at 14:36 Comment(0)
S
1

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

enter image description here

Songful answered 21/6, 2013 at 1:11 Comment(0)
P
0

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.

Panfish answered 30/4, 2018 at 18:35 Comment(0)
A
0

Run->Python Versions -> setup Python Versions -> Add... select folder

p.s. python 3.7.3 - ok, still python 3.10.5 could not be identified by PyScripter in such a way (actually works with WAY_1 Solution in this thread but pip install under such env. not succeed afterwards)

Assert answered 2/8, 2022 at 11:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.