How does PyScripter find the installed Python version?

6,392 views
Skip to first unread message

Lübbe Onken

unread,
Jan 29, 2018, 9:31:09 AM1/29/18
to PyScripter
Hi folks,

I have a little problem getting up and running. I have installed
  • PyScripter v3.2.2 (32-Bit Version)
  • Python 2.7 (32-Bit Version) (installed in c:\Python27). python.exe is in the path

However when I start PyScripter I get a "PyScripter could not load a Python engine" error.

Does PyScripter search for python in a predefined location? If yes, how can I tell it where my python is installed?


Cheers & thanks

Lübbe

BBands

unread,
Jan 29, 2018, 11:14:11 AM1/29/18
to PyScripter Group
Not authoritative, but I am pretty sure the installer looks up Python instances in the registry.

      John

--
You received this message because you are subscribed to the Google Groups "PyScripter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyscripter+unsubscribe@googlegroups.com.
To post to this group, send email to pyscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/pyscripter.
For more options, visit https://groups.google.com/d/optout.

PyScripter

unread,
Jan 29, 2018, 12:52:20 PM1/29/18
to PyScripter
Indeed.  To use PyScripter with an unregistered version of Python create in the directory of the PyScripter executable a cmd file with the following 

SET PYTHONHOME=C:\Python27
PyScripter --PYTHON27 --PYTHONDLLPATH "C:\Python27"

and run PyScripter with this command file.

I am working on making the use of PyScripter with unregistered versions of python much easing in a forthcoming release.


On Monday, January 29, 2018 at 6:14:11 PM UTC+2, BBands wrote:
Not authoritative, but I am pretty sure the installer looks up Python instances in the registry.

      John

Lübbe Onken

unread,
Jan 30, 2018, 4:22:29 AM1/30/18
to PyScripter
Thanks for the help, but I'm not there yet.
At work I can't add a cmd/bat file to the installation directory (need admin rights). So I created a bat file outside with the following content:

SET PYTHONHOME=C:\Python27
pushd "C:\Program Files (x86)\PyScripter\"
"PyScripter.exe" --PYTHON27 --PYTHONDLLPATH "C:\Python27"
popd

Now I get the error "... Could not open python27.dll... " and PyScripter quits.

I have several python27.dlls on my PC but those came with different software that got installed. There is none in C:\Python27. I tried several of those paths and found one which lets Pyscripter start. It then complains about missing rpyc, but at least I can have a look at the GUI and hunt wrong translations :)

Cheers
Lübbe

PyScripter

unread,
Jan 30, 2018, 6:00:54 AM1/30/18
to PyScripter
Apparently C:\PYthon27 does not contain a working python installation.

By default PyScripter will search the registry for a registered Python installation.  Python versions from python.org but other installations such as Miniconda and Anaconda, give the option to register the installation either for "All Users" or for the "Current User".

A fallback if you have a non-registered python installation is to use the PYTHONDLLPATH command line option.  Here is an example.

a) I downloaded Miniconda 2.7 32 bit from https://conda.io/miniconda.html
b) Installed the downloaded file, choosing user installation and a non default install directory (F:\Miniconda2). In Advanced options I selected not to register the installation.
c) Created PyScripter.cmd in another directory containing

SET PYTHONHOME=F:\Miniconda2
pushd "C:\Program Files\PyScripter\"
"PyScripter.exe" --PYTHON27 --PYTHONDLLPATH "F:\Miniconda2"
popd
(this is a Widows 32 bit machine).

d) Double click the created cmd file in File Explorer and PyScripter loaded the installed Miniconda2 python as expected.

Lübbe Onken

unread,
Feb 2, 2018, 3:36:59 AM2/2/18
to PyScripter


Am Dienstag, 30. Januar 2018 12:00:54 UTC+1 schrieb PyScripter:
Apparently C:\PYthon27 does not contain a working python installation.

Looks like this is the case. I used the installer from python.org, but I remember that I had to uninstall reinstall because we needed a specific version for libxml2. Maybe something got broken on the way. On the other hand python works fine for me. I don't use it often, but I never had any trouble.

Cheers & thanks
Lübbe

PyScripter

unread,
Feb 2, 2018, 3:49:13 AM2/2/18
to PyScripter
What is the minor version of your python 2.7?  Is python27..dll present in c:\python27?  If not is python27.dll present in your windows system directory?

Lübbe Onken

unread,
Feb 2, 2018, 10:01:50 AM2/2/18
to PyScripter
The minor version is 2.7.13

There is no python27.dll in the C:\python27 folder

At work there are several python27.dlls on my c: drive, but I can't check right now if there's one in the windows system directory.
At home there is no python27.dll on my c: drive. Haven't installed PyScripter at home

Cheers
Lübbe

Lübbe Onken

unread,
Feb 2, 2018, 10:06:29 AM2/2/18
to PyScripter
FWIW I just updated my Pythone installation at home with the following installer: https://www.python.org/ftp/python/2.7.14/python-2.7.14.msi

It wanted to install into Python27

No Python*.dll anywhere afterwards.

Cheers
Lübbe

PyScripter

unread,
Feb 2, 2018, 1:35:29 PM2/2/18
to PyScripter
I assume that you did an all-user installation with administration rights.  In that case python27.dll should be located in the windows system directory (Python version later than 3.5 don't do that).  If you are on a Windows 64 bit machine the 32bit python27.dll should be located in C:\Windows\SysWOW64.   But PyScripter should be able to figure all that out and find the python dll.

To check whether your 32bit  Python installation is registered you can run the Registry Editor "regedit" using the windows key +R and check  for all user installations whether the key
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Python\PythonCore\2.7\InstallPath     (WOW6432Node only in Windows 64bit)
and for current user installation the key
HKEY_CURRENT_USER\Software\Python\PythonCore\2.7\InstallPath
exists.

Please also check the PYTHONHOME and PYTHONPATH environment variables to see whether they conflict with the Python version used (they should not exist).

Lübbe Onken

unread,
Feb 3, 2018, 12:32:04 PM2/3/18
to PyScripter
At home, everything is fine. The registry contains the correct values in "...\InstallPath" and PyScripter starts without complaints. I just haven't found a Python*.dll on my PC yet :)
At work, I can check in ten days. Maybe our admins are blocking stuff...

Cheers
Lübbe

Lübbe Onken

unread,
Mar 22, 2018, 5:09:34 AM3/22/18
to PyScripter
Hi Folks,

I guess my problems at work are related to the fact that we have to install using a separate account with admin privileges. When I run pyscripter directly from the installer, almost everything is fine. It doesn't find the IDE themes, but it finds the python installation.When I run it as admin, it also finds the IDE themes. When I run it as "me", the beforementioned "PyScripter could not load a Python engine" error shows up.

Probably the problem can be solved when I give temporary admin privileges to "me" and reinstally PyScripter. Another solution would be if PyScripter would store non-user-specific configuration in some place accessible to all users instead of the user-specific place of the account that was used to install PyScripter (e.g. %allusersappdata%/pyscripter or whatever you like).

Cheers
Lübbe

PyScripter

unread,
Mar 22, 2018, 8:28:09 AM3/22/18
to PyScripter
Restricted access issues:
  1. PyScripter writes initialisation files and python scripts (e.g. remserver.py) in the user %APPDATA%\pyscripter directory (%APPDATA % is the value of the environment variable normally APPDATA=C:\Users\username\AppData\Roaming).  Do you have write access to this directory?
  2. If you do not have write access to the %APPDATA% directory (rather unusual) then use the "registry-free" distribution of PyScripter (zip file).  Just unzip and run.  How it works:  If PyScripter.ini is located in the same directory as PyScripter.exe Pyscripter does not store anything outside the directory containing PyScripter.exe.   (You need to manually create shortcuts and you get no shell integration).
  3. Is there by any chance a PyScripter.ini in the same directory as your PyScripter.exe.  That would explain the issues you are facing See (2).

Finding Python installation(s) is  unrelated to the above.  If Python is registered PyScripter should be able to find it.  
To make be sure Python is registered check the registry keys:
  • [HKEY_CURRENT_USER\Software\Python\PythonCore\x.y\InstallPath]
  • and [HKEY_LOCAL_MACHINE\Software\Python\PythonCore\x.y\InstallPath]
If not, then see in https://github.com/pyscripter/pyscripter/wiki/FAQ the entries about unregistered Python versions.

Lübbe Onken

unread,
Mar 22, 2018, 10:27:32 AM3/22/18
to PyScripter
I have write access to my %appdata%\pyscripter directory. That's not the issue.
All the subfolders in my %appdata%\pyscripter are empty. The installer put them into the admin users %appdata%\pyscripter directory. The files python_init.py and pyscripter_init.py as well as pyscripter.local.ini *only* exist in the admin users %appdata%\pyscripter directory.
This is why I said that it would probably be better if they were installed into a non-user specific location so that they are available to everyone, like %programdata%\pyscripter. And only the user specific config could/should be stored in %appdata%\pyscripter.

It should not make a difference for the user when he installs from his account (with admin privileges) or from an admin account. Currently PyScripter only works out of the box for the user who has run the installation.

Cheers
Lübbe

PyScripter

unread,
Mar 22, 2018, 5:29:56 PM3/22/18
to PyScripter
Ok.  I understand that PyScripter was installed by an admin account and it put some stuff into the admin %appdata%\pyscripter directory.   But this should not be an issue.  What I do not understand is why when you run PyScripter from your account it does not use your %appdata%\pyscripter directory.  If it does not exist it should create it.  PyScripter wouldn't even know about the  admin %appdata%. directory when it runs from your account. It should not read from or write anything into that directory.  What happens if you copy the %appdata%\pyscripter into your user folder or you just create an empty one?

You can still give the zip version a try, which keeps everything in one place.

I agree that Highlighters and Styles sub folders might fit better into a non-user specific location, but then how do you make sure the user has write access rights to that location, for example to modify/customize the provided highlighters.  And what if the changes are not to other users' liking.  And in any case Highlighters and Styles are not essential for running PyScripter.  They are provided for convenience.   Originally, the folders were meant to house the user specific choices of highlighters and styles.   Everything else in the %appdata%\pyscripter folder is user specific.

Lübbe Onken

unread,
Mar 23, 2018, 4:10:03 AM3/23/18
to PyScripter
The 32bit version of pyscripter doesn't find a python installation on its own, neither run as admin nor as me.
I need to run it from a batch file and pass --PYTHONDLLPATH pointing to a matching python dll. Then I get an error about missing RPYC, but can continue from there on.

The 64bit version of pyscripter run as admin finds a python installation and works as expected. run as "me" it doesn't find a python installation.
If I run PyScripter from my account it creates my %appdata%\pyscripter directory. Copying the content from %adminaccountappdata%\pyscripter to my %appdata% doesen't make a difference. It still doesn't find a python installation.

I uninstalled and reinstalled the 64bit version without touching my %appdata%\pyscripter directory. Since then pyscripter works. Maybe it's a hen/egg problem?

Cheers
Lübbe

Kiriakos Vlahos

unread,
Mar 23, 2018, 5:05:50 AM3/23/18
to pyscr...@googlegroups.com
It appears that when the admin account installed python 64 bit, it installed it as a current user only  (for All users unchecked)!  This is why when you run Pyscripter from   your user account it cannot find Python.  Do an admin install of Python for "All users".  As it stands Python is not registered for other users than the admin account.
There is probably no registered Python 32bit.

You can confirm the above by checking the registry (see previous post).


--

PyScripter

unread,
Mar 23, 2018, 5:32:17 AM3/23/18
to PyScripter
The next big update of Pyscripter will be in the area of making the finding and use different installations of Python much easier.

Lübbe Onken

unread,
Mar 23, 2018, 8:32:55 AM3/23/18
to PyScripter
So you are saying that after having copied the config from the admin account to mine, PyScripter now knows where Python is installed and doesn't search for it anymore? Because it started to work after having uninstalled/reinstalled PyScripter. I didn't do anything with my Python installation.

Cheers
Lübbe
To unsubscribe from this group and stop receiving emails from it, send an email to pyscripter+...@googlegroups.com.

PyScripter

unread,
Mar 23, 2018, 8:42:43 AM3/23/18
to PyScripter
Not exactly.  What I am saying is that PyScripter would never access the %APPDATA% of a different user (i.e. should not access the admin %APPDATA%, when you run PyScripter from your account). 

The issue with Python is unrelated to that of %APPDATA% and is probably related to the way python was installed.

Please check the registry keys
  • [HKEY_CURRENT_USER\Software\Python\PythonCore\x.y\InstallPath]  
  • and [HKEY_LOCAL_MACHINE\Software\Python\PythonCore\x.y\InstallPath]

Check the HKEY_CURRENT_USER from both yours and the admin account.  The key should not exist in your account.

Lübbe Onken

unread,
Mar 26, 2018, 2:30:33 AM3/26/18
to PyScripter
I know that you should not be able to access the registry or other private data of another user from a standard user account.

The Python InstallPath Key only exists in HKLM on my work PC. Neither in admin nor in my account.

Cheers
Lübbe

theheadlesssourceman

unread,
May 14, 2018, 10:25:40 PM5/14/18
to PyScripter
I'm having the same problem.
win7 64 bit + 64 bit python 2.7
PyScripter version 3.4.1.0 x86

It would not detect the installed python.
(Even though other application installers find it with no problem.)

It brings up the new python versions dialog so I hit + and select the c:\python27 directory.
It adds nothing.
Okay, so maybe c:\python27\dlls
Nope.

I tried setting PYTHONHOME and even the command line parameters listed in this thread.

Also, nothing.

I don't see a Python27.dll anywhere in that directory structure, if that's what PyScripter is looking for...?

PyScripter

unread,
May 15, 2018, 4:42:57 AM5/15/18
to PyScripter
The big notice at SourceForge:
The 64-bit version of PyScripter (x64) works only on 64-bit Windows **and**
with 64-bit versions of Python.  The 32-bit version of PyScripter works on both
32-bit and 64-bit Windows with the 32-bit versions of Python.

To use the 64bit version of Python you need the 64bit version of PyScripter.

theheadlesssourceman

unread,
May 15, 2018, 6:12:42 PM5/15/18
to PyScripter
Ah!  Good point!

I uninstalled, downloaded, and, installed 3.4.1.0 x64.
(Also, confirmed the version via the about dialog.)

No doubt this is a step in the right direction, but unfortunately the behaviour is still the same. :(

PyScripter

unread,
May 15, 2018, 6:20:12 PM5/15/18
to PyScripter
Yes Pyscripter is looking for your python27.dll.   If it is not in your python directory then it probably is in C:\Windows\System.   This implies an All User installation, but probably the Registry information is missing.  Can you check that the registry key [HKEY_LOCAL_MACHINE\Software\Python\PythonCore\2.7\InstallPath] exists and it points to the correct directory?

What happens when you start PyScripter? Does it issue a warning and display the Python Versions dialog?

What happens when you 

theheadlesssourceman

unread,
May 15, 2018, 10:18:16 PM5/15/18
to PyScripter
The registry key was pointing to c:\python27
There was no python27.dll in that directory, but there was one in System32
I copied it over to the python install directory and everything works great!  Thanks for your help!

(Also, I question whether the software is making the sometimes incorrect assumption that the dll is under the python InstallPath?
Perhaps there is an enhancement there??)

Either way though, I'm happy as can be!  Thanks again for the great software and support!

Hemerson Mora

unread,
Nov 2, 2021, 7:53:53 PM11/2/21
to PyScripter
hi, where do you install the dll file, in what path?, very thanks

PyScripter

unread,
Nov 2, 2021, 10:08:48 PM11/2/21
to PyScripter
Just install a python distribution from www.python.org.  PyScripter will work with that and you do not need to worry about dlls and the like.  Please note that:

  • **Before** using PyScripter, you must ensure that there is a version of Python greater or equal to 3.6 installed on your Windows machine. If you do not have one installed, you can download one from http://www.python.org/
  •  The 64-bit version of PyScripter (x64) works only on 64-bit Windows **and** with 64-bit versions of Python. The 32-bit version (x86) of PyScripter works on both 32-bit and 64-bit Windows with 32-bit versions of Python.

Victor Alberto Gil

unread,
Aug 2, 2022, 9:18:28 AM8/2/22
to PyScripter
I installed Python 3.11.0b5 x64 but PyScripter 4.1.1.0 x64 doesn't detect it, even mannually adding method.

It returns `PyScripter could not find a usable Python installation at the specified path. ...`

I guess pre-release Python versions are the reason not to detect them. 🤔

PyScripter

unread,
Aug 2, 2022, 9:19:26 AM8/2/22
to PyScripter
Python 3.11 will be supported in the next PyScripter version.
Message has been deleted

Reinhard Dämon

unread,
Oct 14, 2022, 6:40:27 AM10/14/22
to PyScripter
I had also the problem that pyscripter x86 under Win10/64 did not recognize my installed python versions (3.7, 3.10).
--> I deinstalled everything (pyscripter and python versions) and installed it again BUT with pyscripter x64.
Now everything works.
For some unknown reason, pyscripter detects python 3.7 as registered and 3.10 as unregistered.

Reply all
Reply to author
Forward
0 new messages