question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Start with Debugging an unopened file leads to "Value does not fall within the expected range" error

See original GitHub issue

EDIT: Figured out the issue in https://github.com/Microsoft/PTVS/issues/4812#issuecomment-432839834


I am getting very bizarre behavior after update my Anaconda to 5.3.0 (with Python 3.7 now).

In any interactive window, when I try to import numpy, I get the following:

ConvexOptimization interactive window [PTVS 15.8.18241.1-15.0]
Type $help for a list of commands.
>>> import numpy
Traceback (most recent call last):
  File "C:\Users\Joey\Anaconda3\lib\site-packages\numpy\core\__init__.py", line 16, in <module>
    from . import multiarray
ImportError: DLL load failed: The specified module could not be found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\Joey\Anaconda3\lib\site-packages\numpy\__init__.py", line 142, in <module>
    from . import add_newdocs
  File "C:\Users\Joey\Anaconda3\lib\site-packages\numpy\add_newdocs.py", line 13, in <module>
    from numpy.lib import add_newdoc
  File "C:\Users\Joey\Anaconda3\lib\site-packages\numpy\lib\__init__.py", line 8, in <module>
    from .type_check import *
  File "C:\Users\Joey\Anaconda3\lib\site-packages\numpy\lib\type_check.py", line 11, in <module>
    import numpy.core.numeric as _nx
  File "C:\Users\Joey\Anaconda3\lib\site-packages\numpy\core\__init__.py", line 26, in <module>
    raise ImportError(msg)
ImportError: 
Importing the multiarray numpy extension module failed.  Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try `git clean -xdf` (removes all
files not under version control).  Otherwise reinstall numpy.

Original error was: DLL load failed: The specified module could not be found.

However if I do the same from the Anaconda Prompt shortcut, which executes %windir%\System32\cmd.exe "/K" C:\Users\Joey\Anaconda3\Scripts\activate.bat C:\Users\Joey\Anaconda3, numpy imports fine:

(base) C:\Users\Joey>python
Python 3.7.0 (default, Jun 28 2018, 08:04:48) [MSC v.1912 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> # Good to go

Even weirder, almost all of the python files in my VS Solution can’t be executed anymore. When I “Start without Debugging”, I get for most of the files “Value does not fall within the expected range

image

However if I make a python 3.6 sub-environment inside anaconda by calling conda create -n py36 python=3.6, and use that instead of 3.7, I can import numpy, but it doesn’t fix the “Value does not fall within the expected range” error when I Start without Debugging.

I’m sharing this in the hopes any of you can help me. Maybe this is a bug, maybe its not. Hope to get to the bottom of this soon.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
huguesvcommented, Oct 24, 2018

Yep, that’s exactly it, I see it too. Thanks a lot for the help 😃

I’ll rename this issue to track this, and #4820 will track the numpy/conda activation issue.

0reactions
joseortiz3commented, Oct 24, 2018

@huguesv Figured it out! Value does not fall within the expected range happens when you try to execute a python file from Solution Explorer -> pyfile.py -> Start without Debugging, AND when the file is not open in a Visual Studio Text Editor window (pyfile.py -> Open). Something about Start without Debugging is somehow relying on that file being open in a VS text editor window. Is that reproducible? This occurs in a brand-new solution/project.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Value does not fall within the expected range" when trying ...
So, simple steps: In the Solution Explorer, Double click on the file and open it. Right click on the file and select "Start...
Read more >
PowerShell Value does not fall within the expected range
This error message often appears when a list item or a field contains too much data, or when the value is too long....
Read more >
Error "Value does not fall within the expected range. ...
It is recommended that you examine the source code for errors and then close and re-open the source file. The error message follows:...
Read more >
Value does not fall within the expected range.
myDeleg is: public delegate void myDeleg(params object[] data); myEnum is existent (otherwise I would get a compiler error).
Read more >
Exception: Value does not fall within the expected range
Hello, I've found the error. The error is caused by the RadTreeView that was within the first RadWindow when select an item, close...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found