PTVS crash when trying to do relative import in the REPL


Whenever I tried to do something like "from .models import MyModel", I got the following error and then VS crashes:

ValueError: Attempted relative import in non-package


Zooba wrote Dec 19, 2013 at 10:42 AM

That error message is coming from Python and is probably correct, but the crash is unexpected.

Just to confirm, this is happening when you press F5 to run your script? Are you able to provide some more info about your project (file system layout and/or code) and your system (Tools-Python Tools-Diagnostic Info is a quick way to get the info we need)? You can email them to ptvshelp@microsoft.com if you don't want to put them up publicly (but include a link to this page and we'll reply here).

pminaev wrote Dec 20, 2013 at 8:04 PM

I can confirm that this is happening every time you do a relative import in the REPL.

pminaev wrote Dec 20, 2013 at 8:19 PM

The fix will be in the next dev build, and ultimately in 2.1. Thank you for reporting this!