Pyperclip library doesn't recognize Python 3.12 in Visual Studio Code on Arch Linux

54 views Asked by At

I'm facing an issue when trying to use the Pyperclip library in Visual Studio Code (VS Code) on my Arch Linux 6.7.9-arch1-1. I have installed Pyperclip correctly and also installed the xclip and xsel packages on my system. However, when attempting to use Pyperclip in VS Code, I receive the following error:

Pyperclip could not find a copy/paste mechanism for your system.

I have done some investigation and tried the following solutions without success:

  • Setting the PYPERCLIP_FALLBACK environment variable to xclip or xsel.
  • Verifying if xclip and xsel are functioning correctly in the terminal.
  • Checking the permissions for accessing the system clipboard.
  • Trying other alternatives, such as the clipboard library.

Additionally, I noticed that Pyperclip works correctly in the IDLE Python (idle3) on my system but not in VS Code. I am using Python 3.11.8 in VS Code, while the local version on my Arch Linux system is 3.12.1. I've tried to set Python 3.12.1 as default interpreter at VS Code but VS Code says it is not a valid interpreter, besides the path and file are correct.

enter image description here

Could someone please help me resolve this issue?

0

There are 0 answers