2

I have an issue with vscode and python. I created simple python script which works with python3 interpreter and then run it using python3 test.py, which is fine.

import numpy as np 
import matplotlib.pyplot as plt 

Ts = 0.01
t = np.arange(-5, 5, Ts)

y = t**2
plt.plot(y)
plt.show()

But when I try to run it using vscode debug I get a segmentation fault(core dumped).

agentdenton@agentdenton-latitude:~/dev/Test/numpy_test$ python3 test.py 
Segmentation fault (core dumped)

Which is weird because same code works fine on my VM with same Ubuntu. I wonder if I doing something wrong here or is it bug? I'm using ubuntu 19.04 and latest version of vscode also python 3.7.5. Error happens only if I import some module and execute function from it, with regular python code it works fine. Thank you for your attention and sorry for bad english skills!

5
  • Are the two environments exactly the same? And how are you using the debugger because there should be a bunch more in the command-line if you're executing under the debugger. Commented Dec 19, 2019 at 22:01
  • Yeah. they almost same, it`s standart configutarion generated by vscode. Commented Dec 27, 2019 at 13:25
  • I have the same issue, waiting for an answer! Commented Jan 2, 2020 at 16:19
  • And to double check, you're using marketplace.visualstudio.com/items?itemName=ms-python.python, correct? Commented Jan 2, 2020 at 22:27
  • Yes, I using python from marketplace Commented Jan 4, 2020 at 7:22

1 Answer 1

2

It's probability the VS code polluted the python enviroment. You can uninstall the python enviroment and reinstall a new clean enviroment. If you use conda, you can update the enviroment by conda update --all.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.