ubuntu终端运行python找不到模块_python 终端无法在Ubuntu 18.04中启动 - 糯米PHP
我想在Ubuntu中安装Django Framework。我正在使用python 3.8。但按常规安装了Django 1.1。我将python3的替代项更改为python3.8。并使用python3 -m pip install django。我安装了Django(v 3.3)并使用了它。但是更改替代方法后,终端无法打开并启动。
我从ubuntu中删除了python3.6。然后问题就开始了。
似乎linux中的某些程序在python3.6中运行,删除后,
i can't fix the problems and the Terminal windows does not open. i tried other ways (changing the gnome-terminal file, changing the alternative to default v3.6 and fix the Broken distro), but they didn't help me. i can't open Terminal, and when i ran sudo apt update i recieved this Errors:
Any idea?
File has unexpected size (1133 != 1128). Mirror sync in progress? [IP: ***.**.***.** 80]
Release file created at: Wed, 06 May 2020 19:27:45 +0000 Fetched 1,762 B in 2s (932 B/s) Traceback (most recent call last): File "/usr/lib/cnf-update-db", line 8, in
from CommandNotFound.db.creator import DbCreator File "/usr/lib/python3/dist-packages/CommandNotFound/db/creator.py", line 7, in
import sqlite3 File "/usr/lib/python3.6/sqlite3/__init__.py", line 23, in
from sqlite3.dbapi2 import * File "/usr/lib/python3.6/sqlite3/dbapi2.py", line 23, in
import datetime File "/usr/lib/python3.6/datetime.py", line 8, in
import math as _math ModuleNotFoundError: No module named 'math' Error in sys.excepthook: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in
from apport.report import Report File "/usr/lib/python3/dist-packages/apport/report.py", line 12, in
import subprocess, tempfile, os.path, re, pwd, grp, os, time, io File "/usr/lib/python3.6/subprocess.py", line 136, in
import _posixsubprocess ModuleNotFoundError: No module named '_posixsubprocess'
Original exception was: Traceback (most recent call last): File "/usr/lib/cnf-update-db", line 8, in
from CommandNotFound.db.creator import DbCreator File "/usr/lib/python3/dist-packages/CommandNotFound/db/creator.py", line 7, in
import sqlite3 File "/usr/lib/python3.6/sqlite3/__init__.py", line 23, in
from sqlite3.dbapi2 import * File "/usr/lib/python3.6/sqlite3/dbapi2.py", line 23, in
import datetime File "/usr/lib/python3.6/datetime.py", line 8, in
import math as _math ModuleNotFoundError: No module named 'math' Reading package lists... Done E: Failed to fetch http://dl.google.com/linux/chrome/deb/dists/stable/main/binary-amd64/Packages.gz File has unexpected size (1133 != 1128). Mirror sync in progress? [IP:
* 80] Hashes of expected file:
- Filesize:1128 [weak]
- SHA256:*
- SHA1:*
- MD5Sum:*
Release file created at: Wed, 06 May 2020 19:27:45 +0000 E: Some index files failed to download. They have been ignored, or old ones used instead. E: Problem executing scripts APT::Update::Post-Invoke-Success 'if /usr/bin/test -w /var/lib/command-not-found/ -a -e /usr/lib/cnf-update-db; then /usr/lib/cnf-update-db > /dev/null; fi' E: Sub-process returned an error code
and below result showed when i tried to run django-admin:
Traceback (most recent call last):
File "/usr/bin/django-admin", line 5, in
from django.core.management import execute_from_command_line
File "/home/pytm/.local/lib/python3.6/site-packages/django/__init__.py", line 1, in
from django.utils.version import get_version
File "/home/pytm/.local/lib/python3.6/site-packages/django/utils/version.py", line 1, in
import datetime
File "/usr/lib/python3.6/datetime.py", line 8, in
import math as _math
ModuleNotFoundError: No module named 'math'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in
from apport.report import Report
File "/usr/lib/python3/dist-packages/apport/report.py", line 12, in
import subprocess, tempfile, os.path, re, pwd, grp, os, time, io
File "/usr/lib/python3.6/subprocess.py", line 136, in
import _posixsubprocess
ModuleNotFoundError: No module named '_posixsubprocess'
Original exception was:
Traceback (most recent call last):
File "/usr/bin/django-admin", line 5, in
from django.core.management import execute_from_command_line
File "/home/pytm/.local/lib/python3.6/site-packages/django/__init__.py", line 1, in
from django.utils.version import get_version
File "/home/pytm/.local/lib/python3.6/site-packages/django/utils/version.py", line 1, in
import datetime
File "/usr/lib/python3.6/datetime.py", line 8, in
import math as _math
ModuleNotFoundError: No module named 'math'
profiling:/home/user/Downloads/Python-3.6.10/Programs/python.gcda:Cannot open
profiling:/home/user/Downloads/Python-3.6.10/Modules/xxsubtype.gcda:Cannot open
魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐


所有评论(0)