from selenium import webdriver
import sys
import time
sys.path.append("Y:\\py\\packages")
#调用location.py文件的定位反复
from packages import location
--------------运行报错
Traceback (most recent call last):
File "Y:\py\webdriverfz.py", line 8, in <module>
from packages import location
ImportError: No module named packages
[Finished in 1.7s with exit code 1]
[shell_cmd: python -u "Y:\py\webdriverfz.py"]
[dir: Y:\py]
[path: C:\Python27\;C:\Python27\Scripts;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Java\jdk1.6.0_05\bin;C:\Program Files\IronPython 2.6 for .NET 4.0 RC;C:\IBM\ITM\bin;C:\IBM\ITM\InstallITM;C:\IBM\ITM\TMAITM6;C:\Program Files\Java\jdk1.6.0_05/bin;C:\Program Files\Java\jdk1.6.0_05/jre/bin;C:\Program Files\IronPython 2.6 for .NET 4.0 RC;%APPDATA%\Python\Scripts]
ImportError: No module named packages
你没有这个路径吧
有的,在py目录下,我建了个packages目录的。我把这个Y:\py\package 加入环境变量中也不行