visual-studio

How to permanently unset PYTHONHOME environment variable in Visual Studio 2022?

How to permanently unset PYTHONHOME environment variable in Visual Studio 2022? Question: I cannot launch Python in Visual Studio because I am unable to unset the PYTHONHOME environment variable, which is permanently set to C:Python311 even after getting rid of it through windows control panel system environment editor, uninstalling Python311, and a full repair and …

Total answers: 2

How to debug crashing C++ library loaded in python project

How to debug crashing C++ library loaded in python project Question: I am attempting to figure out why calling a function in a dynamically loaded lib crashes python. I’m doing the following, I have a C++ function in a dynamic library file, which is loaded in python using ctypes. I then call the function from …

Total answers: 1

CS50 taqueria task – input of eof halts program

CS50 taqueria task – input of eof halts program Question: I am trying to solve the taqueria task for the Harvard CS50 python course. It generally works, but check50 spits out the following: 🙁 input of EOF halts program Cause expected exit code 0, not 1 This is my code: menu = { "Baja Taco": …

Total answers: 2

FATAL: Error, Visual Studio required for using ClangCL on Windows

FATAL: Error, Visual Studio required for using ClangCL on Windows Question: while trying to use Nuitka on anaconda prompt to obfuscate python script pass.py (would like to use clang compiler not gcc) after typing below cmd: python -m nuitka –clang –follow-imports pass.py it shows this error message: FATAL: Error, Visual Studio required for using ClangCL …

Total answers: 1

Using VisualStudio+ Python — how to handle "overriding stdlib module" Pylance(reportShadowedImports) warning?

Using VisualStudio+ Python — how to handle "overriding stdlib module" Pylance(reportShadowedImports) warning? Question: When running ipynbs in VS Code, I’ve started noticing Pylance warnings on standard library imports. I am using a conda virtual environment, and I believe the warning is related to that. An example using the glob library reads: "envLibglob.py" is overriding the …

Total answers: 2

I tried a make a calculator but it gives an error

I tried a make a calculator but it gives an error Question: Hi I’m new at the python and trying to make basic calculator, but when i try to start it gives a string is not int error, can u help me please? def Add(number1, number2): return number1+number2 def Minus (number1, number2): return number1-number2 def …

Total answers: 4

VS Code is not recognizing 'nmap'

VS Code is not recognizing 'nmap' Question: I am trying to make a nmap scanner for the InfoSec Certification on freeCodeCamp.org and cannot get Visual Studio Code to recognize that I have installed nmap. I am very beginner and in the process of learning. from cProfile import run import nmap scanner = nmap.PortScanner() …

Total answers: 2

'NoneType' object has no attribute 'add' in Django Models

'NoneType' object has no attribute 'add' in Django Models Question: I have the next:’NoneType’ object has no attribute ‘add’. When I try to add a value to a null field (null=True) with auction.winner.add(u) it gives me that exception. I am working with Django Models and it looks like is not allowed to add a value …

Total answers: 2