[nengo-user] Importing User-Defined Modules

Brian Krainer bkrainer731 at gmail.com
Mon Jul 21 15:01:11 EDT 2014


I have a file called 'functions.py' which I am trying to import. At the top
of the script with the network I included 'import functions' but I'm
getting the error "ImportErro: No Module named functions" when I try to
open the script in the nengo workspace. I did what Xuan suggested with
sys.path.append, but I still get the same error. Any ideas?

brian


On Mon, Jul 21, 2014 at 2:46 PM, Daniel Rasmussen <dhrsmss at gmail.com> wrote:

> Hi Brian,
>
> What difficulty are you having when importing the file?  Could you post
> the error message?  A Nengo script is just a regular Python file, so
> importing should work the same as anywhere else in Python.  One thing to
> remember is that in Nengo 1.4 everything is running through Jython, so you
> need to make sure that the module you're importing is Jython compatible.
>
> Daniel
>
>
> On 21 July 2014 13:51, Brian Krainer <bkrainer731 at gmail.com> wrote:
>
>> Hello,
>>
>> As I'm sure you know, Python allows users to import other .py files and
>> use functions from those imported files. Is there any way to import my own
>> files in the .py file with the Nengo network? I've been trying to do this
>> but I've been having some difficulties.
>>
>> Thanks,
>>
>> Brian
>>
>> _______________________________________________
>> nengo-user mailing list
>> nengo-user at ctnsrv.uwaterloo.ca
>> http://ctnsrv.uwaterloo.ca/mailman/listinfo/nengo-user
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://artsservices.uwaterloo.ca/pipermail/nengo-user/attachments/20140721/2fdef516/attachment-0002.html>


More information about the nengo-user mailing list