I recently installed both Python and Visual Studio Code. After taking an intro class I wrote a basic script and ran it in Visual Studio Code. That’s when I noticed a problem with the way Python is setup in my Visual Studio code. Problem: When I start Visual Studio Code and open a python file, the Terminal defaults to “C:Usersmy_nameDocuments
Tag: visual-studio-code
Python in VSCode: Set working directory to python file’s path everytime
So I want to migrate from Spyder to VSCode, and I come across this problem where I cannot access a dataset as my working directory is not the same as the dataset’s path. launch.json is not auto-generated for me as I’m not debugging anything (I tried this). How do I set the working directory to always be the dir of
Setup custom launcher with paths as a param values in VS Code (Flask – certificate path)
There is an example in Visual Studio Code python setup tutorial it is shown how to setup Flask. My problem starts when I try to provide self-signed certificate paths. I’ve tried to add following configuration: I’ve tried to provide key/cert as: C:\FULL_PATH\TO\FILE C:/FULL_PATH/TO/FILE ‘C:\FULL_PATH\TO\FILE’ “C:\FULL_PATH\TO\FILE” and I always getting one of these error messages: Error: Invalid value for “–key”: “–cert”
‘Unable to import’ errors for anaconda environment in VS Code
I am trying to solve partial differential equations with Python using FEniCS. I installed it with anaconda and conda-forge and to use it, I activate the fenicsproject environment I run my scripts in jupyter (that works), but often it is more convenient to use VS Code for more elaborate code. When I run the scripts written in VS Code in
Formatting on save moves import statment in VS-Code
I am learning flask and building a app based on Corey Schafer’s Youtube tutorials. I’m using VS-Code as my editor of choice. In tutorial 5 he splits his app into a package structure and when I do it I run into a problem. In my settings I enabled the “editor.formatOnSave”: true and the formatter I use is autopep8. Now when
Is there a way to remove unused imports for Python in VS Code?
I would really like to know if there is some Extension in Visual Studio Code or other means that could help identify and remove any unused imports. I have quite a large number of imports like this and it’s getting close to 40 lines. I know some of them aren’t in use, the problem is removing them safely. Answer Go
VSCode kill running processes
I have been using Python debug and LLDB attach debug since I have code in Python and C++ I have run this multiple times. It looks like everytime there is an exception in the middle of debugging, the process doesn’t get killed. As a result, now after multiple runs, when I try to use LLDB Attach debug it shows multiple
Python not finding Tensorflow module under Anaconda
I’m a newbie trying to execute the code in first_steps_with_tensor_flow.ipynb locally on Windows 10. I have installed Anaconda Navigator 1.8.2, created an environment where I’ve installed, among others, tensorflow package. I then launch Visual Studio Code from Anaconda and run The last line is marked with red in VS Code, saying E0401:Unable to import ‘tensorflow.python.data’. Running, I get ModuleNotFoundError: No
How can I set up launch.json in Visual Code to debbug C
I’m newbie about Visual Code. I’d like to use Debbuging function with Visual Code. But There is a probelm to do it. It may happen by wrong launch.json setting(In my opnion) I’m using mac os newest version. I refered to some pages to do it myself. https://code.visualstudio.com/docs/languages/cpp https://github.com/Microsoft/vscode-cpptools/blob/master/launch.md https://code.visualstudio.com/docs/python/debugging However I saw same error. It said “launch: program ‘${/Users/bpk/Documents/Study/C/Study}/study’ does
Visual Studio Code pylint: Unable to import ‘protorpc’
I’m using pylint in Visual Studio Code to develop a Google App Engine (GAE) Cloud Endpoint API in Python. I’m unable to resolve a lint error. I don’t know what’s causing the error, but at a guess, pylint cannot find the protorpc library? The recommended fix in Troubleshooting Linting is to configure workspace settings to point to fully qualified python