Anaconda 运行import pymysql 报错-解决办法

1.运行import pymysql 报错

Anaconda 运行import pymysql 报错-解决办法_第1张图片

2.安装pymysql(当前环境中有anaconda两个版本、Python两个版本,目前是为acaconda3下的安装pymysql)

Anaconda 运行import pymysql 报错-解决办法_第2张图片

3.输入:conda install pymysql

Anaconda 运行import pymysql 报错-解决办法_第3张图片


(base) C:\Users\18377>conda install pymysql
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: C:\ProgramData\Anaconda3

  added / updated specs:
    - pymysql


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    conda-4.9.2                |   py38haa95532_0         2.9 MB
    pymysql-1.0.1              |   py38haa95532_0          76 KB
    ------------------------------------------------------------
                                           Total:         2.9 MB

The following NEW packages will be INSTALLED:

  pymysql            pkgs/main/win-64::pymysql-1.0.1-py38haa95532_0

The following packages will be UPDATED:

  conda                                        4.8.3-py38_0 --> 4.9.2-py38haa95532_0


Proceed ([y]/n)?

输入:y

Anaconda 运行import pymysql 报错-解决办法_第4张图片

Downloading and Extracting Packages
conda-4.9.2          | 2.9 MB    | ############################################################################ | 100%
pymysql-1.0.1        | 76 KB     | ############################################################################ | 100%
Preparing transaction: done
Verifying transaction: failed

EnvironmentNotWritableError: The current user does not have write permissions to the target environment.
  environment location: C:\ProgramData\Anaconda3

啊!尴尬!失败了

再来

以管理员身份运行:

Anaconda 运行import pymysql 报错-解决办法_第5张图片

重复上述步骤:

Anaconda 运行import pymysql 报错-解决办法_第6张图片


(base) C:\windows\system32>conda install pymysql
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: C:\ProgramData\Anaconda3

  added / updated specs:
    - pymysql


The following NEW packages will be INSTALLED:

  pymysql            pkgs/main/win-64::pymysql-1.0.1-py38haa95532_0

The following packages will be UPDATED:

  conda                                        4.8.3-py38_0 --> 4.9.2-py38haa95532_0


Proceed ([y]/n)? y

Preparing transaction: done
Verifying transaction: done
Executing transaction: done

(base) C:\windows\system32>

OK啦!

 

你可能感兴趣的:(Python,anaconda,python,mysql)