Yesterday when I migrated my personal blog, I used pyvenv (similar to virtuallenv). Problems occurred when installing dependencies such as Mysql-python, lxml, etc. because it was installed using pip. For installation packages that cause problems, I personally recommend going to this website to download compiled extensions, such as mysql-python (mysqlclient implements all interfaces for operating databases), we can directly download the mysqlclient.whl file, Then install it in the virtual environment. The installation method is: Activate the virtual environment->Install the wheel extension through pip (the purpose is to install the .whl file)->Install the .whl file through pip. Mysql-python can be installed in this way, and other extension libraries that fail to be installed through requirements.txt can also be installed in this way.
PS: If the topic is still unclear, you can take a look at the blog post I wrote. The steps are more detailed: Using pyvenv for project isolation on Windows
The dependency packages of the django project are installed in the same way as ordinary dependency packages. It’s just that things like MySQL rely on other non-Python packages in the system, which will cause various problems
Yesterday when I migrated my personal blog, I used pyvenv (similar to virtuallenv). Problems occurred when installing dependencies such as Mysql-python, lxml, etc. because it was installed using pip. For installation packages that cause problems, I personally recommend going to this website to download compiled extensions, such as mysql-python (mysqlclient implements all interfaces for operating databases), we can directly download the mysqlclient.whl file, Then install it in the virtual environment. The installation method is: Activate the virtual environment->Install the wheel extension through pip (the purpose is to install the .whl file)->Install the .whl file through pip. Mysql-python can be installed in this way, and other extension libraries that fail to be installed through requirements.txt can also be installed in this way.
PS: If the topic is still unclear, you can take a look at the blog post I wrote. The steps are more detailed: Using pyvenv for project isolation on Windows
The dependency packages of the django project are installed in the same way as ordinary dependency packages. It’s just that things like MySQL rely on other non-Python packages in the system, which will cause various problems