Skip to content

how to install 3rd lib #197

Closed
Closed

Description

@Jzhenli

Hi, just want to know how to install 3rd python lib for this plugin?

Activity

  1. chcg commented on May 1, 2021

    @chcg
    Collaborator

    @Jzhenli What do you mean with 3rd python lib? Python version 3, e.g. https://www.python.org/downloads/release/python-394/?

  2. Jzhenli commented on May 4, 2021

    @Jzhenli
    Author

    @chcg if I want to install pandas or numpy lib for the PythonScript, how to do it?

  3. Ekopalypse commented on May 6, 2021

    @Ekopalypse
    Contributor

    @Jzhenli
    You don't. If you want to use such libraries, you must have a local Python installation and copy the pythonX.dll into the pythonscript plugin directory to replace the one that comes with the plugin itself.

  4. chcg commented on May 6, 2021

    @chcg
    Collaborator

    In config dialog you have to check that your local installation is preferred, see
    grafik

    The python environment coming with this plugin doesn't contain pip, so installation of additional python packages is not possible this way. Be aware that you still need a python 2.7 installation with the official releases (latest v1.5.4) of the python plugin. There are prereleases for python 3 (latest https://github.com/bruderstein/PythonScript/releases/tag/v3.0.8), but they still have limitations.

  5. harry-commin-enclustra commented on Apr 19, 2022

    @harry-commin-enclustra

    @Ekopalypse @chcg How does PythonScript determine where my locally installed Python packages are located?

    I have two versions of Python installed (3.9 and 3.10). PythonScript is running Python 3.10, but then trying to load packages from my 3.9 installation (and failing). I've set my PATH to point to 3.10, but PythonScript still insists on loading the 3.9 packages.

    If I do sys.path.insert(1, 'path/to/python310/lib/site-packages'), then it seems to import correctly. Is that the best way to do it? I don't know if site.py is somehow involved in situations like this.

  6. Ekopalypse commented on Apr 21, 2022

    @Ekopalypse
    Contributor

    This is done internally by python itself.
    Yes, if you are using multiple versions, this may be the only way to ensure that the correct path is used. Remember that PythonScript behaves like a Python REPL, it stores this information as long as Npp is running.

  7. Ekopalypse commented on Dec 31, 2024

    @Ekopalypse
    Contributor

    @Jzhenli - Is there anything still open, or can this topic be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions