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

notepad++ 6.3 python #185

Closed
Merg1255 opened this issue Mar 6, 2013 · 51 comments
Closed

notepad++ 6.3 python #185

Merg1255 opened this issue Mar 6, 2013 · 51 comments

Comments

@Merg1255
Copy link

Merg1255 commented Mar 6, 2013

I've installed Emmet on a fresh notepad++ installation, turn on the python script console, and here's what the console says when trying to expand an abbreviation:

Traceback (most recent call last):
File "", line 2, in
ImportError: No module named npp_emmet
Traceback (most recent call last):
File "", line 1, in
NameError: name 'npp_emmet' is not defined

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@sergeche
Copy link
Member

sergeche commented Mar 6, 2013

You forgot to copy EmmetNPP into %USER%\AppData\Roaming\Notepad++\plugins\config:
https://github.com/emmetio/npp#manual-installation

@Merg1255
Copy link
Author

Merg1255 commented Mar 6, 2013

It's there... :)
I've checked it twice, installed emmet both manually and through the plugin manager.
Btw, I'm on Vista x32 where the AppData dir is inside %USERPROFILE%, as %USER% is not set as a system variable. Also, it's a localized windows build, so the USERPROFILE is in another language than english.

Inside the EmmetNPP file is a file named emmet. What do you think should fix this?
Thanks

@sergeche
Copy link
Member

sergeche commented Mar 6, 2013

You can try to install Emmet via Plugin Manager, it will copy all required into their places.

@Merg1255
Copy link
Author

Merg1255 commented Mar 6, 2013

@sergeche I did, everything is in place, according to the github page.
But when you create a new file and write for example "div*3", it won't expand either through the menu or the keyboard.

@Merg1255
Copy link
Author

Merg1255 commented Mar 6, 2013

(note that the zen coding plugin worked fine)

@sergeche
Copy link
Member

sergeche commented Mar 6, 2013

Try to invoke any Emmet action than open Python Script console and run sys.path command there. It will display all available import paths. Please copy console content and send it to me.

@Merg1255
Copy link
Author

Merg1255 commented Mar 6, 2013

ok, I opened the Python Script console, and ran sys.path, then this was displayed:

['C:\\Program Files\\Notepad++\\python27.zip', 'C:\\Program Files\\Notepad++\\DLLs', 'C:\\Program Files\\Notepad++\\lib', 'C:\\Program Files\\Notepad++\\lib\\plat-win', 'C:\\Program Files\\Notepad++\\lib\\lib-tk', 'C:\\Program Files\\Notepad++', 'C:\\Program Files\\Notepad++\\plugins\\PythonScript\\lib', u'C:\\Users\\\***\u03c2\\AppData\\Roaming\\Notepad++\\plugins\\Config\\PythonScript\\lib', 'C:\\Program Files\\Notepad++\\plugins\\PythonScript\\scripts', u'C:\\Users\\\***\u03c2\\AppData\\Roaming\\Notepad++\\plugins\\Config\\PythonScript\\scripts']

Note that where there is *** it is meant to be (local encoded) characters like \u03c2\u03c2.
Also note that the C:\Users has a u'C:\\... in front of the filepath.

@Merg1255
Copy link
Author

Merg1255 commented Mar 7, 2013

any news on this one?...

@cssfish
Copy link

cssfish commented Mar 9, 2013

Сергей, аналогичная проблема.
Имеется winxp 32bit и NPP 6.3 без установки, просто распакованная packed версия.
По инструкции распаковал туда Python Script, далее EmmetNPP.
В консоли питона получаем следующее (папка программы D:/np1/):

Python 2.7.1 (release27-maint-npp, Feb 6 2011, 16:58:20) [MSC v.1500 32 bit (Intel)]
Initialisation took 47ms
Ready.
Traceback (most recent call last):
File "", line 2, in
File "D:\np1\plugins\Config\EmmetNPP\npp_emmet.py", line 4, in
import PyV8
File "D:\np1\plugins\Config\EmmetNPP\PyV8.py", line 7, in
import logging
ImportError: No module named logging

Traceback (most recent call last):
File "", line 1, in
NameError: name 'npp_emmet' is not defined
sys.path
['D:\np1\python27.zip', 'D:\np1\DLLs', 'D:\np1\lib', 'D:\np1\lib\plat-win', 'D:\np1\lib\lib-tk', 'D:\np1', 'D:\np1\plugins\PythonScript\lib', 'D:\np1\plugins\Config\PythonScript\lib', 'D:\np1\plugins\PythonScript\scripts', 'D:\np1\plugins\Config\PythonScript\scripts', 'D:\np1\plugins\Config\EmmetNPP']

может быть, дело в путях? тк тут по сути "portable" версия и никаких привязок к program files и прочим системным папкам нет

_en_
Sergey, i have the same problem. No installation, just unpacked NPP 6.3.
May be problem somewhere in paths?
so sad...

@cssfish
Copy link

cssfish commented Mar 9, 2013

upd.
проблема решилась - оказывается, не работает, если использовать PythonScript_min_0.9.2.0.7z
Берем PythonScript_full_0.9.2.0.7z - и все отлично!
Если ставить через plugin manager, то он тоже качает именно full версию.

bingo!
use PythonScript_full_0.9.2.0.7z instead of PythonScript_min_0.9.2.0.7z!

@Merg1255
Copy link
Author

Merg1255 commented Mar 9, 2013

@cssfish thanks for the english section! :-)
I guess your %USERPROFILE% directory contains unicode characters (not english ones), that's why we're having this issue with NPP.

@sergeche and @cssfish
So how do I use the PythonScript_full ?..

@cssfish
Copy link

cssfish commented Mar 9, 2013

@Merg1255, download full version of PythonScript here:
http://sourceforge.net/projects/npppythonscript/files/Python%20Script%200.9.2.0/

after that, try to unpack NPP (not minimized! - better use 7z package) in new folder, and then do as described in "Manual installation" here -https://github.com/emmetio/npp

at first, unpack PythonScript, [+i reload NPP after that] and then unpack emmet.

its really work. great!!! sorry, my english really bad

@sergeche
Copy link
Member

sergeche commented Mar 9, 2013

@Merg1255 I’ll try update plugin so it load Emmet data from another folder.

@Merg1255
Copy link
Author

Merg1255 commented Mar 9, 2013

@cssfish Did follow what you said, but getting the same message on the Python Console:

Traceback (most recent call last):
  File "<string>", line 2, in <module>
ImportError: No module named npp_emmet
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'npp_emmet' is not defined

I think an update to the EmmetNPP is needed for this.

@cssfish
Copy link

cssfish commented Mar 10, 2013

@Merg1255, i compressed my npp+emmet portable folder, you can download it here - http://webfile.ru/6420952
if it don't help... don`t know :(

@Merg1255
Copy link
Author

@cssfish thanks so much for your help!!
Though, I tried to use the portable npp but it still won't work. Even the tab will not work this time, as a normal tab function.
The only better thing would be an update from @sergeche of the Emmet plugin.

@Merg1255
Copy link
Author

@sergeche is this issue fixable?..

@sergeche
Copy link
Member

Yes, it should be fixable.I’ll try to do something with it in a few days.

@Merg1255
Copy link
Author

:-)

@sergeche
Copy link
Member

sergeche commented Apr 4, 2013

I’ve changed the way how Emmet plugin loads and this error with non-ASCII system user name should be gone.
Try the following:

  1. Download plugin dev version: http://download.emmet.io/npp/emmet-npp.zip
  2. Unpack its contents into main Plugins dir (should be C:\Program Files\Notepad++\plugins). You don’t need to copy EmmetNPP into AppData anymore.
  3. Start NPP

Tell me if it works for you.

@Merg1255
Copy link
Author

Merg1255 commented Apr 4, 2013

@sergeche thanks for making a new version, but I'm having exactly the same messages in the python console. It's interesting because the zen coding plugin seems to work.

@sergeche
Copy link
Member

sergeche commented Apr 4, 2013

Can you open Python Console and give me sys.path again?

@Merg1255
Copy link
Author

Merg1255 commented Apr 4, 2013

Note that I have installed the Python Script (and not the PyNPP).
Here it is:

['C:\\Program Files\\Notepad++\\python27.zip', 'C:\\Program Files\\Notepad++\\DLLs', 'C:\\Program Files\\Notepad++\\lib', 'C:\\Program Files\\Notepad++\\lib\\plat-win', 'C:\\Program Files\\Notepad++\\lib\\lib-tk', 'C:\\Program Files\\Notepad++', 'C:\\Program Files\\Notepad++\\plugins\\PythonScript\\lib', u'C:\\Users\\\*\*\*\*\u03c8\\AppData\\Roaming\\Notepad++\\plugins\\Config\\PythonScript\\lib', 'C:\\Program Files\\Notepad++\\plugins\\PythonScript\\scripts', u'C:\\Users\\\*\*\*\*\u03c8\\AppData\\Roaming\\Notepad++\\plugins\\Config\\PythonScript\\scripts']

@sergeche
Copy link
Member

sergeche commented Apr 5, 2013

I’ve updated dev build: http://download.emmet.io/npp/emmet-npp.zip
Installation instructions are the same. Try the following:

  1. Install (replace) plugin with new one
  2. Start NPP and call, for example, “Expand Abbreviation” action
  3. Open Plugins > Python Scripting > Show Console and show me the full log (you should see something like “Starting Emmet” message and load paths).

@Merg1255
Copy link
Author

Merg1255 commented Apr 6, 2013

['C:\\Program Files\\Notepad++\\python27.zip', 'C:\\Program Files\\Notepad++\\DLLs', 'C:\\Program Files\\Notepad++\\lib', 'C:\\Program Files\\Notepad++\\lib\\plat-win', 'C:\\Program Files\\Notepad++\\lib\\lib-tk', 'C:\\Program Files\\Notepad++', 'C:\\Program Files\\Notepad++\\plugins\\PythonScript\\lib', u'C:\\Users\\\*\*\*\*\u03c8\\AppData\\Roaming\\Notepad++\\plugins\\Config\\PythonScript\\lib', 'C:\\Program Files\\Notepad++\\plugins\\PythonScript\\scripts', u'C:\\Users\\\*\*\*\*\u03c8\\AppData\\Roaming\\Notepad++\\plugins\\Config\\PythonScript\\scripts', 'C:\\Program Files\\Notepad++\\plugins\\EmmetNPP', 'C:\\Users\\\*\*\*\*\xek\\AppData\\Roaming\\Notepad++\\plugins\\Config\\EmmetNPP']
Traceback (most recent call last):
  File "<string>", line 7, in <module>
ImportError: No module named npp_emmet
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'npp_emmet' is not defined

Where *\*\ it's representation of unicode chars.

@c3037
Copy link

c3037 commented Apr 6, 2013

Мне помогло вот это:
В файл C:\Program Files\Notepad++\plugins\PythonScript\scripts\startup.py добавить в конце строчку:
sys.path.insert(0, r' C:\Program Files\Notepad++\plugins\EmmetNPP')
при этом в папку AppData ничего не копировал.
все файлы распаковал в C:\Program Files\Notepad++\plugins\

@c3037
Copy link

c3037 commented Apr 6, 2013

Извините, ошибся в написании строки, вот правильная:
sys.path.insert(0, r'c:\Program Files\Notepad++\plugins\EmmetNPP')
В предыдущем посте ошибка.

@sergeche
Copy link
Member

sergeche commented Apr 7, 2013

I’ve updated dev plugin as @Dmitryqr suggested, try it again and let me know if it works for you.

@Merg1255 please make sure that EmmetNPP folder from dev plugin exists in C:\Program Files\Notepad++\plugins\

@Merg1255
Copy link
Author

Merg1255 commented Apr 7, 2013

it worked. :)
Now I checked some things and it worked for expanding tags. Though the keyboard combinations could have been the same as with Zen Coding.

Thanks!

@sergeche
Copy link
Member

sergeche commented Apr 7, 2013

So, everything works fine? I can push it to Plugin Manager?

@Merg1255
Copy link
Author

Merg1255 commented Apr 8, 2013

Yes, some checks I did were working normally. Push it to plugin manager and if there's something new I'll post a new issue on github.

@mpsasank
Copy link

I am getting exactly same issue after installing the plugin using plugin manager in notepad++

@ihorzenich
Copy link

Аналогичная проблема - плагин есть в меню, но не работает.
Я перепробовал все варианты решения проблемы, что тут предлагали, пробовал dev-версию плагина, ничего не помогло.
Win 7 EN Pro
Username: Del'ka

@sergeche
Copy link
Member

@delka в Python Console есть ошибки?

@ihorzenich
Copy link

@sergeche Да,

Traceback (most recent call last):
  File "C:\Program Files (x86)\Notepad++\plugins\PythonScript\scripts\startup.py", line 26, in <module>
    import site
ImportError: No module named site
Python 2.7.1 (release27-maint-npp, Feb  6 2011, 16:58:20) [MSC v.1500 32 bit (Intel)]
Initialisation took 0ms
Ready.

@ihorzenich
Copy link

Если что - мой skype: delka_ua, готов дать Team Viewer посмотреть.

@sergeche
Copy link
Member

I guess @davegb3 should take a look at @delka issue: #185 (comment)

@bruderstein
Copy link

@delka looks like you've got n incomplete python script installation, or you've got files in the wrong place. Do a reinstall of PythonScript from plugin manager, then it should work.

@victorsamuelmd
Copy link

The windows python instalation conflicts with the python libs from notepad++.

@hybridherbst
Copy link

I can second what victorsamuekmd said, and tried with different Python versions.
Npp seems to use 2.7.1 (and no update yet).
When I had 2.7.5 (the current one) installed, it did not work (Npp loaded the windows version). With 2.7.1 installed, everything seems to work.
So much for "maintenance releases which don't break anything" from Python's side :D.

@kasboh
Copy link

kasboh commented Aug 20, 2013

Yep, plugin doesn't work if python 2.7.5 is installed on windows.
Can this be fixed without uninstalling python or downgrading it to 2.7.1?

@clarenswd
Copy link

Hi, I have also python installed on windows and also the same problem with the python script and emmet. What can I do? Thanks in advance.

@Turcik
Copy link

Turcik commented Nov 29, 2013

Hi, I have the same problem with Emmet and Python installed on Windows, PLEASE fix it.

@hailin84
Copy link

I installed emmet via Plugin Manager and encountered the same issue. And I have installed python 2.7.5 on Windows first.
Here is some message maybe helpful.
When I start notepad++ and open python console, it shows:
Traceback (most recent call last):
File "D:\TOOLS\Notepad++\unicode\plugins\PythonScript\scripts\startup.py", line 25, in
import site
File "C:\Python27\Lib\site.py", line 548, in
main()
File "C:\Python27\Lib\site.py", line 530, in main
known_paths = addusersitepackages(known_paths)
File "C:\Python27\Lib\site.py", line 266, in addusersitepackages
user_site = getusersitepackages()
File "C:\Python27\Lib\site.py", line 241, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
File "C:\Python27\Lib\site.py", line 231, in getuserbase
USER_BASE = get_config_var('userbase')
File "C:\Python27\Lib\sysconfig.py", line 516, in get_config_var
return get_config_vars().get(name)
File "C:\Python27\Lib\sysconfig.py", line 449, in get_config_vars
import re
File "D:\TOOLS\Notepad++\unicode\python27.zip\re.py", line 105, in
import sre_compile
File "D:\TOOLS\Notepad++\unicode\python27.zip\sre_compile.py", line 14, in
import sre_parse
File "D:\TOOLS\Notepad++\unicode\python27.zip\sre_parse.py", line 17, in
from sre_constants import *
File "D:\TOOLS\Notepad++\unicode\python27.zip\sre_constants.py", line 18, in
from _sre import MAXREPEAT
ImportError: cannot import name MAXREPEAT
Python 2.7.1 (release27-maint-npp, Feb 6 2011, 16:58:20) [MSC v.1500 32 bit (Intel)]
Initialisation took 250ms
Ready.

When I try to call expand abbreviation command through menu or shortcut, it shows:
Traceback (most recent call last):
File "", line 1, in
NameError: name 'npp_emmet' is not defined

Could anybody help ?

@hailin84
Copy link

Where is the python used by emmet? It's 2.7.1 from Notepad++'s Python console, but it's 2.7.5 if I run python's print sys.version from windows' command prompt.

So, it's highly possible that python's version conflict is the root cause of the issue above.

@hailin84
Copy link

I uninstalled Python, and it worked. Everything is fine now.

@negativefix
Copy link

is it possible to make emmet work without uninstallig conflicting local python installation? Thanks.

@bruderstein
Copy link

Yes, with version Python Script 1.0.6. Install that, and it should work properly.

@wersimmon
Copy link

Confirming Python Script 1.0.6 fixed the problem. I have Python 2.7.4 installed on Windows 7 x64.

@lwd1900
Copy link

lwd1900 commented Sep 9, 2015

hi
i have notepad++ version 6.8.2

Emmet plugin 1.0.0

python script 1.0.6.0

Emmet is no work..........

What can I do? Thanks in advance.

@bruderstein
Copy link

@lwd1900 try installling python script from the MSI (sorry still sourceforge- http://sourceforge.net/projects/npppythonscript/) or look at the console to see if there are any errors (plugins -> python script -> show console). If you don't see anything in the console, it's possible you're missing a startup.py. The MSI will fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests