Python 3 ImportError: No module named 'ConfigParser'

前端 未结 18 2306
半阙折子戏
半阙折子戏 2020-11-22 12:52

I am trying to pip install the MySQL-python package, but I get an ImportError.

Jans-MacBook-Pro:~ jan$ /Library/Framew         


        
18条回答
  •  感情败类
    2020-11-22 13:41

    I was getting the same error on Mac OS 10, Python 3.7.6 & Django 2.2.7. I want to use this opportunity to share what worked for me after trying out numerous solutions.

    Steps

    1. Installed Connector/Python 8.0.20 for Mac OS from link

    2. Copy current dependencies into requirements.txt file, deactivated the current virtual env, and deleted it using;

      create the file if not already created with; touch requirements.txt

      copy dependency to file; python -m pip3 freeze > requirements.txt

      deactivate and delete current virtual env; deactivate && rm -rf

    3. Created another virtual env and activated it using; python -m venv && source /bin/activate

    4. Install previous dependencies using; python -m pip3 install -r requirements.txt

提交回复
热议问题