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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值