Не удалось найти независимые от платформы библиотеки <префикс>

After this operation, 0 B of additional disk space will be used.
Get:1 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ trusty/main python3 amd64 3.4.0-0ubuntu2 [8,666 B]
Fetched 8,666 B in 0s (53.3 kB/s)
Setting up base-files (7.2ubuntu5.5) ...
Installing new version of config file /etc/issue ...
Installing new version of config file /etc/issue.net ...
Installing new version of config file /etc/lsb-release ...
Installing new version of config file /etc/os-release ...
Processing triggers for plymouth-theme-ubuntu-text (0.8.8-0ubuntu17.1) ...
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'
Aborted (core dumped)
update-initramfs: deferring update (trigger activated)
Processing triggers for initramfs-tools (0.103ubuntu4.2) ...
update-initramfs: Generating /boot/initrd.img-3.13.0-74-generic
(Reading database ... 126647 files and directories currently installed.)
Preparing to unpack .../python3_3.4.0-0ubuntu2_amd64.deb ...
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'
Aborted (core dumped)
dpkg: warning: subprocess old pre-removal script returned error exit status 134
dpkg: trying script from the new package instead ...
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'
Aborted (core dumped)
dpkg: error processing archive /var/cache/apt/archives/python3_3.4.0-0ubuntu2_amd64.deb (--unpack):
 subprocess new pre-removal script returned error exit status 134
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'
Aborted (core dumped)
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 134
E: Sub-process /usr/bin/dpkg returned an error code (1)
5
задан 16 April 2017 в 00:47

1 ответ

Возможно, проблема связана с несколькими установками Python в вашей системе. У вас есть две переменные PYTHONPATH и PYTHONHOME. Модуль py3compile ищет различные ресурсы, используя эти две переменные. Переменная PYTHONPATH дополняет путь поиска по умолчанию для файлов модулей. PYTHONHOME используется для стандартных библиотек Python. Формат такой же, как и у PATH оболочки. Вам нужно установить эти переменные следующим образом:

export PYTHONPATH='/path/to/pythondir:/path/to/pythondir/lib-dynload:/path/to/pythondir/site-packages'
export PYTHONHOME='/path/to/pythondir'
1
ответ дан 23 November 2019 в 10:41

Другие вопросы по тегам:

Похожие вопросы: