首页 新闻 会员 周边 捐助

python selenium ,import package路径了,确还报错from packages import location ImportErr

0
悬赏园豆:5 [待解决问题]

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]

lavender_love的主页 lavender_love | 初学一级 | 园豆:197
提问于:2015-06-02 17:56
< >
分享
所有回答(1)
0

ImportError: No module named packages

你没有这个路径吧

jiu~ | 园豆:444 (菜鸟二级) | 2015-06-03 00:50

有的,在py目录下,我建了个packages目录的。我把这个Y:\py\package 加入环境变量中也不行

支持(0) 反对(0) lavender_love | 园豆:197 (初学一级) | 2015-06-03 09:43
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册