Unable to debug python code in vs code - code gives exception at the import library
up vote
0
down vote
favorite
I have the following python code:
import tensorflow as tf
import numpy as np
import math
import matplotlib.pyplot as plt
import matplotlib.animation as animation
num_house = 160
np.random.seed(42)
house_size = np.random.randint(low=1000, high=3500, size=num_house)
I am trying to debug this python code in visual studio code. I have selected the right configuration (Python: Current File (Integrated Terminal)). I have set my breakpoint on the last line. When i run from the debug console, my code fails giving me a ModuleNotFoundError. But I am able to execute this program in the terminal. How do I debug this code in vs code?
python
add a comment |
up vote
0
down vote
favorite
I have the following python code:
import tensorflow as tf
import numpy as np
import math
import matplotlib.pyplot as plt
import matplotlib.animation as animation
num_house = 160
np.random.seed(42)
house_size = np.random.randint(low=1000, high=3500, size=num_house)
I am trying to debug this python code in visual studio code. I have selected the right configuration (Python: Current File (Integrated Terminal)). I have set my breakpoint on the last line. When i run from the debug console, my code fails giving me a ModuleNotFoundError. But I am able to execute this program in the terminal. How do I debug this code in vs code?
python
1
What version of Python are you using in the terminal, and what version does vs code use?
– John Gordon
Nov 10 at 20:53
python version 3.6.7
– Mahadevan Swamy
Nov 10 at 20:54
They are both that version? You're sure?
– John Gordon
Nov 10 at 23:33
I saw that there were 2 python versions installed on my machine. so I uninstalled v3.7 and now I am able to debug. Thanks for your help
– Mahadevan Swamy
Nov 11 at 15:13
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have the following python code:
import tensorflow as tf
import numpy as np
import math
import matplotlib.pyplot as plt
import matplotlib.animation as animation
num_house = 160
np.random.seed(42)
house_size = np.random.randint(low=1000, high=3500, size=num_house)
I am trying to debug this python code in visual studio code. I have selected the right configuration (Python: Current File (Integrated Terminal)). I have set my breakpoint on the last line. When i run from the debug console, my code fails giving me a ModuleNotFoundError. But I am able to execute this program in the terminal. How do I debug this code in vs code?
python
I have the following python code:
import tensorflow as tf
import numpy as np
import math
import matplotlib.pyplot as plt
import matplotlib.animation as animation
num_house = 160
np.random.seed(42)
house_size = np.random.randint(low=1000, high=3500, size=num_house)
I am trying to debug this python code in visual studio code. I have selected the right configuration (Python: Current File (Integrated Terminal)). I have set my breakpoint on the last line. When i run from the debug console, my code fails giving me a ModuleNotFoundError. But I am able to execute this program in the terminal. How do I debug this code in vs code?
python
python
asked Nov 10 at 20:51
Mahadevan Swamy
727
727
1
What version of Python are you using in the terminal, and what version does vs code use?
– John Gordon
Nov 10 at 20:53
python version 3.6.7
– Mahadevan Swamy
Nov 10 at 20:54
They are both that version? You're sure?
– John Gordon
Nov 10 at 23:33
I saw that there were 2 python versions installed on my machine. so I uninstalled v3.7 and now I am able to debug. Thanks for your help
– Mahadevan Swamy
Nov 11 at 15:13
add a comment |
1
What version of Python are you using in the terminal, and what version does vs code use?
– John Gordon
Nov 10 at 20:53
python version 3.6.7
– Mahadevan Swamy
Nov 10 at 20:54
They are both that version? You're sure?
– John Gordon
Nov 10 at 23:33
I saw that there were 2 python versions installed on my machine. so I uninstalled v3.7 and now I am able to debug. Thanks for your help
– Mahadevan Swamy
Nov 11 at 15:13
1
1
What version of Python are you using in the terminal, and what version does vs code use?
– John Gordon
Nov 10 at 20:53
What version of Python are you using in the terminal, and what version does vs code use?
– John Gordon
Nov 10 at 20:53
python version 3.6.7
– Mahadevan Swamy
Nov 10 at 20:54
python version 3.6.7
– Mahadevan Swamy
Nov 10 at 20:54
They are both that version? You're sure?
– John Gordon
Nov 10 at 23:33
They are both that version? You're sure?
– John Gordon
Nov 10 at 23:33
I saw that there were 2 python versions installed on my machine. so I uninstalled v3.7 and now I am able to debug. Thanks for your help
– Mahadevan Swamy
Nov 11 at 15:13
I saw that there were 2 python versions installed on my machine. so I uninstalled v3.7 and now I am able to debug. Thanks for your help
– Mahadevan Swamy
Nov 11 at 15:13
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53243290%2funable-to-debug-python-code-in-vs-code-code-gives-exception-at-the-import-libr%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
What version of Python are you using in the terminal, and what version does vs code use?
– John Gordon
Nov 10 at 20:53
python version 3.6.7
– Mahadevan Swamy
Nov 10 at 20:54
They are both that version? You're sure?
– John Gordon
Nov 10 at 23:33
I saw that there were 2 python versions installed on my machine. so I uninstalled v3.7 and now I am able to debug. Thanks for your help
– Mahadevan Swamy
Nov 11 at 15:13