Menu

from Npp import * ImportError: No module named Npp

Help
Aaron Long
2016-05-11
2016-07-12
  • Aaron Long

    Aaron Long - 2016-05-11

    HI,
    I installed
    notepad++ 6.9.1
    PythonScript 1.0.8.0 (plugin installed from msi)
    (it shows Python 2.7.6-notepad++ r2 (default, Apr 21 2014, 19:26:54) [MSC v.1600 32 bit (Intel)] in console)
    Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec 5 2015, 20:40:30) [MSC v.1500 64 bit (
    AMD64)]
    on win32

    when I tried to run the startup.py.

    I got error ImportError: No module named Npp.
    it seems that the module Npp is really not in my Python list.
    can you advise ?

    my sys.path info:

    D:\mySoft\Python27\python.exe
    ['D:\mySoft\notepadPlus691\plugins\Config\PythonScript\scripts', 'C:\WIND
    OWS\system32\python27.zip', 'D:\mySoft\Python27\DLLs', 'D:\mySoft\Python2
    7\lib', 'D:\mySoft\Python27\lib\plat-win', 'D:\mySoft\Python27\lib\lib-
    tk', 'D:\mySoft\Python27', 'D:\mySoft\Python27\lib\site-packages']

    and modules list info:
    Traceback (most recent call last):
    File "D:\mySoft\notepadPlus691\plugins\PythonScript\scripts\startup.py", l
    5, in <module>
    from Npp import *
    ImportError: No module named Npp

    modules
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    NameError: name 'modules' is not defined
    help()

    Welcome to Python 2.7! This is the online help utility.

    If this is your first time using Python, you should definitely check out
    the tutorial on the Internet at http://docs.python.org/2.7/tutorial/.

    Enter the name of any module, keyword, or topic to get help on writing
    Python programs and using Python modules. To quit this help utility and
    return to the interpreter, just type "quit".

    To get a list of available modules, keywords, or topics, type "modules",
    "keywords", or "topics". Each module also comes with a one-line summary
    of what it does; to list the modules whose summaries contain a given word
    such as "spam", type "modules spam".

    help> modules

    Please wait a moment while I gather a list of all available modules...

    BaseHTTPServer anydbm imaplib sha
    Bastion argparse imghdr shelve
    CGIHTTPServer array imp shlex
    Canvas ast importlib shutil
    ConfigParser asynchat imputil signal
    Cookie asyncore inspect site
    Dialog atexit io smtpd
    DocXMLRPCServer audiodev itertools smtplib
    FileDialog audioop json sndhdr
    FixTk base64 keyword socket
    HTMLParser bdb lib2to3 sqlite3
    MimeWriter binascii linecache sre
    Queue binhex locale sre_compile
    ScrolledText bisect logging sre_constants
    SimpleDialog bsddb macpath sre_parse
    SimpleHTTPServer bz2 macurl2path ssl
    SimpleXMLRPCServer cPickle mailbox startup
    SocketServer cProfile mailcap stat
    StringIO cStringIO markupbase statvfs
    Tix calendar marshal string
    Tkconstants cgi math stringold
    Tkdnd cgitb md5 stringprep
    Tkinter chunk mhlib strop
    UserDict cmath mimetools struct
    UserList cmd mimetypes subprocess
    UserString code mimify sunau
    _LWPCookieJar codecs mmap sunaudio
    _MozillaCookieJar codeop modulefinder symbol
    builtin collections msilib symtable
    future colorsys msvcrt sys
    _abcoll commands multifile sysconfig
    _ast compileall multiprocessing tabnanny
    _bisect compiler mutex tarfile
    _bsddb contextlib netrc telnetlib
    _codecs cookielib new tempfile
    _codecs_cn copy nntplib test
    _codecs_hk copy_reg npp_unit_tests textwrap
    _codecs_iso2022 csv nt this
    _codecs_jp ctypes ntpath thread
    _codecs_kr curses nturl2path threading
    _codecs_tw datetime numbers time
    _collections dbhash opcode timeit
    _csv decimal operator tkColorChooser
    _ctypes difflib optparse tkCommonDialog
    _ctypes_test dircache os tkFileDialog
    _elementtree dis os2emxpath tkFont
    _functools distutils parser tkMessageBox
    _hashlib doctest pdb tkSimpleDialog
    _heapq dumbdbm pickle toaiff
    _hotshot dummy_thread pickletools token
    _io dummy_threading pip tokenize
    _json easy_install pipes trace
    _locale email pkg_resources traceback
    _lsprof encodings pkgutil ttk
    _markerlib ensurepip platform tty
    _md5 errno plistlib turtle
    _msi exceptions popen2 types
    _multibytecodec filecmp poplib unicodedata
    _multiprocessing fileinput posixfile unittest
    _osx_support fnmatch posixpath urllib
    _pyio formatter pprint urllib2
    _random fpformat profile urlparse
    _sha fractions pstats user
    _sha256 ftplib pty uu
    _sha512 functools py_compile uuid
    _socket future_builtins pyclbr warnings
    _sqlite3 gc pydoc wave
    _sre genericpath pydoc_data weakref
    _ssl getopt pyexpat webbrowser
    _strptime getpass quopri whichdb
    _struct gettext random winsound
    _subprocess glob re wsgiref
    _symtable gzip repr xdrlib
    _testcapi hashlib rexec xml
    _threading_local heapq rfc822 xmllib
    _tkinter hmac rlcompleter xmlrpclib
    _warnings hotshot robotparser xxsubtype
    _weakref htmlentitydefs runpy zipfile
    _weakrefset htmllib sched zipimport
    _winreg httplib select zlib
    abc idlelib sets
    aifc ihooks setuptools
    antigravity imageop sgmllib

    Enter any module name to get more help. Or, type "modules spam" to search
    for modules whose descriptions contain the word "spam".

     
  • Toan

    Toan - 2016-07-12

    hello, I am not sure about your problem.
    I guest you run pyhong with python command line as: python startup.py
    if that, please run it into notepad++. It means that you open notepad++ -> plugins -> python script -> scripts -> startup ... it will run startup.py.
    for more information, you can open console in notepad to check something. notepad++ -> plugins -> python script -> show console.
    hope can fix your issue

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.