[New-bugs-announce] [issue46682] python 3.10 Py_Initialize/Py_Main std path no longer includes site-packages
Paul Jaggi
report at bugs.python.org
Tue Feb 8 12:39:09 EST 2022
New submission from Paul Jaggi <pjaggi1 at yahoo.com>:
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?
----------
components: C API
messages: 412848
nosy: pjaggi1
priority: normal
severity: normal
status: open
title: python 3.10 Py_Initialize/Py_Main std path no longer includes site-packages
type: behavior
versions: Python 3.10
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46682>
_______________________________________
More information about the New-bugs-announce
mailing list