0

I recently built a new windows 10 system, and pretty much started new except for all my python files. I needed to first actually install Python, so I did (v. 3.9.1). I later installed, numpy in cmd (pip install numpy).I am currently using vscode, but I downloaded the pylint and python extension so I don't think this is the issue. I continued with my latest project, and when I went to run the code, I got an error message which looked like this:

 ** On entry to DGEBAL parameter number  3 had an illegal value
 ** On entry to DGEHRD  parameter number  2 had an illegal value
 ** On entry to DORGHR DORGQR parameter number  2 had an illegal value
 ** On entry to DHSEQR parameter number  4 had an illegal value
Traceback (most recent call last):
  File "c:\Users\sava\Desktop\Python\NumGuess\lvl1.py", line 2, in <module>
    import numpy
  File "C:\Users\sava\AppData\Local\Programs\Python\Python39\lib\site-packages\numpy\__init__.py", line 305, in <module>
    _win_os_check()
  File "C:\Users\sava\AppData\Local\Programs\Python\Python39\lib\site-packages\numpy\__init__.py", line 302, in _win_os_check
    raise RuntimeError(msg.format(__file__)) from None
RuntimeError: The current Numpy installation ('C:\\Users\\sava\\AppData\\Local\\Programs\\Python\\Python39\\lib\\site-packages\\numpy\\__init__.py') fails to pass a sanity check due to a bug in the windows runtime. See this issue for more information: 

I've never came across anything like it. I did some research but I still don't understand how to solve this issue. It probably has something to do with the installation, but I can display the code to maybe add some context:

import random
import numpy
from numlst import numlist_1


class guessnum1():

    def get_number(self):
        number = random.choice(numlist_1)
        return number.upper()

    number = random.choice(numlist_1)
    print(input("guess your number, since this is the first level you need to choose a number between 1 and 10  "))
    if input == number:
        print("Congratulations! You got the number correct!")
    
    else:
        print("Oops, you got the number wrong you have: " + " tries " + " left")


print(str(guessnum1))

I know that my code isn't perfect, but this is my first project I am doing without any tutorials. If any of you have had this error, or know how to solve this please help me out. Thank you for reading this and happy holidays.

(edit 1: I am fairly sure it isn't the actual code that is the problem, and the numlist is from another file in my project, I didn't want to put in the other files because they are probably irrelevant to this issue, thanks)

  • I'm not quite clear why you've accepted an answer that didn't solve your problem. It's a bit misleading to other readers. Hopefully you have worked out, by now, that the Numpy version was causing your problem. – David Buck Apr 13 '21 at 07:53

1 Answers1

0

i edit the code to this:

import random
import numpy
# from numlst import numlist_1

numlist_1 = [random.randrange(1, 50, 1) for i in range(7)]

class guessnum1():

    def get_number(self):
        number = random.choice(numlist_1)
        return number.upper()

    number = random.choice(numlist_1)
    print(input("guess your number, since this is the first level you need to choose a number between 1 and 10  "))
    if input == number:
        print("Congratulations! You got the number correct!")
    
    else:
        print("Oops, you got the number wrong you have: " + " tries " + " left")


guessnum1

Which produces this output:

guess your number, since this is the first level you need to choose a number between 1 and 10  5
5
Oops, you got the number wrong you have:  tries  left

Notice that i commented out from numlst import numlist_1.

And also called the class outside of the print(str(guessnum1)) statement.

I am using python 3.9 on windows 10. I use only the Python extenson and not pylint.

Hope this is helpful.

D.L
  • 4,339
  • 5
  • 22
  • 45
  • how did you add the numlist1 in there? I'm just a little confused on what the code means. I apologize for my lack of knowledge. –  Dec 24 '20 at 00:11
  • Also, I am still getting the same message. So it is a 99% chance that it has to do with the installation. Which I have no idea how to fix –  Dec 24 '20 at 00:12
  • what you have as numlst is simply a `python list`. So i used a more conventional way of generating a random python list `[random.randrange(1, 50, 1) for i in range(7)]`. – D.L Dec 24 '20 at 00:29
  • When installing `python` make sure that the add to path tick box is checked (for all versions). Outside of this, remove `pylint` as the linting is already done with the `python` extension: `Linting, Debugging (multi-threaded, remote), Intellisense, Jupyter Notebooks, code formatting, refactoring, unit tests, snippets, and more.` – D.L Dec 24 '20 at 00:32
  • do you get the same error messages when you run a basic print("hello world") file ? – D.L Dec 24 '20 at 01:25
  • Sorry, I was afk. I did the hello world file and it works perfectly find. Also, the numlist file is an actual code file in my project. I think there is an issue with the python install, I will completely erase it from my system, and create a fresh install, and I'll keep you updated. –  Dec 24 '20 at 23:51
  • The error message is telling you where the error fails: `line 2, in import numpy ` . The fact that you are able to run other code successfully is telling you that the install of `python` is satisfactory... so in escence you can rebuild the code line-by-line to pinpoint the error. This is what i did for the original failed code to make it work where th code broke at `numlst`. Hence the fix. – D.L Dec 26 '20 at 13:20