hari madhav
hari madhav

Reputation: 151

Getting error While importing python module

I am trying to import another python file to my script.

My script is :

    import os
    from selenium import webdriver
    from selenium.webdriver.firefox.webdriver import WebDriver
    from selenium.webdriver.common.action_chains import ActionChains
    import time
    import sys
    sys.path.append('/Users/admin/Desktop/web_Suite/Scripts/funcLib.py')
    from funcLib import *

deviceSelection()

when I run this script, i am getting error :

 from funcLib import *
ImportError: No module named funcLib

What i am doing wrong here ? Can anyone please help

Upvotes: 0

Views: 1039

Answers (1)

Berserker
Berserker

Reputation: 1112

Append the folder funcLib is in, to sys.path, not the py file itself.

So sys.path.append('/Users/admin/Desktop/web_Suite/Scripts/')

Upvotes: 1

Related Questions