Importerror: Libtk8.6.So: Cannot Open Shared Object File: No Such File or Directory

ImportError: libtk8.6.so: cannot open shared object file: No such file or directory

All you need to do is to install the tkinter package. Now universal precompiled packages such as ActivePython will not work, well at least it didn't work for me. I don't know if this problem occurs in other OSes but I know the solution for Linux: Install the Tk package from the terminal.

In Arch, Tk is available in the Arch repository. You don't need aur for this, just type on the terminal:

sudo pacman -S tk

If you are on another Linux distro such as Debian or a Debian based distro you will probably have to find a PPA repository online and in Debian based distros just type on the terminal:

sudo apt-get install tk

Which applies to all distros.

Azure / Django / Celery / Ubuntu | tkinter & libtk8.6.so import issue

Tkinter is already included in the ubuntu-latest image. No particular setup is needed.

jobs:
verify-tkinter:
name: verify-tkinter
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python version
uses: actions/setup-python@v1
with:
python-version: "3.9"
- name: show tk version
run: |
python -c "import tkinter;print(tkinter.TkVersion)"

If this error is occurring after deployment, you need to install tkinter in your deployment environment, which is separate from GitHub Actions runs.

On your server is running Ubuntu 20 and, make sure the tk package is installed, which provides the libtk8.6.so file needed.

apt install -y tk

ImportError: libSM.so.6: cannot open shared object file: No such file or directory

This fixed the problem by having it as the first two lines of the script:

!pip install opencv-python
!apt update && apt install -y libsm6 libxext6
!apt-get install -y libxrender-dev

ImportError: /home/dminstalluser/script/lib/prctl.so: cannot open shared object file: No such file or directory

On a 64-bit system, the error is most likely caused by a mismatch between the Python you are running, and prctl.so that you've installed.

For example, trying to load 64-bit prctl.so into a 32-bit Python, or vice versa, will produce the error you've observed.

Run file $(which python) /home/dminstalluser/script/lib/prctl.so. If one of them says ELF 64-bit ..., and the other ELF 32-bit ..., then that's exactly your problem.

The fix is to install prctl.so matching your python.



Related Topics



Leave a reply



Submit