首先,我已经找到了如何在Python中的其他脚本中调用脚本,调用非常有效,但这是我遇到的问题:
为了在另一台服务器上轻松安装我的web-app(Bottle),我使用mod_wsgi和PyMySQL源文件打包在/ redist rep中。我想要实现的是一种“setup.py”文件,它将启动/mod_wsgi/setup.py安装文件,并与PyMySQL安装文件相同。
以下是我为PyMySQL所做的事情:
/build
安装运行正常,但是我最终在我的应用目录中找到/dist
,/PyMySQL.egg-info
和cd /redist/PyMySQL/
个文件夹,当我尝试启动任何内容时导入PyMySQL,它告诉我该模块不存在。
如果我手动安装它(使用我的终端,我的意思是,如py3 setup.py install
然后{{1}}),它运行良好,导入将有效...
有什么想法吗?我做错了吗?
提前,谢谢:)
答案 0 :(得分:1)
我认为这可以解决您的问题:Python specify popen working directory via argument
我想在“./redist/PyMySQL/”目录中可以用作参数,因为它是setup.py所在的位置
试试这个:
eclipse.buildId=
java.version=1.7.0_67
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en
Command-line arguments: -os win32 -ws win32 -arch x86_64
Error
Fri May 29 17:01:28 SGT 2015
Build Error :
java.lang.IllegalArgumentException: Cannot determine the graph element type because the document class is null. Probably this is a projection, use the EXPAND() function
at com.tinkerpop.blueprints.impls.orient.OrientElementIterator.next(OrientElementIterator.java:49)
at com.tinkerpop.blueprints.impls.orient.OrientElementIterator.next(OrientElementIterator.java:13)
at org.tizen.common.builder.dependency.DependencyInDB.getVertexFromDB(DependencyInDB.java:236)
at org.tizen.common.builder.dependency.DependencyInDB.containsVertex(DependencyInDB.java:254)
at org.tizen.common.builder.BuildProcess.removeResource(BuildProcess.java:413)
at org.tizen.common.builder.BuildProcess.build(BuildProcess.java:282)
at org.tizen.web.project.builder.WebBuilder.build(WebBuilder.java:252)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:728)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:239)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:351)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:374)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
在我的结尾有效:
subprocess.Popen("py3 setup.py", cwd='/redist/PyMySQL/')