PythonScript and system Python
-
I use the PythonScript 3.0.7-alpha version because I exclusively code in Python3 and that was the latest version 3 release at the time. It uses Python 3.8.9 and my system Python was 3.8.7 at the time, now “upgraded” to 3.8.10. SO release upgrades, but still the same major/minor version of Python.
I see now PythonScript 3.0.10-alpha is the latest in the Python3 branch and it uses Python 3.10.1.
QUESTION:
Does the system Python minor version need to match the PythonScript minor version - in other words my 3.8!=
3.10. Is that a problem? Those still using Python2 and PythonScript 1.5.4 - do your system Python and PythonScript minor versions match? Do they need to?I ask because updating minor version (3.8 => 3.10) for system Python would involve reinstalling a bunch of modules / dependencies - not to mention Python3 > 3.8 drops Windows 7 support (my ancient home machine). And with the latest 8.2.2 Notepad++ 64-bit plugin-breaking changes and PythonScript (slightly) affected I’m wondering if it gets fixed in the latest (using 3.10.x) and now I’m “forced” to upgrade system Python as well as PythonScript to get the fix?
Cheers.
-
Yes, looks like there is no candy for us :-(
PythonScript.dll has a dependency on the corresponding python3.x.dlls, so this means either building the 3_0_7 branch with the required changes or upgrading Windows and Python and reinstalling all installed modules.
Take a look at pip freeze, which can help you save and reinstall the current modules in this case. -
@ekopalypse said in PythonScript and system Python:
building the 3_0_7 branch
Tried that last night and unless I’m not finding it - there are no instructions on what needs to be downloaded (dependencies) and just simply cloning the repo, importing to Visual Studio and “Build” failed miserably for me.
Cheers.
-
I will try a little later, after work today.
If I remember correctly there were only two NuGet packages, Python and Boost to install.
Phew … means I have to install VS again … and I thought this jug had passed me by for good. -
@ekopalypse said in PythonScript and system Python:
two NuGet packages
We’re starting to get at the limits of my VS understanding - most of the time I’m just at a console typing
msbuild
. Yikes!Cheers
-
@ekopalypse said in PythonScript and system Python:
two NuGet packages, Python and Boost
I did a restore NuGet packages in VS, but I still get error:
Error C1083 Cannot open include file: 'pyconfig.h': No such file or directory PythonScript C:\Users\vinsworldcom\src\personal\Nppx64Plugins\PythonScript-3.0.7\packages\boost.1.74.0.0\lib\native\include\boost\python\detail\wrap_python.hpp 57
Cheers.
-
So I installed VS 2019 and cloned PythonScript.
Installed nuget dependencies and found out that vc142 libs are needed, yes it is VS2019.
Ok, uninstalled Nuget packages and installed boost 1.78 and boost-regex 1.78 and … there is no boost-python 1.78, only 1.74. grrr :-(
Uninstalled Nuget packages again, installed version 1.74 and … damn, I can’t retarget the solution to VS 2017 compatible libraries. What the…
At this point, sorry - I’ll stop.
Just in case you still have a VS 2017 installation, there is a file called PythonSettings.props in the PythonScript/projects directory.
Open this in Visual Studio and change it according to your needs.Mine would look like this.
<PropertyGroup Label="UserMacros"> <BoostBase>D:\Repositories\npp_plugins\PythonScript\packages\boost_regex-vc141.1.74.0.0</BoostBase> <BoostPythonLibPath>D:\Repositories\npp_plugins\PythonScript\packages\boost_python38-vc141.1.74.0.0\lib\native</BoostPythonLibPath> <PythonBase>D:\ProgramData\Python\Python38_64</PythonBase> <PythonBaseX64>D:\ProgramData\Python\Python38_64</PythonBaseX64> <PythonLibPath>D:\ProgramData\Python\Python38_64\libs</PythonLibPath> <PythonLibPathX64>D:\ProgramData\Python\Python38_64\libs</PythonLibPathX64> <HtmlHelpBase>C:\Program Files (x86)\HTML Help Workshop</HtmlHelpBase> </PropertyGroup>
I hope this helps you in building PythonScript.
-
@ekopalypse said in PythonScript and system Python:
Mine would look like this.
THANKS!!! That may be what I was missing from mine. Walk away and fingers crossed the developer / maintainer will update PythonScript for us.
Cheers.
-
One thing I forgot,
I created my own branchgit checkout -b py38
and then did a
git reset --hard v3.0.8
to get the python3.8 related settings. -
@ekopalypse
no, the tag is v3.0.7 for python 3.8.9 -
@ekopalypse said in PythonScript and system Python:
I hope this helps you in building PythonScript.
Don’t ask me how - I could never repeat it and with all the warnings and errors (from the other projects in the solution) spewing, I’m not confident at all, … but:
PythonScript initialized with C:\usr\bin\npp64\plugins\Config\PythonScript\scripts\startup.py Python 3.8.9 (tags/v3.8.9:a743f81, Apr 2 2021, 11:10:41) [MSC v.1928 64 bit (AMD64)] Initialisation took 735ms Ready. >>> editor.getTextRange(0,5) 'hello'
My rebuild of the PythonScript 3.0.7-alpha including the new Notepad++ 8.2.2 fix.
I’m going to keep using this “test” build to see if it crashes and if so, I’ll assume it’s MY compiling, not the “update” which was just replacing:
- ./NppPlugin/include/Scintilla.h
- ./NppPlugin/include/Sci_Position.h
- ./PythonScript/src/Scintilla.h
- ./PythonScript/src/Sci_Position.h
with their latest versions from the Notepad++ repo.
Cheers.
-
Maybe some explanation about the dependencies regarding boost and the python versions used there:
- https://github.com/teeks99/boost-release-windows
The official windows builds are created from that repo and just are compiled against one recent python version defined there - https://github.com/sergey-shandar/getboost
, the binaries from 1. are taken and repackaged to nuget.
So to be able to use some current boost version also the python version comes in automatically from that repos above.
To see how tp configure you local build checkout also the settings used for appveyor builds:
https://github.com/bruderstein/PythonScript/blob/master/PythonScript/project/packages_appveyor.config
and
https://github.com/bruderstein/PythonScript/blob/master/PythonScript/project/PythonSettings_appveyor.propsNewer boost versions have the header only regex build so that nuget package is not longer necessary. That was one reason to update. Another one the regex bugfixes.
To stay at python 3.8 and have a current boost version it would require to setup an own boost build against that python version. That is nothing I’m willing to work on.
I’m working on
https://github.com/chcg/PythonScript/tree/scintilla_446
to bring the master in line with 8.2.1.And probably in an additional step the adaptation for 8.2.2 for the changed Sci_PositionCR size.
Is there any specific reason to stay with WIN7as:
Windows 7 support ended on January 14, 2020and the update to win10 is still available for free also no longer officially announced by Microsoft.
- https://github.com/teeks99/boost-release-windows
-
@chcg said in PythonScript and system Python:
to bring the master in line with 8.2.1.
And probably in an additional step the adaptation for 8.2.2 for the changed Sci_PositionCR size.So long as an updated PythonScript with Python 3 is available that address Notepad++ 8.2.2 updates to Sci_Position, I’ll adapt
Cheers.
-
@michael-vincent said in PythonScript and system Python:
My rebuild of the PythonScript 3.0.7-alpha including the new Notepad++ 8.2.2 fix.
As I re-read this I should note the link is to the actual PythonScript 3.0.7-alpha - NOT my rebuild. I have not posted my rebuild, just done it locally. @chcg above posts how to rebuild PythonScript and indicates the next version may contain the fix:
I’m working on
https://github.com/chcg/PythonScript/tree/scintilla_446
to bring the master in line with 8.2.1.And probably in an additional step the adaptation for 8.2.2 for the changed Sci_PositionCR size.
And at some point, I should eventually upgrade to Python 3.10 (from 3.8) and use the latest.
Cheers.
-
@michael-vincent See https://github.com/bruderstein/PythonScript/releases/tag/v3.0.12 and https://github.com/bruderstein/PythonScript/releases/tag/v3.0.11 with the proposed updates