0

I came across an import problem causing a runtime warning at debug time. As soon as my python script invokes the open method of the webbrowser package, VSCode prints the following: /snap/core20/current/lib/x86_64-linux-gnu/libstdc++.so.6: version GLIBCXX_3.4.29' not found (required by /lib/x86_64-linux-gnu/libproxy.so.1) Failed to load module: /home/andrea/snap/code/common/.cache/gio-modules/libgiolibproxy.so.

There is nothing special in the code as you can see from the below two lines.

    import webbrowser
    webbrowser.open(url)

This is not a VSCode specific problem as the same script launched in the terminal output the same error.

Checking for the required GLIBCXX version at a system level, the required module seems to be in place (strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX) as the required version is listed. I have however upgraded the library to the most recent package without success.

At this stage, I'm not sure whether this depends from:

  • the LD_LIBRARY_PATH, currently missing in my environment shell. I was somehow expecting PyEnv to do this for me? But this doesn't seem to be the case (I don't see any variable set by querying the os.environ.
  • the fact the upgrade I did was not included in my Python built, hence I need to rebuild the package getting PyEnv doing the leg work for me

What would be your take?

P.S. I was simply trying to open a webbrowser and click on a link to cut short an authentication process I need to do to interact with my script.

9
  • Seeing /snap/ in the traceback gives me the heebie jeebies (in the sense that Snap-installed packages have had weird issues that are only Snap-related). Did you install VSCode from a snap? Or your browser? Commented Nov 10, 2023 at 7:24
  • It comes from Snap, but how would this be affect it? In theory the environment is shared, isn't it? Beside, the script run by terminal does trigger the same error Commented Nov 10, 2023 at 8:17
  • Well, as a next step for debugging, add an audit hook (sys.addaudithook) to your script that prints out the audit data so you can see the exact command line that the webbrowser-underlying subprocess.Popen opens; then you can try and reproduce this without a Python at all. Commented Nov 10, 2023 at 8:43
  • I've never done this sort of things. Anything I can read to start with? Commented Nov 10, 2023 at 17:53
  • Just start with sys.addaudithook(print), run your minimal example and show us the log. Commented Nov 11, 2023 at 12:25

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.