Python Forum
python not detected on computer
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
python not detected on computer
#1
Hi, sorry for the thread, I just haven't found any solution anywhere and I'm getting kind of desperate.

For context, I'm a sociology student with no experience coding in anything other than R, so please bear with me as I don't know much about python or coding. I need to use python in order to use "Whisper", a retranscription program for my interviews. In order to do so, I tried a lot of things, but right now I'm using VSCode as an interface. My OS is Windows 11.

long story short, VSCode isn't detecting python. Here are some of the errors i get that I think can help understand ?

Trying to check my python version. I get similar errors when i try to use pip :
Output:
Traceback (most recent call last): File "c:\Users\adrie\OneDrive\Bureau\Untitled-1.py", line 2, in <module> py -v ^^ NameError: name 'py' is not defined PS C:\Users\adrie> & C:/Users/adrie/AppData/Local/Programs/Python/Python312/python.exe c:/Users/adrie/OneDrive/Bureau/Untitled-1.py Traceback (most recent call last): File "c:\Users\adrie\OneDrive\Bureau\Untitled-1.py", line 1, in <module> python NameError: name 'python' is not defined PS C:\Users\adrie> & C:/Users/adrie/AppData/Local/Programs/Python/Python312/python.exe c:/Users/adrie/OneDrive/Bureau/Untitled-1.py Traceback (most recent call last): File "c:\Users\adrie\OneDrive\Bureau\Untitled-1.py", line 1, in <module> python -v ^^^^^^ NameError: name 'python' is not defined
Trying to change the vscode python interpreter to the path I've read it should be :
Output:
2023-11-17 15:04:53.918 [warning] Failed to check if C:\Users\adrie\AppData\Local\Programs\Python\Python312\python.exe" is an executable [Error: ENOENT: no such file or directory, lstat 'C:\Users\adrie\AppData\Local\Programs\Python\Python312\python.exe"'] { errno: -4058, code: 'ENOENT', syscall: 'lstat', path: 'C:\\Users\\adrie\\AppData\\Local\\Programs\\Python\\Python312\\python.exe"'


the print() command works, which idk is because it's in VSCode by default, or because it's detecting a bit of python ?

Things I tried to solve it :
- uninstall and reinstall from both the recommended internet page AND Windows Store
- install the python extension on VSCode
- change all the \ to \\ in the interpreter path
- try the same on Windows Powershell ISE
- give Python admin rights and "add to path automatically" when re-installing it
- when I go to the 2 paths offered for python in my computer (C:\\Users\\adrie\\AppData\\Local\\Programs\\Python\\Python312\\python.exe AND C:/Users/adrie/AppData/Local/Microsoft/WindowsApps/python3.11.exe), I find the files.
- the file at "C:\\Users\\adrie\\AppData\\Local\\Programs\\Python\\Python312\\python.exe" is 101Ko large, and opens the windows terminal when launched
- the file at "C:/Users/adrie/AppData/Local/Microsoft/WindowsApps/python3.11.exe" is 0 Ko large, and also opens the windows terminal

I know all of this points to Python not being downloaded on my computer, but it is, so I'm very lost

Thank you very much for your help
Reply
#2
You try to run py -v in python script,it's a command line tool.
Do this open cmd and type this,and it's large py -V or py --version
py -V
python -V
python3 -V
where py
where python
where python3
pip -V
pip3 -V
Report back the output of this,do not mess with VS Code yet.
Reply
#3
Hey,

I typed py -v again in the terminal of my computer and it gave me this

Output:
PS C:\Users\adrie> py -v import _frozen_importlib # frozen import _imp # builtin import '_thread' # <class '_frozen_importlib.BuiltinImporter'> import '_warnings' # <class '_frozen_importlib.BuiltinImporter'> import '_weakref' # <class '_frozen_importlib.BuiltinImporter'> import 'winreg' # <class '_frozen_importlib.BuiltinImporter'> import '_io' # <class '_frozen_importlib.BuiltinImporter'> import 'marshal' # <class '_frozen_importlib.BuiltinImporter'> import 'nt' # <class '_frozen_importlib.BuiltinImporter'> import '_frozen_importlib_external' # <class '_frozen_importlib.FrozenImporter'> # installing zipimport hook import 'time' # <class '_frozen_importlib.BuiltinImporter'> import 'zipimport' # <class '_frozen_importlib.FrozenImporter'> # installed zipimport hook # C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\encodings\__pycache__\__init__.cpython-312.pyc matches C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\encodings\__init__.py # code object from 'C:\\Users\\adrie\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\encodings\\__pycache__\\__init__.cpython-312.pyc' import '_codecs' # <class '_frozen_importlib.BuiltinImporter'> import 'codecs' # <class '_frozen_importlib.FrozenImporter'> # C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\encodings\__pycache__\aliases.cpython-312.pyc matches C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\encodings\aliases.py # code object from 'C:\\Users\\adrie\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\encodings\\__pycache__\\aliases.cpython-312.pyc' import 'encodings.aliases' # <_frozen_importlib_external.SourceFileLoader object at 0x000001F290EF8980> import 'encodings' # <_frozen_importlib_external.SourceFileLoader object at 0x000001F290ECADB0> # C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\encodings\__pycache__\utf_8.cpython-312.pyc matches C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\encodings\utf_8.py # code object from 'C:\\Users\\adrie\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\encodings\\__pycache__\\utf_8.cpython-312.pyc' import 'encodings.utf_8' # <_frozen_importlib_external.SourceFileLoader object at 0x000001F290EFB1D0> # C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\encodings\__pycache__\cp1252.cpython-312.pyc matches C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\encodings\cp1252.py # code object from 'C:\\Users\\adrie\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\encodings\\__pycache__\\cp1252.cpython-312.pyc' import 'encodings.cp1252' # <_frozen_importlib_external.SourceFileLoader object at 0x000001F290EFB380> import '_signal' # <class '_frozen_importlib.BuiltinImporter'> import '_abc' # <class '_frozen_importlib.BuiltinImporter'> import 'abc' # <class '_frozen_importlib.FrozenImporter'> import 'io' # <class '_frozen_importlib.FrozenImporter'> import '_stat' # <class '_frozen_importlib.BuiltinImporter'> import 'stat' # <class '_frozen_importlib.FrozenImporter'> import '_collections_abc' # <class '_frozen_importlib.FrozenImporter'> import 'genericpath' # <class '_frozen_importlib.FrozenImporter'> import '_winapi' # <class '_frozen_importlib.BuiltinImporter'> import 'ntpath' # <class '_frozen_importlib.FrozenImporter'> import 'os' # <class '_frozen_importlib.FrozenImporter'> import '_sitebuiltins' # <class '_frozen_importlib.FrozenImporter'> Processing user site-packages Processing global site-packages Adding directory: 'C:\\Users\\adrie\\AppData\\Local\\Programs\\Python\\Python312' Adding directory: 'C:\\Users\\adrie\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\site-packages' import 'site' # <class '_frozen_importlib.FrozenImporter'> # C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\__pycache__\rlcompleter.cpython-312.pyc matches C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\rlcompleter.py # code object from 'C:\\Users\\adrie\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\__pycache__\\rlcompleter.cpython-312.pyc' import 'atexit' # <class '_frozen_importlib.BuiltinImporter'> # C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\__pycache__\inspect.cpython-312.pyc matches C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\inspect.py # code object from 'C:\\Users\\adrie\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\__pycache__\\inspect.cpython-312.pyc' # C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\__pycache__\ast.cpython-312.pyc matches C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\ast.py # code object from 'C:\\Users\\adrie\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\__pycache__\\ast.cpython-312.pyc' # C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\re\__pycache__\__init__.cpython-312.pyc matches C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\re\__init__.py # code object from 'C:\\Users\\adrie\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\re\\__pycache__\\__init__.cpython-312.pyc' # C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\__pycache__\enum.cpython-312.pyc matches C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\enum.py # code object from 'C:\\Users\\adrie\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\__pycache__\\enum.cpython-312.pyc' # C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\__pycache__\types.cpython-312.pyc matches C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\types.py # code object from 'C:\\Users\\adrie\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\__pycache__\\types.cpython-312.pyc' import 'types' # <_frozen_importlib_external.SourceFileLoader object at 0x000001F2910FBF50> # C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\__pycache__\operator.cpython-312.pyc matches C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\operator.py # code object from 'C:\\Users\\adrie\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\__pycache__\\operator.cpython-312.pyc' import '_operator' # <class '_frozen_importlib.BuiltinImporter'> import 'operator' # <_frozen_importlib_external.SourceFileLoader object at 0x000001F291110140> # C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\__pycache__\functools.cpython-312.pyc matches C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\functools.py # code object from 'C:\\Users\\adrie\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\__pycache__\\functools.cpython-312.pyc' # C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\collections\__pycache__\__init__.cpython-312.pyc matches C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\collections\__init__.py # code object from 'C:\\Users\\adrie\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\collections\\__pycache__\\__init__.cpython-312.pyc' import 'itertools' # <class '_frozen_importlib.BuiltinImporter'> # C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\__pycache__\keyword.cpython-312.pyc matches C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\keyword.py # code object from 'C:\\Users\\adrie\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\__pycache__\\keyword.cpython-312.pyc' import 'keyword' # <_frozen_importlib_external.SourceFileLoader object at 0x000001F29112F770> # C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\__pycache__\reprlib.cpython-312.pyc matches C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\reprlib.py # code object from 'C:\\Users\\adrie\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\__pycache__\\reprlib.cpython-312.pyc' import 'reprlib' # <_frozen_importlib_external.SourceFileLoader object at 0x000001F29112FA70> import '_collections' # <class '_frozen_importlib.BuiltinImporter'> import 'collections' # <_frozen_importlib_external.SourceFileLoader object at 0x000001F291113AD0> import '_functools' # <class '_frozen_importlib.BuiltinImporter'> import 'functools' # <_frozen_importlib_external.SourceFileLoader object at 0x000001F2911112B0> import 'enum' # <_frozen_importlib_external.SourceFileLoader object at 0x000001F2910F93D0> # C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\re\__pycache__\_compiler.cpython-312.pyc matches C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\re\_compiler.py # code object from 'C:\\Users\\adrie\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\re\\__pycache__\\_compiler.cpython-312.pyc' import '_sre' # <class '_frozen_importlib.BuiltinImporter'> # C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\re\__pycache__\_parser.cpython-312.pyc matches C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\re\_parser.py # code object from 'C:\\Users\\adrie\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\re\\__pycache__\\_parser.cpython-312.pyc' # C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\re\__pycache__\_constants.cpython-312.pyc matches C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\re\_constants.py # code object from 'C:\\Users\\adrie\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\re\\__pycache__\\_constants.cpython-312.pyc' import 're._constants' # <_frozen_importlib_external.SourceFileLoader object at 0x000001F29115B200> import 're._parser' # <_frozen_importlib_external.SourceFileLoader object at 0x000001F291159E80> # C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\re\__pycache__\_casefix.cpython-312.pyc matches C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\re\_casefix.py # code object from 'C:\\Users\\adrie\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\re\\__pycache__\\_casefix.cpython-312.pyc' import 're._casefix' # <_frozen_importlib_external.SourceFileLoader object at 0x000001F291112090> import 're._compiler' # <_frozen_importlib_external.SourceFileLoader object at 0x000001F2911585F0> # C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\__pycache__\copyreg.cpython-312.pyc matches C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\copyreg.py # code object from 'C:\\Users\\adrie\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\__pycache__\\copyreg.cpython-312.pyc' import 'copyreg' # <_frozen_importlib_external.SourceFileLoader object at 0x000001F29118C200> import 're' # <_frozen_importlib_external.SourceFileLoader object at 0x000001F2910F8710> import '_ast' # <class '_frozen_importlib.BuiltinImporter'> # C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\__pycache__\contextlib.cpython-312.pyc matches C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\contextlib.py # code object from 'C:\\Users\\adrie\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\__pycache__\\contextlib.cpython-312.pyc' import 'contextlib' # <_frozen_importlib_external.SourceFileLoader object at 0x000001F29118FF80> import 'ast' # <_frozen_importlib_external.SourceFileLoader object at 0x000001F2910CAF90> # C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\__pycache__\dis.cpython-312.pyc matches C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\dis.py # code object from 'C:\\Users\\adrie\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\__pycache__\\dis.cpython-312.pyc' # C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\__pycache__\opcode.cpython-312.pyc matches C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\opcode.py # code object from 'C:\\Users\\adrie\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\__pycache__\\opcode.cpython-312.pyc' import '_opcode' # <class '_frozen_importlib.BuiltinImporter'> import 'opcode' # <_frozen_importlib_external.SourceFileLoader object at 0x000001F2912ABB30> import 'dis' # <_frozen_importlib_external.SourceFileLoader object at 0x000001F2910CBFB0> # C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\collections\__pycache__\abc.cpython-312.pyc matches C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\collections\abc.py # code object from 'C:\\Users\\adrie\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\collections\\__pycache__\\abc.cpython-312.pyc' import 'collections.abc' # <_frozen_importlib_external.SourceFileLoader object at 0x000001F2912DDC70> # C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\importlib\__pycache__\__init__.cpython-312.pyc matches C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\importlib\__init__.py # code object from 'C:\\Users\\adrie\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\importlib\\__pycache__\\__init__.cpython-312.pyc' # C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\__pycache__\warnings.cpython-312.pyc matches C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\warnings.py # code object from 'C:\\Users\\adrie\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\__pycache__\\warnings.cpython-312.pyc' import 'warnings' # <_frozen_importlib_external.SourceFileLoader object at 0x000001F2912DD790> import 'importlib' # <_frozen_importlib_external.SourceFileLoader object at 0x000001F2912DDB80> import 'importlib.machinery' # <class '_frozen_importlib.FrozenImporter'> # C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\__pycache__\linecache.cpython-312.pyc matches C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\linecache.py # code object from 'C:\\Users\\adrie\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\__pycache__\\linecache.cpython-312.pyc' # C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\__pycache__\tokenize.cpython-312.pyc matches C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\tokenize.py # code object from 'C:\\Users\\adrie\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\__pycache__\\tokenize.cpython-312.pyc' # C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\__pycache__\token.cpython-312.pyc matches C:\Users\adrie\AppData\Local\Programs\Python\Python312\Lib\token.py # code object from 'C:\\Users\\adrie\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\__pycache__\\token.cpython-312.pyc' import 'token' # <_frozen_importlib_external.SourceFileLoader object at 0x000001F2912F53D0> import '_tokenize' # <class '_frozen_importlib.BuiltinImporter'> import 'tokenize' # <_frozen_importlib_external.SourceFileLoader object at 0x000001F2912DFF50> import 'linecache' # <_frozen_importlib_external.SourceFileLoader object at 0x000001F2912DFD10> import 'inspect' # <_frozen_importlib_external.SourceFileLoader object at 0x000001F291095EE0> import 'rlcompleter' # <_frozen_importlib_external.SourceFileLoader object at 0x000001F2910956D0> Python 3.12.0 (tags/v3.12.0:0fb18b0, Oct 2 2023, 13:03:39) [MSC v.1935 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.
the other commands gave me this :

Output:
>>> python -V Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'python' is not defined >>> python3 -V Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'python3' is not defined >>> py -V Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'py' is not defined >>> where py File "<stdin>", line 1 where py ^^ SyntaxError: invalid syntax >>> where python File "<stdin>", line 1 where python ^^^^^^ SyntaxError: invalid syntax >>> where python3 File "<stdin>", line 1 where python3 ^^^^^^^ SyntaxError: invalid syntax >>> pip -V Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'pip' is not defined. Did you mean: 'zip'? >>> pip3 -V Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'pip3' is not defined >>> py --version Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'py' is not defined >>>
thank you :))
Reply
#4
Capital V py -V or py --version
(Nov-18-2023, 02:37 PM)adriennn Wrote: the other commands gave me this :
From command line,now you have open Python interactive Interpreter(which have >>>).
You first command was ok just that is was small -v.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  PsInfo from remote computer in python susja 3 2,283 Oct-10-2022, 08:39 AM
Last Post: DeaD_EyE
  Python Help, New User, Computer Automation hexagonalyeti 2 1,673 Jun-25-2021, 11:43 AM
Last Post: hexagonalyeti
  My .exe made using Python being detected as a virus 100grassfed 2 3,041 Jun-16-2021, 04:41 AM
Last Post: buran
  python --version yields no output, not detected by other programs ten 3 3,461 Jun-25-2020, 04:48 AM
Last Post: perfringo
  Go to line starting with and variable not detected morgandebray 5 3,356 Aug-09-2018, 09:00 AM
Last Post: morgandebray
  Install Python 2 and 3 on same Computer Able98 6 71,567 Dec-13-2017, 06:32 PM
Last Post: snippsat
  "Widget Javascript not detected" error BobLoblaw 0 4,315 Oct-07-2017, 04:48 PM
Last Post: BobLoblaw
  Object Detection that records the number of secs the face is not detected trabis03 1 2,554 Jul-21-2017, 04:14 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020