Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'importerror:': 0.05; 'none,': 0.05; 'scipy': 0.05; 'skip:" 60': 0.05; 'none)': 0.07; '40,': 0.09; 'failed:': 0.09; 'imported': 0.09; 'path,': 0.09; 'path.': 0.09; 'skip:" 80': 0.09; 'subject:module': 0.09; 'windows,': 0.09; 'def': 0.10; 'subject:error': 0.11; 'subject:not': 0.11; 'file,': 0.15; 'stack': 0.15; 'numpy': 0.16; 'skip:" 70': 0.16; 'trace.': 0.16; 'wrote:': 0.17; 'found,': 0.17; 'load': 0.19; 'module': 0.19; 'variable': 0.20; 'skip:" 30': 0.20; 'trying': 0.21; 'import': 0.21; 'latter': 0.22; 'specified': 0.23; "i've": 0.23; 'script': 0.24; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; '(most': 0.27; 'am,': 0.27; '(as': 0.27; 'dll': 0.27; 'found.': 0.27; 'in.': 0.27; 'skip:" 50': 0.27; 'run': 0.28; 'environment': 0.29; 'search.': 0.29; 'array': 0.29; 'skip:_ 10': 0.29; "i'm": 0.29; 'maybe': 0.29; 'error': 0.30; 'checked': 0.30; 'point': 0.31; 'file': 0.32; 'could': 0.32; 'getting': 0.33; 'traceback': 0.33; 'anyone': 0.33; 'to:addr :python-list': 0.33; 'hi,': 0.33; 'skip:d 20': 0.34; 'path': 0.35; 'robert': 0.35; 'but': 0.36; 'loaded': 0.36; 'subject:" ': 0.36; 'skip:p 20': 0.36; 'does': 0.37; 'being': 0.37; 'why': 0.37; 'skip:o 20': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'received:192.168': 0.40; 'skip:n 10': 0.63; 'received:74.208': 0.71; 'presumably': 0.84; 'received:74.208.4.194': 0.84; 'numbers:': 0.91; 'subject:found': 0.91 Date: Tue, 19 Mar 2013 11:24:18 -0400 From: Dave Angel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130221 Thunderbird/17.0.3 MIME-Version: 1.0 To: python-list@python.org Subject: Re: "module could not be found" error References: <20130319151020.0606144837F@nhs-pd1e-esg103.ad1.nhs.net> In-Reply-To: <20130319151020.0606144837F@nhs-pd1e-esg103.ad1.nhs.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:3cCH0fx0J+XPYkPT7Gj3uWR4SfDDL7ff1Yz0SSIGoNe u6BjKQQ5bafh+zqAC/RcTtaJRljrHO4eZifeci6Aefw2FEKzct TeLc3WsUa6JhvmYuK64FAAJ4v6WODqTeUJ/B+ymrur2ScBdW/8 NLCxYNPrgKTDc3E0YmEBlEqeNnfR1cHTVs43ZHNvULP6SghUCn fU9Gg3nFAvT/d8YgKf48aw2V8+VY+AsSOiJ6IL0MaGuIcUvCAS iTY1cPXoo/CjlOFN11a7VCeydO/Ug8e3zwnuirZazLzwKvsgLg C58RWuMSYCiJJrjtKh/OyxW75TPplok1+n/MZV1okNvntVQLA= = X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 55 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1363706673 news.xs4all.nl 6971 [2001:888:2000:d::a6]:53855 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:41520 On 03/19/2013 11:10 AM, Robert Flintham wrote: > Hi, > > I'm trying to run the following, with representing an array of floating point numbers: > > ------------------------------------------------------------ > import numpy as np > import scipy as sp > from scipy import optimize > > xdata= > ydata= > > 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 > 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 > from scipy import optimize > File "K:\Python33\lib\site-packages\scipy\optimize\__init__.py", line 147, in > from ._minimize import * > File "K:\Python33\lib\site-packages\scipy\optimize\_minimize.py", line 29, in > from .lbfgsb import _minimize_lbfgsb > File "K:\Python33\lib\site-packages\scipy\optimize\lbfgsb.py", line 40, in > from . import _lbfgsb > ImportError: DLL load failed: The specified module could not be found. > > > 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? > You're on Windows, so presumably you're using the PATH environment variable for the following search. You checked the path for what file? it's looking for _lhfgsb.dll, or maybe _lhfgsb.pyc which is imported by lbfgsh.py. The latter file is found, as you can tell from the stack trace. That's the file you got the error in. So perhaps the dll isn't being loaded into a directory that's on the PATH. -- DaveA