2

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?

arturomp
  • 28,790
  • 10
  • 43
  • 72
user4352158
  • 731
  • 4
  • 13
  • 24

2 Answers2

1

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.

thesiegs
  • 13
  • 3
  • 1
    I thought that too, but I just tried pip installing it and `import QSTK` worked fine. – geoelectric Apr 02 '15 at 19:26
  • when I try that, I now get the error `ImportError: No module named QSTK.qstkutil.qsdateutil` – user4352158 Apr 02 '15 at 22:21
  • Do a `pip freeze` and confirm that pip thinks you have this package. If so, try just an `import QSTK` from the interpreter, as geoelectric did and report back on that. Are you using a virtual env by chance? – thesiegs Apr 03 '15 at 20:24
0

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')
Atti
  • 380
  • 4
  • 21