You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I have to apologize for rather a fragmented issue / bug description.
Background.
I'm using notepad++ in two different environments Home
npp.8.4.2.portable.x64
Windows 11
Portable WinPython 3.8
PythonScript manual build against 3.8 link
Problem
PythonScript does not work in Home environment under python virtual environment
In Work environment , everything is fine.
Analysis
With built in debug logging I was able to nail down issues to broken PyConfig.
I.e. when executed under python virtual environment following PyConfig members got uninitialized
"failed to get the Python codec of the filesystem encoding" in "init_fs_encoding"
Workaround
I was able to make a quick dirty fix to solve the issue by explicitly setting prefix, base_prefix, exec_prefix, base_exec_prefix, and appending missing paths to module_search_paths.
The text was updated successfully, but these errors were encountered:
stier08
changed the title
PythonScript python 3k does is not compatible with virtual environment under windows 11
PythonScript python 3k is not compatible with virtual environment under windows 11
Sep 24, 2022
Hi,
I have to apologize for rather a fragmented issue / bug description.
Background.
I'm using notepad++ in two different environments
Home
npp.8.4.2.portable.x64
Windows 11
Portable WinPython 3.8
PythonScript manual build against 3.8 link
Work
npp.8.4.2.portable.x64
Windows 10
Pre-installed Python 3.8 by IT department
PythonScript manual build against 3.8 [link] (https://github.com/stier08/PythonScript/tree/vs2019_toolset_v140_boost_1_74_0_wp38_x64_v2)
Problem
PythonScript does not work in Home environment under python virtual environment
In Work environment , everything is fine.
Analysis
With built in debug logging I was able to nail down issues to broken PyConfig.
I.e. when executed under python virtual environment following PyConfig members got uninitialized
prefix, base_prefix, exec_prefix, base_exec_prefix,
and Py_InitializeFromConfig returns status:
"failed to get the Python codec of the filesystem encoding" in "init_fs_encoding"
Workaround
I was able to make a quick dirty fix to solve the issue by explicitly setting prefix, base_prefix, exec_prefix, base_exec_prefix, and appending missing paths to module_search_paths.
Unfortunately I did
See more tech details down below and under https://github.com/stier08/PythonScript/tree/vs2019_toolset_v140_boost_1_74_0_wp38_x64_v2.
Workaround solution based on explicit parsing environment and pyvenv.cfg
`
void venv_update_py_config(PyConfig& cfg)
{
const char* virtual_env;
if (virtual_env = std::getenv("VIRTUAL_ENV"))
{
output_debug_string("VIRTUAL_ENV : " + std::string(virtual_env));
}
`
The text was updated successfully, but these errors were encountered: