No module named QSTK in Python

711 Views Asked by At

I am trying to import the module

import QSTK
import QSTK.qstkutil.qsdateutil as du
import QSTK.qstkutil.tsutil as tsu
import QSTK.qstkutil.DataAccess as da

But I get the Error

ImportError: No module named QSTK

When I type

import sys
sys.path

I get:

['', 'C:\\Python27\\Lib\\idlelib', 'C:\\Python27\\lib\\site-packages\\copper-0.0.4-py2.7.egg', 
'C:\\Python27\\lib\\site-packages\\scikit_learn-0.13.1-py2.7-win32.egg', 'C:\\Windows\\system32\\python27.zip', 'C:\\Python27\\DLLs', 'C:\\Python27\\lib', 'C:\\Python27\\lib\\plat-win', 'C:\\Python27\\lib\\lib-tk', 'C:\\Python27', 'C:\\Python27\\lib\\site-packages', 'C:\\Python27\\lib\\site-packages\\win32', 'C:\\Python27\\lib\\site-packages\\win32\\lib', 'C:\\Python27\\lib\\site-packages\\Pythonwin', 'C:\\Python27\\lib\\site-packages\\wx-2.8-msw-unicode']

And I already have in the path C:\Python27\Lib\site-packages\QSTK\qstkutil there the file qsdateutil.py

I also already see in C:\Python27\Lib\site-packages\QSTK\qstkutil contains a file named __init__.py

Anyone can help?

2

There are 2 best solutions below

3
On

I suspect that it doesn't want to be imported at the very top of the package. Remove that first import of QSTK and see if it works, then.

A glance at some sample code seems to support this.

0
On

Set the path up within your project, this is how i got it to work within my project:

import sys
sys.path.append('../../QSTK-0.2.8')