0
我试图运行Github上:https://github.com/atbaker/wikipedia-question-generator#installing-with-python-34如何使用php shell执行python虚拟环境文件?
$ pyvenv venv
$ source venv/bin/activate
$ pip install -r requirements.txt
$ python -m textblob.download_corpora
安装命令行工具,所以你可以用轻松的工具:
https://github.com/atbaker/wikipedia-question-generator我曾尝试使用以下命令创建的虚拟环境
$ pip install -e folder_name
现在环境已经完成。 我的代码使用以下运行正常的命令行:
wikitrivia 'tony'
现在,我已经尝试使用PHP来使用它shell
脚本如下:
<? php
$out = shell_exec('wikitrivia "tony" ');
echo $out;
?>
但并没有什么输出屏幕上。我试图运行命令php -v
并显示了该版本。但是命令wikitrivia "tony"
不起作用。我正在使用AWS Ubuntu环境。
我php
版本7和版本python
为3.5
希望这有助于。请让我知道我能做什么?