简体   繁体   English

在Azure中在pip上安装_mysql模块的问题

[英]Troubles with installing _mysql module on pip in azure

I am hosting a PHP/MySQL web app on an Azure Windows server. 我在Azure Windows服务器上托管一个PHP / MySQL Web应用程序。 One of the lines in the PHP executes a python script but the script uses the MySQLdb module which I believe is part of the _mysql module. PHP中的其中一行执行一个python脚本,但是该脚本使用MySQLdb模块,我相信它是_mysql模块的一部分。

I have tried using the pip commands in just about every directory that I could think of. 我已经尝试过在几乎我能想到的每个目录中使用pip命令。 I've also upgraded pip as well 我也升级了点子

sudo apt-get install python-pip python-dev libmysqlclient-dev 须藤apt-get install python-pip python-dev libmysqlclient-dev

pip install _mysql pip install MySQLdb pip install _mysql pip安装MySQLdb

D:/home/python364x64/pip.bat install _mysql D:/home/python364x64/pip.bat安装_mysql

Error messages range from "'sudo' is not recognized as an internal or external command, operable program or batch file. to: ERROR: Could not find a version that satisfies the requirement MySQLdb (from versions: none) ERROR: No matching distribution found for MySQLdb 错误消息的范围从“不能将sudo识别为内部或外部命令,可操作程序或批处理文件。”到:错误:找不到满足MySQLdb要求的版本(从版本:无)错误:找不到匹配的发行版对于MySQLdb

On windows server, you cannot use sudo, please use 'python -m pip' instead. 在Windows服务器上,您不能使用sudo,请改用'python -m pip'。 For python 3.x, you should install mysqlclient, If you need 1.2.x versions (legacy Python only), use pip install MySQL-python. 对于python 3.x,应安装mysqlclient,如果需要1.2.x版本(仅适用于旧版Python),请使用pip install MySQL-python。 See How to install Python MySQLdb module using pip? 请参阅如何使用pip安装Python MySQLdb模块? .

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM