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

PYTHON_PATH in PythonPlugin.cpp #30

Open
samuelgarcia opened this issue Sep 7, 2020 · 1 comment
Open

PYTHON_PATH in PythonPlugin.cpp #30

samuelgarcia opened this issue Sep 7, 2020 · 1 comment

Comments

@samuelgarcia
Copy link

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
@samuelgarcia
Copy link
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant