大佬,Python安装报错0x80070570,文件或目录损坏且无法读取怎么操作?

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了大佬,Python安装报错0x80070570,文件或目录损坏且无法读取怎么操作?相关的知识,希望对你有一定的参考价值。

我的电脑是64位的,不能安装64位的python版本,只能安装32的位的python版本。

你的截图是32位的安装失败啊!为什么你说只能安装32位的?
一般出现这个错误都是安装目录被别的程序占用了,到任务管理器里把没用的进程都关了再安装看看追问

已经OK了👌

参考技术A 请问你是怎么解决的呢,我也是遇到了同样的问题 参考技术B 楼主是怎么解决的啊,我也遇到这个问题了? 参考技术C 你好,现在的手机管家软件很多,不过,根据我使用的经验来看,我感觉还是腾讯手机管家,使用的时候比较好。功能比较全,清理垃圾,加速,删除安装包,等等。所以,建议你安装一下这个腾讯手机管家使用一下,自己体会下。

import mysql.connector 报错

1.操作系统版本

uname -a
Linux 10-27-30-48 5.15.60-1.el7.x86_64 #1 SMP Thu Aug 11 12:39:22 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

2.python 版本

python 3.5

3.问题现象

  安装完python 3.5 之后,创建隔离环境并安装 mysql-connector-python,但是在导入该模块的时候报错

1)检查是否安装了mysql-connector-python
source /root/venv_python/bin/activate
(venv_python) [root@ecs-5gcmp-hadoop-0003 site-packages]# pip list
et-xmlfile (1.1.0)
mysql-connector-python (8.0.31)
openpyxl (3.0.10)
pip (8.1.1)
protobuf (3.20.1)
pycrypto (2.6.1)
setuptools (20.10.1)
xlwt (1.3.0)
##隔离环境中安装了 8.0.31 版本的 mysql-connector-python (当前最新版本为8.0.32)

2) 导入 mysql.connector 报错
python
Python 3.5.2 (default, Oct 25 2022, 16:14:35) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import xlwt
>>> import mysql.connector
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/python3.5/lib/python3.5/site-packages/mysql/connector/__init__.py", line 32, in <module>
    from .connection_cext import CMySQLConnection
  File "/usr/local/python3.5/lib/python3.5/site-packages/mysql/connector/connection_cext.py", line 67
    f"MySQL Connector/Python C Extension not available (exc)"
                                                              ^
SyntaxError: invalid syntax

3)怀疑是版本问题,更换较低版本
pip install mysql-connector-python==8.0.21
Collecting mysql-connector-python==8.0.21
  Downloading https://files.pythonhosted.org/packages/f9/69/b998b6e461d189bf504c81e1a2df6a131ce75b4e15bf6655de62df801443/mysql_connector_python-8.0.21-cp35-cp35m-manylinux1_x86_64.whl (15.8MB)
    100% |████████████████████████████████| 15.8MB 70kB/s 
Requirement already satisfied (use --upgrade to upgrade): protobuf>=3.0.0 in ./venv_python/lib/python3.5/site-packages (from mysql-connector-python==8.0.21)
Installing collected packages: mysql-connector-python
  Found existing installation: mysql-connector-python 8.0.31
    Uninstalling mysql-connector-python-8.0.31:
      Successfully uninstalled mysql-connector-python-8.0.31
Successfully installed mysql-connector-python-8.0.21

## mysql-connector-python 版本列表请见 https://dev.mysql.com/doc/relnotes/connector-python/en/

4)再次导入成功
venv_python) [root@10-27-30-48 ~]# pip list
mysql-connector-python (8.0.21)
pip (8.1.1)
protobuf (3.20.1)
setuptools (20.10.1)
You are using pip version 8.1.1, however version 22.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
(venv_python) [root@10-27-30-48 ~]# python
Python 3.5.2 (default, Oct 25 2022, 21:28:13) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import mysql.connector
>>> 


 

以上是关于大佬,Python安装报错0x80070570,文件或目录损坏且无法读取怎么操作?的主要内容,如果未能解决你的问题,请参考以下文章

Win7安装时出现:“windows无法安装所需的文件,错误代码:0X80070570 ”这样的错误。这个怎么破?

安装win10时出现错误代码,0x80070570 - 0x2000C

大佬们pycharm无法运行代码报错怎么解决?

刚买的内存卡出现0x80070570文件或目录损坏且无法读取,怎么办?

文件或目录损坏,无法读取。错误提示0x80070570

Win7移动硬盘无法存入文件,提示错误代码:0x80070570