Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/341.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python pdoc-没有名为xxx的模块_Python_Python 3.x - Fatal编程技术网

Python pdoc-没有名为xxx的模块

Python pdoc-没有名为xxx的模块,python,python-3.x,Python,Python 3.x,我试图用pdoc创建一个普通的.html文件,但收到一条错误消息 文件1:gui.py # -*- coding: utf-8 -*- """gui test""" # Form implementation generated from reading ui file 'gui.ui' # # Created by: PyQt4 UI code generator 4.11.4 # # WARNING! All changes made in this file will be lost!

我试图用pdoc创建一个普通的.html文件,但收到一条错误消息

文件1:gui.py

# -*- coding: utf-8 -*-
"""gui test"""

# Form implementation generated from reading ui file 'gui.ui'
#
# Created by: PyQt4 UI code generator 4.11.4
#
# WARNING! All changes made in this file will be lost!

from PyQt4 import QtCore, QtGui

try:
    _fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
    def _fromUtf8(s):
        return s

try:
    _encoding = QtGui.QApplication.UnicodeUTF8
    def _translate(context, text, disambig):
        return QtGui.QApplication.translate(context, text, disambig, _encoding)
except AttributeError:
    def _translate(context, text, disambig):
        return QtGui.QApplication.translate(context, text, disambig)

class Ui_MainWindow(object):
    """gui test again"""
    def setupUi(self, MainWindow):
        MainWindow.setObjectName(_fromUtf8("MainWindow"))
        MainWindow.resize(800, 600)
        self.centralwidget = QtGui.QWidget(MainWindow)
        self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtGui.QMenuBar(MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 21))
        self.menubar.setObjectName(_fromUtf8("menubar"))
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QtGui.QStatusBar(MainWindow)
        self.statusbar.setObjectName(_fromUtf8("statusbar"))
        MainWindow.setStatusBar(self.statusbar)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)

    def retranslateUi(self, MainWindow):
        MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow", None))
文件2:start.py

# -*- coding: utf-8 -*-
"""just a test"""

import sys
from PyQt4 import QtCore, QtGui
from gui import Ui_MainWindow



class StartQT4(QtGui.QMainWindow):
    "just testing again"
    def __init__(self, parent=None):
        QtGui.QWidget.__init__(self, parent)
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)


app = QtGui.QApplication(sys.argv)
myapp = StartQT4()
myapp.show()

sys.exit(app.exec_())
我正试图执行:

python“C:\Python34\Scripts\pdoc”--html“C:\pathtothefile\script.py”

并得到信息:

File "C:\pathtothefile\script.py", line 6, in <module> 
from gui import Ui_MainWindow
ImportError: No module named 'gui'
文件“C:\pathtothefile\script.py”,第6行,在
从gui导入Ui_主窗口
ImportError:没有名为“gui”的模块

gui.py与start.py位于同一文件夹中。我如何告诉pdoc是这样的?

您需要将带有gui.py和start.py的文件夹添加到$PYTHONPATH

您需要将带有gui.py和start.py的文件夹添加到$PYTHONPATH

那么。。。现在它在执行命令时启动我的程序。。。“python”C:\Python34\Scripts\pdoc--html“C:\pathtothefile\script.py”不应该是正确的吗?仍然在启动程序只是
C:\Python34\Scripts\pdoc--html C:\paththefile\script.py
文档要求
pdoc--html csv
您确定pdoc在该路径上吗?如果您正在使用这些引号,请删除它们。您可以将cd刻录到C:\Python34\Scripts\并调用
pdoc--html C:\pathtothefile\script.py
我现在没有使用任何引号。错误消息包含引号。是的,我确信,这就是道路。如果我的.py文件不包含pdoc找不到的任何模块,那么我使用的第一个命令(问题中的命令)在开始时与引号和“python”一起工作。。。现在它在执行命令时启动我的程序。。。“python”C:\Python34\Scripts\pdoc--html“C:\pathtothefile\script.py”不应该是正确的吗?仍然在启动程序只是
C:\Python34\Scripts\pdoc--html C:\paththefile\script.py
文档要求
pdoc--html csv
您确定pdoc在该路径上吗?如果您正在使用这些引号,请删除它们。您可以将cd刻录到C:\Python34\Scripts\并调用
pdoc--html C:\pathtothefile\script.py
我现在没有使用任何引号。错误消息包含引号。是的,我确信,这就是道路。如果我的.py文件不包含pdoc找不到的任何模块,那么我使用的第一个命令(问题中的命令)在开始时使用引号和“python”。