Errors were encountered while processing: python3.5-minimal python3-minimal

Viewed 40

I am trying to import tensorflow in my code, but whenever I try to do that I get this error

Traceback (most recent call last):
File "background_blur.py", line 16, in <module>
import tensorflow as tf # Importing tensorflow
File "/home/dsp/Shridhar/Python/tutorial_env/lib/python3.7/site- 
packages/tensorflow/__init__.py", line 37, in <module>
from tensorflow.python.tools import module_util as _module_util
File "/home/dsp/Shridhar/Python/tutorial_env/lib/python3.7/site- 
packages/tensorflow/python/__init__.py", line 24, in <module>
import ctypes
File "/usr/local/lib/python3.7/ctypes/__init__.py", line 7, in <module>
from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'

to solve this error I used apt-get install libffi-dev this command but again it was not successful and this time I got

Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
python3-apt : Depends: python-apt-common but it is not going to be 
installed
           Recommends: lsb-release but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or 
specify a solution).

as suggested on screen I tried apt-get -f install but this time I got this error

Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer 
required:
libpython3.6-minimal libpython3.6-stdlib
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
python-apt-common
The following NEW packages will be installed:
python-apt-common
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
9 not fully installed or removed.
Need to get 0 B/16.7 kB of archives.
After this operation, 242 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up python3.5-minimal (3.5.2-2ubuntu0~16.04.13) ...
# Empty sitecustomize.py to avoid a dangling symlink
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings'

Current thread 0x00007f4a4b951700 (most recent call first):
Aborted
dpkg: error processing package python3.5-minimal (--configure):
subprocess installed post-installation script returned error exit status 
134
dpkg: dependency problems prevent configuration of python3-minimal:
python3-minimal depends on python3.5-minimal (>= 3.5.1-2~); however:
Package python3.5-minimal is not configured yet.

dpkg: error processing package python3-minimal (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
python3.5-minimal
python3-minimal
E: Sub-process /usr/bin/dpkg returned an error code (1)

And I have to mention that some of python files in the system got deleted by mistake.

If somebody guides me how solve this problem it will be great help. Thanks in advance.

0 Answers
Related