Score:-1

Installing MySQL-python error

cn flag

I am trying to install a Python package, but every time I get an error. I looked for a solution on different webpages, but none of them solved my preoblem. I do not know if I am doing something wrong or maybe the problem is somewhere else

$ sudo pip install MySQL-python

Collecting MySQL-python
  Using cached MySQL-python-1.2.5.zip (108 kB)
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-kmndmtdh/MySQL-python/setup.py'"'"'; __file__='"'"'/tmp/pip-install-kmndmtdh/MySQL-python/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-kmndmtdh/MySQL-python/pip-egg-info
         cwd: /tmp/pip-install-kmndmtdh/MySQL-python/
    Complete output (7 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-kmndmtdh/MySQL-python/setup.py", line 13, in <module>
        from setup_posix import get_config
      File "/tmp/pip-install-kmndmtdh/MySQL-python/setup_posix.py", line 2, in <module>
        from ConfigParser import SafeConfigParser
    ModuleNotFoundError: No module named 'ConfigParser'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Error messages:

error_1

error_2

eg flag
Please don't post screen shots of error messages. It is preferable to actually copy the text of the message, paste it into your question and format it properly. Thanks.
Monterisko avatar
cn flag
kevin one of the responders asked me for screenshots from the terminal, i'm sorry if is a problem
Score:0
ve flag

You could try the following steps which I have used to install the "mysql-python",

  1. Install python 2.7

    (base) [test@localhost ~]$ conda install python=2.7
    
  2. Create the second environment(if you wish directly create 2.7 as a base environment)

    (base) [test@localhost ~]$ conda create -n test_mysql python=2.7
    
  3. Activate the recent created environment which is installed with python2.7

    (base) [test@localhost ~]$ conda activate test_mysql
    
  4. Install mysql-python in that environment

    (test_mysql) [test@localhost ~]$ conda install -c anaconda mysql-python
    
  5. Check the installed packages

    (test_mysql) [test@localhost ~]$ conda list |grep -i mysql
    
    mysql-connector-c         6.1.11               h597af5e_1    anaconda
    
    mysql-python              1.2.5            py27h7b6447c_0    anaconda
    
Monterisko avatar
cn flag
Thanks, I made it
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.