Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python Script plugin is not compatible with Notepad++ version 7.6 #109

Open
dnz3d4c opened this issue Nov 14, 2018 · 56 comments

Comments

@dnz3d4c
Copy link

commented Nov 14, 2018

Thanks.

@chcg

This comment has been minimized.

Copy link
Collaborator

commented Nov 14, 2018

@dnz3d4c Where did you place the python27.dll? It is still required to be at the level of the n++.exe.
So python script plugin up to current https://github.com/bruderstein/PythonScript/releases/tag/v1.3.0 is not fully compatible with N++ 7.6.

@dnz3d4c

This comment has been minimized.

Copy link
Author

commented Nov 15, 2018

There is a python27.dll file in the folder where npp is installed (c: \ util \ notepad ++). If this is the case, the plugin will not load in version 7.6.

@dnz3d4c Where did you place the python27.dll? It is still required to be at the level of the n++.exe.
So python script plugin up to current https://github.com/bruderstein/PythonScript/releases/tag/v1.3.0 is not fully compatible with N++ 7.6.

@ghost

This comment has been minimized.

Copy link

commented Nov 17, 2018

@dnz3d4c
Seems to work if you do it that way.
In general, however, as chcg already said, certain stuff would have to be adapted to make it
fully compatible with this new plugin structure.

grafik

@YeltsinReyes

This comment has been minimized.

Copy link

commented Nov 20, 2018

@dnz3d4c How do I work for the plugin Emmet and PythonScript?

@bitagoras

This comment has been minimized.

Copy link

commented Nov 20, 2018

I developed a Notepad++ plugin called PyPadPlusPlus, which is based on PythonScript. Since the installation is very cumbersome, especially now with Notepad++ v7.6, I published it in a bundle with Npp7.6 and PythonScript1.3.0.0 as a portable version. So you don't need the AppData folder at all. It also includes the new plugin manager. Thank to your comment @ClaudiaFrank I finally found out how to do it. Thank you a lot!
You can download this special portable edition of Notepad++ v7.6 with PythonScript and PyPadPlusPlus pre-installed here:
https://github.com/bitagoras/PyPadPlusPlus

@diamondpointmedia

This comment has been minimized.

Copy link

commented Mar 8, 2019

Please fix asap. I recently upgraded to 7.6.3 only to find out that my procedure stopped working. After screwing around for a couple of hours and still not being able to get it to work I had to revert back to 7.5.9.

@vsrawat

This comment has been minimized.

Copy link

commented Mar 8, 2019

@Rubiya99

This comment has been minimized.

Copy link

commented Mar 10, 2019

@vsrawat
Thank you for the info,
I have been trying to install emmet and python script in the current version (7.6.4) for the past few days and it was not installing , i thought there was a problem with my laptop but after reading this forum i have the 7.5.9 version downloaded in which emmet and pythonscript are working perfectly

@vsrawat

This comment has been minimized.

Copy link

commented Mar 10, 2019

@SagePtr

This comment has been minimized.

Copy link

commented Mar 20, 2019

Same problem, Notepad++ 7.6.3 simply doesn't see PythonScript and don't show it in plugins menu, neither Emmet (depends on PythonScript) do. Reverting to Notepad++ 7.5.9 solved issue, but i don't want to stick to outdated Notepad++ version, hoping for a fix.

@vsrawat

This comment has been minimized.

Copy link

commented Mar 20, 2019

@vsrawat

This comment has been minimized.

Copy link

commented Mar 21, 2019

@sheikhmishar

This comment has been minimized.

Copy link

commented Mar 21, 2019

Good news, guys. I've managed to use latest emmet, pythonScript 1.3 and pypadplusplus on notepad++ 7.6.2. So excited to share with you guys. Just give me some moment to test and then upload

@sheikhmishar

This comment has been minimized.

Copy link

commented Mar 21, 2019

@MetaChuh

This comment has been minimized.

Copy link

commented Mar 22, 2019

in case anyone needs the step by step guide on what to download and how to install pythonscript on notepad 7.6.3, 7.6.4 and above, here's the latest copy of the ...
Guide: How to install the PythonScript plugin on Notepad++ 7.6.3, 7.6.4 and above:
from the notepad++ community forum:

complete guide how to install pythonscript on notepad++ 7.6.3, 7.6.4 and above:


for notepad++ 7.6.4, 64 bit (installed version):

  • download and extract PythonScript_Full_1.3.0.0_x64.zip from >>> here <<< to your desktop.
    note: do not use any other available release type, except this zip.

  • open %ProgramFiles%\Notepad++\plugins\ in windows explorer and create a folder called PythonScript.

  • copy PythonScript.dll from the plugins folder of this extracted zip to:
    %ProgramFiles%\Notepad++\plugins\PythonScript\PythonScript.dll

  • copy python27.dll from this extracted zip to:
    %ProgramFiles%\Notepad++\python27.dll

  • copy the folders scripts containing machine level scripts and lib containing python libraries, from the zip's plugins\PythonScript folder to:
    %ProgramFiles%\Notepad++\plugins\PythonScript\


for notepad++ 7.6.4, 32 bit (installed version):

  • download and extract PythonScript_Full_1.3.0.0.zip from >>> here <<< to your desktop.
    note: do not use any other available release type, except this zip.

  • open %ProgramFiles(x86)%\Notepad++\plugins\ in windows explorer and create a folder called PythonScript.

  • copy PythonScript.dll from the plugins folder of this extracted zip to:
    %ProgramFiles(x86)%\Notepad++\plugins\PythonScript\PythonScript.dll

  • copy python27.dll from this extracted zip to:
    %ProgramFiles(x86)%\Notepad++\python27.dll

  • copy the folders scripts containing machine level scripts and lib containing python libraries, from the zip's plugins\PythonScript folder to:
    %ProgramFiles(x86)%\Notepad++\plugins\PythonScript\


additional note: if you have installed notepad++ to a different location than the default, please adapt %ProgramFiles(x86)%\Notepad++or %ProgramFiles%\Notepad++ to your custom path.

@Gitoffthelawn

This comment has been minimized.

Copy link

commented Mar 24, 2019

download and extract PythonScript_Full_1.3.0.0.zip from >>> here <<< to your desktop.
note: do not use any other available release type, except this zip.

Just FYI, the PythonScript_Min_1.3.0.0.zip appears to work equally as well.

@MetaChuh

This comment has been minimized.

Copy link

commented Mar 24, 2019

@Gitoffthelawn

Just FYI, the PythonScript_Min_1.3.0.0.zip appears to work equally as well.

yes, you are absolutely correct.

the notepad++ community guide has been evolving through various forum user requests, where some required the presence of the samples.

the full PythonScript_Full_1.3.0.0.zip release was chosen as "the one" to install, to cover all past community needs with one single guide, e.g. to avoid repeated questions about missing pythonscript samples/templates.

i apologise if this approach might have created any confusion.

@RomanStone

This comment has been minimized.

Copy link

commented Apr 18, 2019

Notepad 7.6.6 just updated (17.04.2019)

copied dlls to

%ProgramFiles(x86)%\Notepad++\plugins\PythonScript\python27.dll
%ProgramFiles(x86)%\Notepad++\plugins\PythonScript\PythonScript.dll

other instructions not work for me (Win7 x64 and n++ x86)

@Gitoffthelawn

This comment has been minimized.

Copy link

commented Apr 18, 2019

@RomanStone Move python27.dll to %ProgramFiles(x86)%\Notepad++\python27.dll. That should work.

@RomanStone

This comment has been minimized.

Copy link

commented Apr 19, 2019

Yes. But without PythonScript.dll file copy in %ProgramFiles(x86)%\Notepad++\plugins\PythonScript\PythonScript.dll
Python Script plugin not listed in Plugins sub menu.

hope this will help someone

Win7 x64 SP1 (w/latest updates, .NET 4.1, VC 2017), NPP 7.6.6 (x86), Plugin Manager 1.4.12.0, Python Script 1.3.0.0 (Installed via Plugin Manager)

@MetaChuh

This comment has been minimized.

Copy link

commented Apr 19, 2019

many thanks for sharing your experience, @RomanStone

NPP 7.6.6 (x86), Plugin Manager 1.4.12.0, Python Script 1.3.0.0 (Installed via Plugin Manager)

please note that plugin manager is not compatible with the plugin folder structure of notepad++ versions above 7.5.9.

both plugin installers serve their purpose at the respective versions.
the best practice is, to use plugin manager for versions 7.5.9 and below, and the built in plugins admin available at versions 7.6.3 and above (plus manual installs for compatible plugins, like pythonscript, that are not yet listed).

best regards.

@Gitoffthelawn

This comment has been minimized.

Copy link

commented Apr 20, 2019

@MetaChuh wrote "...plus manual installs for compatible plugins, like pythonscript, that are not yet listed.."

Do you know why it isn't listed yet?

@MetaChuh

This comment has been minimized.

Copy link

commented Apr 20, 2019

@Gitoffthelawn

i have read, that one of the reasons is, that python[xx].dll currently has to be deployed to the notepad++ root folder, which contradicts the one folder plugin deployment design.

the latest things i know are from here:
https://notepad-plus-plus.org/community/topic/17430/pythonscript-2-0/5

@Gitoffthelawn

This comment has been minimized.

Copy link

commented Apr 21, 2019

Thanks @MetaChuh. It's odd that python[xx].dll need to be deployed there. There must be some big challenge involved in just deploying it with the rest of the plugin. Do you or @chcg have any info as to why it is so challenging?

@MetaChuh

This comment has been minimized.

Copy link

commented Apr 21, 2019

@Gitoffthelawn

many thanks for your questions, i hope i can answer some of them.

the parent process and main executable is notepad++.exe.
python.dll has to be at that same location, or alternatively at a location within the system's path.
same applies to e.g. applications requiring msvcr100.dll, or other runtime dlls, which have to be at the same location as the parent main executable, or at the system's path, as a registered library.

possibly helpful answer, to why can all plugin dlls be loaded from somewhere else, but python.dll not:
the plugins, which do reside at other locations as the main executable, get explicitly loaded from their different locations by notepad++.exe at startup.
but if any of them would require any other runtime library, this library would also have to be present at either the same location as the main executable, or at the system's path, as a registered library.

as far as i've been told, it would require a major rewrite (if possible at all) to use python.dll outside the path of the main notepad++ executable, with the only other hardcore option to build pythonscript.dll with the complete python library statically embedded.

deploying (copying) python.dll to the path of the main executable notepad++.exe, by the pythonscript plugin itself, after install, would currently be the only quick (but dirty) fix.
this is what users are currently doing manually, as this is basically the only thing that is needed to get pythonscript running in newer versions of notepad++, e.g. version 7.6.6.

best regards

@Gitoffthelawn

This comment has been minimized.

Copy link

commented Apr 21, 2019

@MetaChuh Thanks! That answers my question perfectly!

@vsrawat

This comment has been minimized.

Copy link

commented Apr 21, 2019

@sasumner

This comment has been minimized.

Copy link

commented Apr 21, 2019

@vsrawat You have demonstrated that you have no clue. Please just accept the stated reasons.

@vsrawat

This comment has been minimized.

Copy link

commented Apr 22, 2019

@MetaChuh

This comment has been minimized.

Copy link

commented May 4, 2019

@vsrawat

you are not stupid at all.
your input has often helped us to rethink procedures and adapt them to the needs of others.

most important: you share knowledge you adopt, instead of just using it for yourself.
this is much appreciated and very welcome.

many thanks and best regards.

ps: sorry to all for this off topic post.

@sasumner

This comment has been minimized.

Copy link

commented May 4, 2019

@vsrawat It is fine to be a user and decree "this should be thus" and "that should be this way", but when there are current technical reasons why things cannot be made better at the moment, it doesn't help that users that aren't going to contribute to the fixes make decrees. You're not stupid; but it seemed that you just disregarded the technical limitations that are in effect at the moment.

@chcg

This comment has been minimized.

Copy link
Collaborator

commented May 7, 2019

Probably something in:

https://github.com/bruderstein/PythonScript/blob/master/PythonScript/src/PythonHandler.cpp#L84

needs to be modified.

Static linkage is not used to be able to use an own version of python instead of the one bundled with pythonscript.

@ghost

This comment has been minimized.

Copy link

commented May 14, 2019

@chcg - I don't think so. Recently I was working with some customer of us which had a similar issue and
if I'm right then the only possible way to achieve that pythonXX.dll gets loaded from a different dir is to
change npps LoadLibrary behavior by using LoadLibraryEx with LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR, then pythonXX.dll and pythonscript.dll should be in the same directory.

EDIT: Assuming that a rewrite of pythonscript to do its own LoadLibrary call isn't desired.

@Ekopalypse

This comment has been minimized.

Copy link

commented May 14, 2019

@ClaudiaFrank - I can confirm that using LoadLibraryEx with this flag works but only if WindowsXP support
is dropped, meaning a build with WindowsXP compatibility is not possible anymore.
And, by the way, let me say thank you for all of the work you've done in the past. I really learned a lot from your examples.

@ghost

This comment has been minimized.

Copy link

commented May 14, 2019

@Ekopalypse, WindowsXP support, really :-) Windows 7 is already dying :-D
Thank you for your kind words

@sasumner

This comment has been minimized.

Copy link

commented May 15, 2019

We need to get Pythonscript and, more importantly, Notepad++ itself to drop XP support...as in it should be made to not even open on XP! I thought it was dead a few times but unfortunately it keeps coming back.

Side note: Regarding Windows 7 dying, my employer (one of the biggest in the world) will not switch from Windows 7 until there is a viable alternative, and they have come out and said that Windows 10 (or even 8) are NOT viable alternatives.

@Ekopalypse

This comment has been minimized.

Copy link

commented May 15, 2019

Just to make clear, I'm thinking the same - get rid of XP.
I was mentioning it only as it seems to be the default compiler setting.

@chcg

This comment has been minimized.

Copy link
Collaborator

commented May 16, 2019

@ClaudiaFrank You are right the python dll is already loaded before DllMain() is called, so:

  • N++ needs to be modified (hard to achieve, I guess)
  • the loading\linking to python dll needs to be modified
  • python lib needs to be statically linked in
@ghost

This comment has been minimized.

Copy link

commented May 16, 2019

@chcg, but statically linking ... you know what that means ... no more existing 3rd party dlls, no more local python installs ... no more fun :-D

If Don can't be convinced, I assume runtime linking must be used which, I guess, means splitting npp plugin and python related stuff in its own dlls. Well I guess that would be a good chance to jump to python3 :-D ( I know, easier said than done )

@bitagoras

This comment has been minimized.

Copy link

commented May 19, 2019

In the release notes of the new Notepad++ v7.7 it says:

  • Upgrade Scintilla from v3.56 to v4.14.

Has this some impact on PythonScript? I tested it and everything seems to work with my scripts.

My setup: I installed Notepad++ v7.7 with the option not to use "AppData". The installer of PythonScript v1.4.0.0 still places the PythonScript.dll directly in the plugins/ folder. You have to move it manually to the subfolder plugins/PythonScript/ to make it work.

@Ekopalypse

This comment has been minimized.

Copy link

commented May 20, 2019

It has, see here and here for more infos.

@chcg

This comment has been minimized.

Copy link
Collaborator

commented May 20, 2019

@ClaudiaFrank With python 3 the same dll dir issue arises, so this step will not be easier with switching.
So the next step will be to regenerate the stuff with the new scintilla iface file of 4.14. To figure out what is broken now and needs to be adapted.

@Gitoffthelawn

This comment has been minimized.

Copy link

commented May 21, 2019

Should people who are using the pythonscript plugin upgrade to Notepad++ version 7.7, or hold off?

@sasumner

This comment has been minimized.

Copy link

commented May 21, 2019

@Gitoffthelawn I say "go for the 7.7 upgrade!" :)

@Ekopalypse

This comment has been minimized.

Copy link

commented May 21, 2019

@sasumner, but doesn't that mean you loose the editor callbacks, if you don't want to click the error dialog everytime it gets called?

@sasumner

This comment has been minimized.

Copy link

commented May 21, 2019

@Ekopalypse Not sure what you mean... I'm using 7.7 with PS1.3 seemingly very successfully (PS1.4 change list made me say "meh, when I get around to it"). No clicking of error dialogs, no losing of callbacks...

@Ekopalypse

This comment has been minimized.

Copy link

commented May 21, 2019

Strange, when I'm using npp7.7 and PS I always get a popup when a callback is called.
Like this
image
which, from my very little c++ understanding makes sense as the new scintilla notification structure contains an additional field int listCompletionMethod now

@Ekopalypse

This comment has been minimized.

Copy link

commented May 21, 2019

I 've downloaded npp_7.7.0 and extracted it to a new directory. Then I downloaded PS_1.3.0 and unzipped it in the main npp.exe directory.
Moved PythonScript.dll into plugins\PythonScript directory and started npp. So far so good.
Open console -> no error.
Executed the following two lines in the console

from __future__ import print_function
editor.callback(lambda a: print(a), [SCINTILLANOTIFICATION.MODIFIED])

console returned True.
Now as soon as I try to type some text I receive the error.
What am I missing?

@sasumner

This comment has been minimized.

Copy link

commented May 21, 2019

@Ekopalypse said

What am I missing?

I'm not sure. I have a startup.py that installs a lot of stuff that remains resident...synchronous callbacks, asynchronous callbacks... All...that I notice on a continual basis...is working fine. I was in fact totally surprised by this. Occasionally I check the ? menu to make sure I am really running 7.7. ;)

I just copied my PS1.3 stuff over from my portable 7.6.6 into the directory structure for my portable 7.7, but it sounds like you did something very similar. One difference is I'm using 32-bit; you may want to try that as I see your links above are 64-bit?

@Ekopalypse

This comment has been minimized.

Copy link

commented May 21, 2019

You are correct, using the 32bit version is working without error!!
Phew, what is going on here?? How can PS receive a notification structure larger than expected?
Hmmm ... I would argue there is a problem in 32bit code ... or MORE LIKELY - I still have no clue about C++

@chcg

This comment has been minimized.

Copy link
Collaborator

commented Jun 4, 2019

@Ekopalypse int changed to Sci_Position (defined as ptrdiff_t) for some members of SCNotification . For 32bit windows this makes no difference both are 4 bytes, but for 64bit int is still just 4 bytes and ptrdiff_t is 8 bytes. So the structure of SCNotification differs for 64bit. Depending on the use case the access to data elements could fail.

@ghost

This comment has been minimized.

Copy link

commented Jun 4, 2019

@Ekopalypse - it might be hard to begin with C++ but I would say it is worth doing it as you get more
detailed information how most of the things work under the hood.

@Ekopalypse

This comment has been minimized.

Copy link

commented Jun 4, 2019

@chcg - thank you for clarification - this makes sense, I guess. :-)
@ClaudiaFrank - ... but C++ is so strange compared to python but I see what you mean.

@ghost

This comment has been minimized.

Copy link

commented Jun 4, 2019

@Ekopalypse - why not using PythonScript plugin project to get started.
I'm sure @chcg would love to get some help migrating to the new scintilla/npp version.
It's not that difficult, and as you seem to have the python knowledge how to use scintilla it might be even easier.
That's how I started building c++ knowledge - still a lot to do but ...
Building knowledge isn't wasting time.

@ghost ghost referenced this issue Jun 11, 2019
@Ekopalypse

This comment has been minimized.

Copy link

commented Jun 19, 2019

@chcg - this would solve the issue, with python.dll have to be in notepad++ directory, right?

@chcg

This comment has been minimized.

Copy link
Collaborator

commented Jun 28, 2019

Waiting on integration of notepad-plus-plus/notepad-plus-plus#5853 to N++.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.