<div dir="ltr">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?<br>
<br>brian<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jul 21, 2014 at 2:46 PM, Daniel Rasmussen <span dir="ltr"><<a href="mailto:dhrsmss@gmail.com" target="_blank">dhrsmss@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi Brian,<br><br></div>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.<br>
<br>Daniel<br></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5">On 21 July 2014 13:51, Brian Krainer <span dir="ltr"><<a href="mailto:bkrainer731@gmail.com" target="_blank">bkrainer731@gmail.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div><div>Hello,<br><br></div>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.<br>
<br>Thanks,<br><br></div>Brian<br></div>
<br></div></div>_______________________________________________<br>
nengo-user mailing list<br>
<a href="mailto:nengo-user@ctnsrv.uwaterloo.ca" target="_blank">nengo-user@ctnsrv.uwaterloo.ca</a><br>
<a href="http://ctnsrv.uwaterloo.ca/mailman/listinfo/nengo-user" target="_blank">http://ctnsrv.uwaterloo.ca/mailman/listinfo/nengo-user</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>