This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: python 3.10 Py_Initialize/Py_Main std path no longer includes site-packages
Type: behavior Stage:
Components: C API Versions: Python 3.10
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: pjaggi1
Priority: normal Keywords:

Created on 2022-02-08 17:39 by pjaggi1, last changed 2022-04-11 14:59 by admin.

Messages (1)
msg412848 - (view) Author: Paul Jaggi (pjaggi1) Date: 2022-02-08 17:39
Have the following simple program:
#include <iostream>
#include <Python.h>

using namespace std;

int main(int argc, char** argv) {
  wchar_t* args[argc];
  for(int i = 0; i < argc; ++i) {
    args[i] = Py_DecodeLocale(argv[i], nullptr);
  }

  Py_Initialize();
  const int exit_code = Py_Main(argc, args);
  cout << "Exit code: " << exit_code << endl;
  cout << "press any key to exit" << endl;
  cin.get();
  return 0;
}

When you run this program and in the console:
import sys
sys.path

for Python versions between 3.7-3.9, you get the installed python site-packages by default.  For Python 3.10, you don't.  This happens on both windows and Mac.  Is this an intentional change?
History
Date User Action Args
2022-04-11 14:59:55adminsetgithub: 90840
2022-02-08 17:39:09pjaggi1create