"module could not be found" error

Joel Goldstick joel.goldstick at gmail.com
Tue Mar 19 11:26:02 EDT 2013


On Tue, Mar 19, 2013 at 11:10 AM, Robert Flintham <
Robert.Flintham at uhb.nhs.uk> wrote:

> Hi,****
>
> ** **
>
> I’m trying to run the following, with <an array> representing an array of
> floating point numbers:****
>
> ** **
>
> ------------------------------------------------------------****
>
> import numpy as np****
>
> import scipy as sp****
>
> from scipy import optimize****
>
> ** **
>
> xdata=<an array>****
>
> ydata=<an array>****
>
> ** **
>
> def t2fit(x,T2,A):****
>
>     return A * np.exp(-x/T2)****
>
> ** **
>
> popt, pcov = optimize.curve_fit(t2fit, xdata, ydata, p0=None, sigma=None)*
> ***
>
> ------------------------------------------------------------****
>
> ** **
>
> But I’m getting an ImportError:****
>
> ** **
>
> Traceback (most recent call last):****
>
>   File
> "K:\eclipse\plugins\org.python.pydev_2.7.1.2012100913\pysrc\pydevd.py",
> line 1397, in <module>****
>
>     debugger.run(setup['file'], None, None)****
>
>   File
> "K:\eclipse\plugins\org.python.pydev_2.7.1.2012100913\pysrc\pydevd.py",
> line 1090, in run****
>
>     pydev_imports.execfile(file, globals, locals) #execute the script****
>
>  File
> "K:\eclipse\plugins\org.python.pydev_2.7.1.2012100913\pysrc\_pydev_execfile.py",
> line 38, in execfile****
>
>     exec(compile(contents+"\n", file, 'exec'), glob, loc) #execute the
> script****
>
>   File "K:\PROGRAMMING\MRI_Python\fatfrac.py", line 7, in <module>****
>
>     from scipy import optimize****
>
>   File "K:\Python33\lib\site-packages\scipy\optimize\__init__.py", line
> 147, in <module>****
>
>     from ._minimize import *****
>
>   File "K:\Python33\lib\site-packages\scipy\optimize\_minimize.py", line
> 29, in <module>****
>
>     from .lbfgsb import _minimize_lbfgsb****
>
>   File "K:\Python33\lib\site-packages\scipy\optimize\lbfgsb.py", line 40,
> in <module>****
>
>     from . import _lbfgsb****
>
> ImportError: DLL load failed: The specified module could not be found.****
>
> **
>

Looking at the paths, it looks like some packages are for p 2.7 and some
for p 3.3

> **
>
> ** **
>
> I’ve checked the path, and the file lbfgsb.py is definitely at that
> location (as are optimize.py and _minimize.py).  Does anyone know why I’m
> getting the error?****
>
> ** **
>
> All the best,****
>
> Rob****
>
> ** **
>
> ** **
>
> ** **
>
> *Robert Flintham
> Trainee Clinical Scientist - MRI*****
>
> Tel:****
>
>  +44 (0)121 371 7000****
>
> Email:****
>
>  Robert.Flintham at uhb.nhs.uk****
>
> Web:****
>
>  http://www.uhb.nhs.uk****
>
>
> *We’re bringing the world's most advanced cancer treatments to Birmingham.
> Find out more at www.qecancerappeal.org or text **QEHB01 £5** to **70070**to donate £5 to our appeal.
> **
> **
> RRPPS
> Medical Physics - University Hospitals Birmingham NHS Foundation Trust
> 63 Melchett Road, Kings Norton,
> Birmingham, B30 3HP
> **
> *******
>
>
>
> DISCLAIMER:
>
> This email and any attachments hereto contains proprietary information, some or all of which may be confidential or legally privileged. It is for the exclusive use of the intended recipient(s) only. If an addressing or transmission error has misdirected this e-mail and you are not the intended recipient(s), please notify the author by replying to this e-mail. If you are not the intended recipient you must not use, disclose, distribute, copy, print, or rely on this e-mail or any attachments, as this may be unlawful.
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
>


-- 
Joel Goldstick
http://joelgoldstick.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20130319/afd19fd5/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.gif
Type: image/gif
Size: 1941 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20130319/afd19fd5/attachment.gif>


More information about the Python-list mailing list