Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/5.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 ImportError:没有名为access_benchmark.common的模块-从Windows XP命令行运行_Python - Fatal编程技术网

Python ImportError:没有名为access_benchmark.common的模块-从Windows XP命令行运行

Python ImportError:没有名为access_benchmark.common的模块-从Windows XP命令行运行,python,Python,我已经阅读了绝大多数与“没有模块名为‘xxx’”相关的帖子,并尝试了提供的解决方案。我一定还是错过了什么。我尝试在PYTHON程序中使用sys.path.append import sys sys.path.append('C:\\Documents and Settings\\tgore\\git\\access_benchmark\\access_benchmark\\common') sys.path.append('C:\\Documents and Settin

我已经阅读了绝大多数与“没有模块名为‘xxx’”相关的帖子,并尝试了提供的解决方案。我一定还是错过了什么。我尝试在PYTHON程序中使用sys.path.append

    import sys
    sys.path.append('C:\\Documents and Settings\\tgore\\git\\access_benchmark\\access_benchmark\\common')
    sys.path.append('C:\\Documents and Settings\\tgore\\git\\access_benchmark\\access_benchmark')
    print sys.path
    import pyodbc
    import kmart_tabauth as tabauth
    import time
    from access_benchmark.common import get_user_info as df_prof
我尝试创建一个包含PYTHONPATH的.bat文件

    @echo off
    echo this is a test
    pause
    setlocal
    set PYTHONPATH="C:\documents and setting\tgore\git\access_benchmark\access_benchmark\common"
    c:\python27\python.exe "C:\documents and settings\tgore\git\access_benchmark\access_benchmark\database\db2\db2_main_nprc.py"
    endlocal
    pause
这两种选择似乎都没有任何区别。我仍然收到“未找到模块”错误消息。正在显示路径

目录结构如下:

    access_benchmark
    --access_benchmark
    ----common - common program(s) are here
    ------ get_user_info.py
    ------ other programs
    ----database
    ------db2 program this is running is here
    -------- db2_main_nprc.py 
    -------- other programs

尝试从access\u基准导入公用,然后从公用导入。。。同样的?我试过你的建议。现在它报告没有模块访问测试。让我补充一点,如果我直接从PYTHON运行它,那么一切都像champ一样工作。只有当我试着用XP命令运行它时,我才发现了一个问题,我(终于)解决了。PYTHONPATH语句需要双反斜杠。一旦我输入c:\\documents….\\t更多\\等等,它就起作用了。它是。。。开玩笑?Win-2*/;