Community
    • Login

    import libreries notepad++ in a python script

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 3 Posters 532 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Ismael SantanaI
      Ismael Santana
      last edited by Ismael Santana

      Hi everyone! I am new in this community and using notepad++ to run python scripts. Maybe this questions is already answered but I could not find it anywhere.

      I have already installed notepad++ and python in my computer and also I installed NppExc to run python. Everything works fine! The real problem is when I try to import, for example, pandas and try to use it. I got the error message: no module name pandas

      I am running python in an activated virtualenvironment (already created and installed pandas) and I don’t know if I need to indicate it to notepad++ (like in vs code) and activate that venv to run pandas or any other library.

      Thanks in advance!

      Ismael

      PeterJonesP Michael VincentM 2 Replies Last reply Reply Quote 0
      • PeterJonesP
        PeterJones @Ismael Santana
        last edited by PeterJones

        @Ismael-Santana ,

        There are others here who use a lot more command-line python than I do. And I don’t use the virtual environments, though I tried them out a few years ago, so I’ve got a vague memory of them. I seem to remember that the virtual-env settings apply only to whatever shell you set the virtual environment from… so since Notepad++ is not inside that shell, it won’t know which environment you’ve chosen in that shell. (Well, maybe you could close Notepad++, run the shell and set the virtual environment for that shell, then launch Notepad++ from that shell… at that point, I think it would inherit the virtual environment from the parent shell.)

        With those vague memories, if you don’t launch Notepad++ from the special shell, I think it means that you would have to do the call to choose your virtual environment from inside the NppExec script.

        But I could be completely misremembering how the virtual environments work, in which case you can ignore me, and hopefully someone more qualified will answer soon. (Even if I’m right, getting a more-qualified confirmation would be appreciated… though if you see my reply before anyone else answers, you could at least give it a try.)

        1 Reply Last reply Reply Quote 3
        • Michael VincentM
          Michael Vincent @Ismael Santana
          last edited by

          @Ismael-Santana said in import libreries notepad++ in a python script:

          I installed NppExc to run python

          My guess without seeing any of your installation or how you did the things you say you did is that you need to updated your NppExec script to use the python.exe that is in the virtual environment; otherwise, you are just running the system Python, where presumably, you do not have pandas installed.

          Cheers.

          1 Reply Last reply Reply Quote 2
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors