PythonScript and system Python
-
@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