importing libraries not working 2.6.4

Discussion in 'Python' started by Routb3d, Feb 27, 2010.

  1. Routb3d

    Routb3d Guest

    I used the x86 Python 2.6.4 installer. I am working in x64 Win7 pro.

    I have tried adjusting environment variables as well as putting the
    files directly in the search path of Python.. Python still returns
    this.. Any ideas?

    >>> import sys
    >>> sys.path

    ['C:\\Python26\\Lib\\idlelib', 'C:\\Program Files\\Autodesk\\Maya2010\
    \Python\\Lib\\site-packages', 'C:\\Windows\\system32\\python26.zip',
    'C:\\Python26\\DLLs', 'C:\\Python26\\lib', 'C:\\Python26\\lib\\plat-
    win', 'C:\\Python26\\lib\\lib-tk', 'C:\\Python26', 'C:\\Python26\\lib\
    \site-packages']
    >>> import cv


    Traceback (most recent call last):
    File "<pyshell#4>", line 1, in <module>
    import cv
    ImportError: DLL load failed: The specified module could not be found.


    Any help would be greatly appreciated.
    Routb3d, Feb 27, 2010
    #1
    1. Advertising

  2. On Friday 26 February 2010 16:06:56 Routb3d wrote:
    > I used the x86 Python 2.6.4 installer. I am working in x64 Win7 pro.
    >
    > I have tried adjusting environment variables as well as putting the
    > files directly in the search path of Python.. Python still returns
    > this.. Any ideas?


    Where are you expecting the cv module / package to be? It's certainly not in
    the standard library -- at least not in my install of Python 2.6.4...

    >
    > >>> import sys
    > >>> sys.path

    >
    > ['C:\\Python26\\Lib\\idlelib', 'C:\\Program Files\\Autodesk\\Maya2010\
    > \Python\\Lib\\site-packages', 'C:\\Windows\\system32\\python26.zip',
    > 'C:\\Python26\\DLLs', 'C:\\Python26\\lib', 'C:\\Python26\\lib\\plat-
    > win', 'C:\\Python26\\lib\\lib-tk', 'C:\\Python26', 'C:\\Python26\\lib\
    > \site-packages']
    >
    > >>> import cv

    >
    > Traceback (most recent call last):
    > File "<pyshell#4>", line 1, in <module>
    > import cv
    > ImportError: DLL load failed: The specified module could not be found.
    >
    >
    > Any help would be greatly appreciated.



    ----
    Rami Chowdhury
    "Strangers are just friends who haven't had enough gin." -- Howdle's Saying
    408-597-7068 (US) / 07875-841-046 (UK) / 01819-245544 (BD)
    Rami Chowdhury, Feb 27, 2010
    #2
    1. Advertising

  3. On Friday 26 February 2010 17:42:04 Isaiah Coberly wrote:
    > Thanks for the reply.
    >
    > I tried putting the files from
    >
    > C:\OpenCV2.0\Python2.6\Lib
    >
    > too
    >
    > C:\Python26\Lib\site-packages
    >
    > and Python still wont import..
    >
    > I adjusted the environment variables to try and import maya.standalone but
    > no dice on that either.
    >


    Sorry, you've still not told me where you expect it to be. Could you let us
    know what .py files you can see in C:\OpenCV2.0\Python2.6\Lib ?

    >
    > On Fri, Feb 26, 2010 at 4:30 PM, Rami Chowdhury

    <>wrote:
    > > On Friday 26 February 2010 16:06:56 Routb3d wrote:
    > > > I used the x86 Python 2.6.4 installer. I am working in x64 Win7 pro.
    > > >
    > > > I have tried adjusting environment variables as well as putting the
    > > > files directly in the search path of Python.. Python still returns
    > > > this.. Any ideas?

    > >
    > > Where are you expecting the cv module / package to be? It's certainly not
    > > in
    > > the standard library -- at least not in my install of Python 2.6.4...
    > >
    > > > >>> import sys
    > > > >>> sys.path
    > > >
    > > > ['C:\\Python26\\Lib\\idlelib', 'C:\\Program Files\\Autodesk\\Maya2010\
    > > > \Python\\Lib\\site-packages', 'C:\\Windows\\system32\\python26.zip',
    > > > 'C:\\Python26\\DLLs', 'C:\\Python26\\lib', 'C:\\Python26\\lib\\plat-
    > > > win', 'C:\\Python26\\lib\\lib-tk', 'C:\\Python26', 'C:\\Python26\\lib\
    > > > \site-packages']
    > > >
    > > > >>> import cv
    > > >
    > > > Traceback (most recent call last):
    > > > File "<pyshell#4>", line 1, in <module>
    > > >
    > > > import cv
    > > >
    > > > ImportError: DLL load failed: The specified module could not be found.
    > > >
    > > >
    > > > Any help would be greatly appreciated.

    > >
    > > ----
    > > Rami Chowdhury
    > > "Strangers are just friends who haven't had enough gin." -- Howdle's
    > > Saying 408-597-7068 (US) / 07875-841-046 (UK) / 01819-245544 (BD)



    ----
    Rami Chowdhury
    "Ninety percent of everything is crap." -- Sturgeon's Law
    408-597-7068 (US) / 07875-841-046 (UK) / 01819-245544 (BD)
    Rami Chowdhury, Feb 27, 2010
    #3
  4. On Friday 26 February 2010 21:49:00 Isaiah Coberly wrote:
    > Thanks for your help Rami.. I got it working.. I did some digging around
    > and found out that I needed to install opencv as admin.. Now Im trying to
    > run one of the samples and up against my next chalange.
    >
    > Argg.. There are so many pit falls!
    >
    > Thanks again,
    >


    Glad to be able to help :)

    Especially when you've managed to solve something, could you please remember
    to CC the list on your reply, so if people run across the problem in future
    they can benefit from your experience?

    Thanks,
    Rami

    >
    > On Fri, Feb 26, 2010 at 7:57 PM, Isaiah Coberly <> wrote:
    > > Thats the furthest I have seen it get.. Ill have to remember this..
    > >
    > > here is what Python returned..
    > >
    > > >>> from opencv import cv

    > >
    > > Traceback (most recent call last):
    > > File "<pyshell#2>", line 1, in <module>
    > >
    > > from opencv import cv
    > >
    > > File "C:\Python26\lib\site-packages\opencv\__init__.py", line 74, in
    > >
    > > <module>
    > >
    > > from cv import *
    > >
    > > File "C:\Python26\lib\site-packages\opencv\cv.py", line 25, in <module>
    > >
    > > _cv = swig_import_helper()
    > >
    > > File "C:\Python26\lib\site-packages\opencv\cv.py", line 21, in
    > >
    > > swig_import_helper
    > >
    > > _mod = imp.load_module('_cv', fp, pathname, description)
    > >
    > > ImportError: DLL load failed: The specified module could not be found.
    > >
    > > On Fri, Feb 26, 2010 at 7:53 PM, Rami Chowdhury

    <>wrote:
    > >> On Feb 26, 2010, at 19:47 , Isaiah Coberly wrote:
    > >>
    > >> C:\OpenCV2.0\Python2.6\Lib\site-packages
    > >>
    > >> no .py files here..
    > >>
    > >> cv.pyd
    > >> libcv.dll.a
    > >>
    > >>
    > >> C:\OpenCV2.0\Python2.6\Lib\site-packages\opencv
    > >>
    > >> _init_.py
    > >> matlan_syntax.py
    > >> adaptors.py
    > >> cv.py
    > >>
    > >>
    > >> It looks to me like 'opencv' is structured as a package, from which you
    > >> should be able to import and work with Python libraries. Have you tried
    > >> putting the above site-packages directory in sys.path:
    > >>
    > >> import sys; sys.path.append('C:
    > >> \\OpenCV2.0\\Python2.6\\Lib\\site-packages')
    > >>
    > >> and then doing:
    > >>
    > >> from opencv import cv
    > >>
    > >> ?
    > >>
    > >> Did I still need to compile this even though it was a win 32 installer?
    > >>
    > >>
    > >> I don't think so, no -- AFAIK the .pyd files are compiled CPython
    > >> extension modules, so it looks like they're all compiled for you.
    > >>
    > >> -------------
    > >> Rami Chowdhury
    > >> "Never assume malice when stupidity will suffice." -- Hanlon's Razor
    > >> 408-597-7068 (US) / 07875-841-046 (UK) / 0189-245544 (BD)
    > >>
    > >>
    > >>
    > >>
    > >>
    > >>
    > >> On Fri, Feb 26, 2010 at 6:12 PM, Rami Chowdhury
    > >> <
    > >>
    > >> > wrote:
    > >>> On Friday 26 February 2010 17:42:04 Isaiah Coberly wrote:
    > >>> > Thanks for the reply.
    > >>> >
    > >>> > I tried putting the files from
    > >>> >
    > >>> > C:\OpenCV2.0\Python2.6\Lib
    > >>> >
    > >>> > too
    > >>> >
    > >>> > C:\Python26\Lib\site-packages
    > >>> >
    > >>> > and Python still wont import..
    > >>> >
    > >>> > I adjusted the environment variables to try and import
    > >>> > maya.standalone
    > >>>
    > >>> but
    > >>>
    > >>> > no dice on that either.
    > >>>
    > >>> Sorry, you've still not told me where you expect it to be. Could you
    > >>> let us
    > >>> know what .py files you can see in C:\OpenCV2.0\Python2.6\Lib ?
    > >>>
    > >>> > On Fri, Feb 26, 2010 at 4:30 PM, Rami Chowdhury
    > >>>
    > >>> <>wrote:
    > >>> > > On Friday 26 February 2010 16:06:56 Routb3d wrote:
    > >>> > > > I used the x86 Python 2.6.4 installer. I am working in x64 Win7
    > >>>
    > >>> pro.
    > >>>
    > >>> > > > I have tried adjusting environment variables as well as putting
    > >>> > > > the files directly in the search path of Python.. Python still
    > >>> > > > returns this.. Any ideas?
    > >>> > >
    > >>> > > Where are you expecting the cv module / package to be? It's
    > >>> > > certainly
    > >>>
    > >>> not
    > >>>
    > >>> > > in
    > >>> > > the standard library -- at least not in my install of Python
    > >>> > > 2.6.4...
    > >>> > >
    > >>> > > > >>> import sys
    > >>> > > > >>> sys.path
    > >>> > > >
    > >>> > > > ['C:\\Python26\\Lib\\idlelib',
    > >>> > > > 'C:\\ProgramFiles\\Autodesk\\Maya2010\
    > >>>
    > >>> > > > \Python\\Lib\\site-packages', 'C:
    > >>> \\Windows\\system32\\python26.zip',
    > >>>
    > >>> > > > 'C:\\Python26\\DLLs', 'C:\\Python26\\lib', 'C:
    > >>> \\Python26\\lib\\plat-
    > >>>
    > >>> > > > win', 'C:\\Python26\\lib\\lib-tk', 'C:\\Python26', 'C:
    > >>> \\Python26\\lib\
    > >>>
    > >>> > > > \site-packages']
    > >>> > > >
    > >>> > > > >>> import cv
    > >>> > > >
    > >>> > > > Traceback (most recent call last):
    > >>> > > > File "<pyshell#4>", line 1, in <module>
    > >>> > > >
    > >>> > > > import cv
    > >>> > > >
    > >>> > > > ImportError: DLL load failed: The specified module could not be
    > >>>
    > >>> found.
    > >>>
    > >>> > > > Any help would be greatly appreciated.
    > >>> > >
    > >>> > > ----
    > >>> > > Rami Chowdhury
    > >>> > > "Strangers are just friends who haven't had enough gin." --
    > >>> > > Howdle's Saying 408-597-7068 (US) / 07875-841-046 (UK) /
    > >>> > > 01819-245544 (BD)
    > >>>
    > >>> ----
    > >>> Rami Chowdhury
    > >>> "Ninety percent of everything is crap." -- Sturgeon's Law
    > >>> 408-597-7068 (US) / 07875-841-046 (UK) / 01819-245544 (BD)



    ----
    Rami Chowdhury
    -----BEGIN GEEK CODE BLOCK-----
    Version: 3.1
    GO d-(+++) s-:++ a-- C++> ULX+> P++ L++
    E+ W+++ w-- PS+ PE t+ b+++ e++ !r z?
    ------END GEEK CODE BLOCK------
    408-597-7068 (US) / 07875-841-046 (UK) / 01819-245544 (BD)
    Rami Chowdhury, Feb 27, 2010
    #4
  5. Will do.. Thanks again..

    Sent from my iPhone

    On Feb 27, 2010, at 8:36 AM, Rami Chowdhury <>
    wrote:

    > On Friday 26 February 2010 21:49:00 Isaiah Coberly wrote:
    >> Thanks for your help Rami.. I got it working.. I did some digging
    >> around
    >> and found out that I needed to install opencv as admin.. Now Im
    >> trying to
    >> run one of the samples and up against my next chalange.
    >>
    >> Argg.. There are so many pit falls!
    >>
    >> Thanks again,
    >>

    >
    > Glad to be able to help :)
    >
    > Especially when you've managed to solve something, could you please
    > remember
    > to CC the list on your reply, so if people run across the problem in
    > future
    > they can benefit from your experience?
    >
    > Thanks,
    > Rami
    >
    >>
    >> On Fri, Feb 26, 2010 at 7:57 PM, Isaiah Coberly <>
    >> wrote:
    >>> Thats the furthest I have seen it get.. Ill have to remember this..
    >>>
    >>> here is what Python returned..
    >>>
    >>>>>> from opencv import cv
    >>>
    >>> Traceback (most recent call last):
    >>> File "<pyshell#2>", line 1, in <module>
    >>>
    >>> from opencv import cv
    >>>
    >>> File "C:\Python26\lib\site-packages\opencv\__init__.py", line 74,
    >>> in
    >>>
    >>> <module>
    >>>
    >>> from cv import *
    >>>
    >>> File "C:\Python26\lib\site-packages\opencv\cv.py", line 25, in
    >>> <module>
    >>>
    >>> _cv = swig_import_helper()
    >>>
    >>> File "C:\Python26\lib\site-packages\opencv\cv.py", line 21, in
    >>>
    >>> swig_import_helper
    >>>
    >>> _mod = imp.load_module('_cv', fp, pathname, description)
    >>>
    >>> ImportError: DLL load failed: The specified module could not be
    >>> found.
    >>>
    >>> On Fri, Feb 26, 2010 at 7:53 PM, Rami Chowdhury

    > <>wrote:
    >>>> On Feb 26, 2010, at 19:47 , Isaiah Coberly wrote:
    >>>>
    >>>> C:\OpenCV2.0\Python2.6\Lib\site-packages
    >>>>
    >>>> no .py files here..
    >>>>
    >>>> cv.pyd
    >>>> libcv.dll.a
    >>>>
    >>>>
    >>>> C:\OpenCV2.0\Python2.6\Lib\site-packages\opencv
    >>>>
    >>>> _init_.py
    >>>> matlan_syntax.py
    >>>> adaptors.py
    >>>> cv.py
    >>>>
    >>>>
    >>>> It looks to me like 'opencv' is structured as a package, from
    >>>> which you
    >>>> should be able to import and work with Python libraries. Have you
    >>>> tried
    >>>> putting the above site-packages directory in sys.path:
    >>>>
    >>>> import sys; sys.path.append('C:
    >>>> \\OpenCV2.0\\Python2.6\\Lib\\site-packages')
    >>>>
    >>>> and then doing:
    >>>>
    >>>> from opencv import cv
    >>>>
    >>>> ?
    >>>>
    >>>> Did I still need to compile this even though it was a win 32
    >>>> installer?
    >>>>
    >>>>
    >>>> I don't think so, no -- AFAIK the .pyd files are compiled CPython
    >>>> extension modules, so it looks like they're all compiled for you.
    >>>>
    >>>> -------------
    >>>> Rami Chowdhury
    >>>> "Never assume malice when stupidity will suffice." -- Hanlon's
    >>>> Razor
    >>>> 408-597-7068 (US) / 07875-841-046 (UK) / 0189-245544 (BD)
    >>>>
    >>>>
    >>>>
    >>>>
    >>>>
    >>>>
    >>>> On Fri, Feb 26, 2010 at 6:12 PM, Rami Chowdhury
    >>>> <
    >>>>
    >>>>> wrote:
    >>>>> On Friday 26 February 2010 17:42:04 Isaiah Coberly wrote:
    >>>>>> Thanks for the reply.
    >>>>>>
    >>>>>> I tried putting the files from
    >>>>>>
    >>>>>> C:\OpenCV2.0\Python2.6\Lib
    >>>>>>
    >>>>>> too
    >>>>>>
    >>>>>> C:\Python26\Lib\site-packages
    >>>>>>
    >>>>>> and Python still wont import..
    >>>>>>
    >>>>>> I adjusted the environment variables to try and import
    >>>>>> maya.standalone
    >>>>>
    >>>>> but
    >>>>>
    >>>>>> no dice on that either.
    >>>>>
    >>>>> Sorry, you've still not told me where you expect it to be. Could
    >>>>> you
    >>>>> let us
    >>>>> know what .py files you can see in C:\OpenCV2.0\Python2.6\Lib ?
    >>>>>
    >>>>>> On Fri, Feb 26, 2010 at 4:30 PM, Rami Chowdhury
    >>>>>
    >>>>> <>wrote:
    >>>>>>> On Friday 26 February 2010 16:06:56 Routb3d wrote:
    >>>>>>>> I used the x86 Python 2.6.4 installer. I am working in x64 Win7
    >>>>>
    >>>>> pro.
    >>>>>
    >>>>>>>> I have tried adjusting environment variables as well as putting
    >>>>>>>> the files directly in the search path of Python.. Python still
    >>>>>>>> returns this.. Any ideas?
    >>>>>>>
    >>>>>>> Where are you expecting the cv module / package to be? It's
    >>>>>>> certainly
    >>>>>
    >>>>> not
    >>>>>
    >>>>>>> in
    >>>>>>> the standard library -- at least not in my install of Python
    >>>>>>> 2.6.4...
    >>>>>>>
    >>>>>>>>>>> import sys
    >>>>>>>>>>> sys.path
    >>>>>>>>
    >>>>>>>> ['C:\\Python26\\Lib\\idlelib',
    >>>>>>>> 'C:\\ProgramFiles\\Autodesk\\Maya2010\
    >>>>>
    >>>>>>>> \Python\\Lib\\site-packages', 'C:
    >>>>> \\Windows\\system32\\python26.zip',
    >>>>>
    >>>>>>>> 'C:\\Python26\\DLLs', 'C:\\Python26\\lib', 'C:
    >>>>> \\Python26\\lib\\plat-
    >>>>>
    >>>>>>>> win', 'C:\\Python26\\lib\\lib-tk', 'C:\\Python26', 'C:
    >>>>> \\Python26\\lib\
    >>>>>
    >>>>>>>> \site-packages']
    >>>>>>>>
    >>>>>>>>>>> import cv
    >>>>>>>>
    >>>>>>>> Traceback (most recent call last):
    >>>>>>>> File "<pyshell#4>", line 1, in <module>
    >>>>>>>>
    >>>>>>>> import cv
    >>>>>>>>
    >>>>>>>> ImportError: DLL load failed: The specified module could not be
    >>>>>
    >>>>> found.
    >>>>>
    >>>>>>>> Any help would be greatly appreciated.
    >>>>>>>
    >>>>>>> ----
    >>>>>>> Rami Chowdhury
    >>>>>>> "Strangers are just friends who haven't had enough gin." --
    >>>>>>> Howdle's Saying 408-597-7068 (US) / 07875-841-046 (UK) /
    >>>>>>> 01819-245544 (BD)
    >>>>>
    >>>>> ----
    >>>>> Rami Chowdhury
    >>>>> "Ninety percent of everything is crap." -- Sturgeon's Law
    >>>>> 408-597-7068 (US) / 07875-841-046 (UK) / 01819-245544 (BD)

    >
    >
    > ----
    > Rami Chowdhury
    > -----BEGIN GEEK CODE BLOCK-----
    > Version: 3.1
    > GO d-(+++) s-:++ a-- C++> ULX+> P++ L++
    > E+ W+++ w-- PS+ PE t+ b+++ e++ !r z?
    > ------END GEEK CODE BLOCK------
    > 408-597-7068 (US) / 07875-841-046 (UK) / 01819-245544 (BD)
    Isaiah Coberly, Feb 27, 2010
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. plb
    Replies:
    2
    Views:
    344
  2. Karsten Wutzke
    Replies:
    21
    Views:
    914
    Roedy Green
    Jun 29, 2007
  3. Sriram Srinivasan
    Replies:
    13
    Views:
    558
    Benjamin Kaplan
    Nov 12, 2009
  4. cugf_0956
    Replies:
    6
    Views:
    146
    Eric Hodel
    Mar 27, 2007
  5. Renato
    Replies:
    5
    Views:
    100
    Renato Vernucio
    Feb 17, 2014
Loading...

Share This Page