Skip to content

PYTHON_PATH in PythonPlugin.cpp #30

Open

Description

@samuelgarcia

I fight and finally manage to install this plugin under linux unbuntu 18.4 with python 3.6 with virtualenv+pip
I am trying now to do the same with ubuntu 20.4 and python3.8.

I am facing some difficulties see #29

The numpy can not be imported, the python path is wrong I think:

Could someone explain me theses lines in PythonPlugin.cpp ?

#ifdef _WIN32
    // set PYTHONPATH to avoid error described here: https://stackoverflow.com/questions/5694706/py-initialize-fails-unable-to-load-the-file-system-codec
    _putenv_s("PYTHONPATH", PYTHON_HOME_NAME "\\DLLs;" PYTHON_HOME_NAME "\\Lib;" PYTHON_HOME_NAME "\\Lib\\site-packages");
#else
    setenv("PYTHONPATH", PYTHON_PATH_NAME, 1);
#endif

Activity

  1. samuelgarcia commented on Sep 7, 2020

    @samuelgarcia
    Author

    Related question why do we have the code "PYTHON_HOME" and not "PYTHONHOME" ?

    #ifdef _WIN32
            _putenv_s("PYTHON_HOME", PYTHON_HOME_NAME);
    #else
            setenv("PYTHON_HOME", PYTHON_HOME_NAME, 1);
    #endif

    Am I missing something ?

    I would do

    #ifdef _WIN32
            _putenv_s("PYTHONHOME", PYTHON_HOME_NAME);
    #else
            setenv("PYTHONHOME", PYTHON_HOME_NAME, 1);
    #endif
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions