[英]GAE Python - libs on my requirements.txt are not installed
I'm using flexible environments and I'd like to know what am I doing wrong when deploying it.我正在使用灵活的环境,我想知道在部署它时我做错了什么。
This is my requirements.txt这是我的要求.txt
MySQL-python==1.2.5
If I uninstall this lib on my local computer this error will be thrown:如果我在本地计算机上卸载此库,则会引发此错误:
No module named MySQLdb
When I run "pip install -r requirements.txt" the lib will be installed and I'll able to use MySQLdb with no problems.当我运行“pip install -r requirements.txt”时,将安装 lib,我将能够毫无问题地使用 MySQLdb。
The problem is, when I upload this to server it does not install and the error "No module named MySQLdb" is thrown on production...问题是,当我将它上传到服务器时,它没有安装,并且在生产中抛出错误“没有名为 MySQLdb 的模块”......
From what I understood reading some docs, is that I'd only need to specify which libs I want to use and google would do the installing on production.根据我阅读一些文档的理解,我只需要指定我想要使用的库,谷歌就会在生产中进行安装。
Am I wrong?我错了吗?
Thanks a lot!非常感谢!
MySql-python doesn't install properly using PyPi/pip. MySql-python 无法使用 PyPi/pip 正确安装。 At the time of this question, it required the user to install some other C library, so that's probably why GAE can't install it.在这个问题的时候,它要求用户安装一些其他的 C 库,所以这可能是 GAE 无法安装它的原因。 However, there are other replacement packages that should provide the exact same functions/API and install using pip.但是,还有其他替换包应该提供完全相同的功能/API 并使用 pip 安装。
Another alternative is to install the package directly into your app in a /lib
folder and make sure that the app can install MySql-python correctly, and avoid the requirements.txt installer completely.另一种选择是将 package 直接安装到/lib
文件夹中的应用程序中,并确保应用程序可以正确安装 MySql-python,并完全避免使用 requirements.txt 安装程序。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.