You need to connect mysql to django. I did so pip install mysql-python . This method gives the error: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-331syeib/mysql-python python I’ve been developing for python for not so long, but I assume that the problem will be corrected by the virtual environment, ie . venv . Is it possible to use it out of the box in pychram? Version of python 3

  • In Pycharm there is support for creating and installing packages in venv out of the box, rummage through the menu with interpreter settings. - Pavel Gurkov
  • It is not very clear why you decided that the problem is in the absence of venv. Without a description of the error is difficult to understand what is the matter. Try updating pip and setuptools first. - Pavel Gurkov
  • @PavelGurkov the body of the question to the title is irrelevant. mysql-python does not support Python 3. - jfs
  • @jfs casket just opened. Perhaps, then it is worth asking to reformulate the question? - Pavel Gurkov September
  • one
    @PavelGurkov: the author may ask a separate question depending on the real problem, for example, "how to configure django to use mysql in Python 3" - jfs

2 answers 2

There is a way through the "mouse clicks": Preferences -> Project Interpreter -> gear in front of the interpreter -> Create VirtualEnv. Create, switch to it (set venv created by the default environment for the project), put the necessary modules.

    1. You open the console in pycharm.

    2. Install virtualenv:

      $ [sudo] pip3 install virtualenv

    3. Then create the environment:

      $ virtualenv myenv

    4. you launch:

      source myenv / bin / activate

    5. Install the necessary packages as usual.

    Everything will be installed in a virtual environment.
    Do not forget to tell the interpreter the path to python-3 from the virtual environment.
    And in the project launch settings, specify the correct interpreter.