【发布时间】:2014-08-09 10:59:49
【问题描述】:
我正在尝试在我的网站中使用this python 库。现在,我已经下载了sc2reader-0.6.5-py3.3.egg 文件并将sc2reader 文件夹转移到我的FTP 帐户的某个随机目录中。我还在同一目录中创建了名为 test.py 和 test.php 的文件。 Test.php 执行test.py,test.py 导入sc2reader 库。
这是test.py中的代码:
import sys
import sc2reader
print 'Works'
它不运行,如果我删除第二行 (import sc2reader),它运行得很好。
目录结构如下:
/random_dir
L________/sc2reader
L_____ __init__.py
L______/other_stuff
L________test.py
L________test.php
非常感谢任何帮助。 :P
【问题讨论】:
-
是否有错误消息(例如在您的网络服务器日志中)?你能从命令行运行你的python脚本吗? sc2reader 的权限是什么?您可能想看看 stderr 的结果 - 请参阅 stackoverflow.com/questions/2320608/php-stderr-after-exec
标签: php python module package python-import