Could not find a working python interpreter. Unity, Firebase - python

Could not find a working python interpreter. Please make sure one of the following is in your PATH: python python3 python3.8 python3.7 python2.7 python2
I installed python 3.10.4
Path is set in environment variables. Still not working.

How to set path:
Find the path to install Python on your computer. To do this, open the Windows search bar and type python.exe. Select the Open file location option.
Copy path of python folder.
To add Python To PATH In User Variables: Open My Computer\Properties\Advanced system settings\Advanced Environment Variables\Environment Variables.
In the User Variables menu, find a variable named Path. Then paste the path you copied earlier into the Variable Value option using Ctrl+v and click OK.
if you cannot find this variable, you may need to create it. To do this, click New. Then, in the variable name form, enter the path and paste your Python path into the variable value field.
6.You can also add Python to the PATH system variable. Although this is just an alternative and not needed if you have already added it to the Users variables.
To use the System Variables option, follow the steps highlighted above to copy the Python path and its script. Then go back to environment variables. Then, in the system variables segment, look for a variable named Path. Click this variable and click Edit.

It is working now. We have to set paths in both user variables and system variables. Then restart the PC.

If you have already set the path and can see only python and/or python 3 in the destination folder:
Type "python" in cmd. It will automatically take you to Windows Store, Install python 3.8 from there. Or you can externally install python 3.8 for latest Firebase plugin. This removes the error.

Related

'Python not found' despite having been installed

I've installed Python's latest version. However, when I write in command prompts
python --version
I get:
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.
I tried downloading it directly from the Microsoft Store, however, the problem with that was that I could not very easily create a path for it and ran out of skills.
Anyways I'm trying to get Robot Framework to run just for fun, I'm a complete beginner as you can probably see. What should I do to fix this?
You have to add the path of Python to the environment of your system.
For more details refer: How to add Python to Windows PATH
How to add Python to Windows PATH
There are few ways in which you can add Python to Windows PATH. In this guide, I’ll share with you two methods that you can use to add Python to Windows path:
Via the installation of a recent version of Python
Manual entry of the paths
But why would you want to add Python to Windows path in the first place?
Well, if you try to install a Python package using PIP for example, you may get the following error in the Windows Command Prompt:
‘pip’ is not recognized as an internal or external command, operable program or batch file
To overcome this error, you may apply any of the two methods described below.
Method 1: Install a Recent Version of Python
You can easily add Python to Windows path by downloading a recent version of Python, and then checking the box to Add Python to PATH during the installation.
Before you proceed, you may choose to uninstall your previous version of Python if needed.
In my case, the latest version of Python that was available to download was version 3.7.2.
In the Python installation box, just check the box to add Python to PATH as below:
How to add Python to Windows PATH
Finish the installation, and you should be good to go.
Alternatively, you may manually add the paths into the Environment variables.
Method 2: Manually add Python to Windows Path
If you wish to stick with your previous version of Python, you may apply the steps below to manually add Python to Windows path.
Note that I’ll be using Windows 10 to demonstrate the steps, but similar principles would apply for previous versions of Windows.
Step 1: Navigate to the Windows Environment Variables screen
To navigate to the Windows Environment Variables screen, where you can add/edit your paths, simply right click on the ‘This PC‘ icon. Then, select ‘Properties.’
This PC - Windows 10
Next, click on the ‘Advanced system settings‘
Advanced system settings
Finally, click on the ‘Environment Variables…‘
Environment variables
That should take you to the Environment Variables screen, where you can add/edit your paths.
Click on ‘New…‘ to add the ‘Path’ variable (note that if your ‘Path’ variable already exists, then click on ‘Edit…’ instead):
add Python to path
You should then see the following box, which will allow you to add/edit variables:
New User Variable
Before you type any values, you’ll need to locate the relevant Python paths. The paths that you’ll need to get are:
The Python application path, which is the folder where you originally installed Python; and
The Python Scripts path. The Scripts folder should be located within the Python application path.
Here is how my Python application path looks like:
Python application path
And this is how my Python Scripts path looks like:
Python Scripts path
Now let’s fill the New User Variable box that you saw earlier:
New User Variable
For the Variable name, type ‘Path‘.
For the Variable value, copy the full Python application path, then use semicolon (as highlighted in yellow below), and finally copy the Python Scripts path.
This is how my Variable value looks like:
C:\Users\Ron\AppData\Local\Programs\Python\Python37-32;C:\Users\Ron\AppData\Local\Programs\Python\Python37-32\Scripts
Put all the values together in the New User Variable box:
New User Variable - Windows 10
Press ‘OK’ and you would then see your new Python Path under the ‘User variables’ section. Don’t forget to press ‘OK’ again so that the changes will get implemented.
How to add Python to Windows PATH
That’s it! You just added Python to the Windows Path.
You’ll now be able to install Python packages easily, by opening the Windows Command Prompt and then typing:
pip install package name
For example, to install the pandas package, simply type ‘pip install pandas’ and then press Enter:
How to add Python to Windows PATH
Similarly, you may upgrade PIP by typing the following command:
python -m pip install --upgrade pip

Python - Faster way to set python path on windows?

When you install python on windows, you have to set the path by going to the Environment Variables, then click New, enter the name, then in the value place enter the path, finally edit the path and add %pythonexe%; to it. When you do this, you can type python and you will get the python shell. Is there an easier way to do this without having to go to the system variables, and doing all that stuff?
According to this post all you have to do is type this in Command Prompt:
setx path "%path%;C:\Python27;"

Python stopped working after Windows username change

I changed the windows10 username and now python is not working anymore.
The person who previously worked on this machine created the user-profile with a space within the name (C:\Users\His Name...). This ocassionally caused Problems because some programs can't seem to handle spaces in a path. So I changed this to "C:\Users\HisName..." like this:
Created a new temporary account.
Loged into that new account.
Used netplwiz to change the original accounts name.
Changed the path in Windows explorer to match the new name.
Changed the registry entry "ProfileImagePath" at "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\ProfileList" to the new username.
Source: https://ekiwi-blog.de/Windows/Windows_10_Tipps/Benutzernamen_und_Verzeichnis_aendern/index.html
(Sorry, its german)
When I execute "python" in CMD-line it says the command was not found.
Also IDLE doesn't start anymore and Visual Studio Code can't run python scripts. It seems like it can't access the extensions.
I checked PATH in the enviromental Parameters and there were still the old Paths. But changing them to the new ones didn't make a difference.
What can I do to make python work again?
This might be because Python wasn't install for all the users.
You could check if the Python executable is located in the user's home directory. The location of the home directory is retrieved by using the os.path.expanduser() method. The location of the Python interpreter is retrieved by using the sys.executable() method.
The following function returns True if the Python interpreter was installed within the user's home directory, and False otherwise. It works under Linux, and should work under macOS and Windows (but I didn't test those).
import sys
import os
def user_python():
try:
return sys.executable.startswith(os.path.expanduser("~"))
except AttributeError:
return False
If you want the directory accessible by everyone, you should put it in a directory everyone has access to, such as C:\Python3.6, rather that under a Users directory. During the Python installation, you are given the options of who you want to install it for (ie single user or everyone), where you want to install it (again, something like C:\Pyton3.6 is a good choice), whether you want to have Python update the Environmental Variables (why, yes you do) and whether you want to have 'pip' installed (again yes you do).
You have changed the profile name and path in registry that's fine
But you have to also add new python path in environment variables
Please update new python path in Environment Variables
Steps:
Search Environment Variables in Cortana
Click on "Environment Variables"
In User Variables click on New
Now add the path of python
Close current cmd and open a new cmd to run python
I did open the installation file again (as administrator), then I click repair, somehow it could repair itself, creating another user in the users folder. Then I could uninstall it.
In the end, I install it again under my own username

command line not recognizing python despite it being on my computer

I tried the answer to when this was asked previously and it didn't work, so I'm asking here.
I'm very new to both windows and python, and am trying to run python from my (Windows 10) command line so that I can use pip to install a package (SpaCy). I'm not entirely sure what I'm doing wrong, but after the
C:Users\myname>
typing
C:Users\myname>python
leads to an invalid syntax error, saying:
'python' is not recognized as an internal or external command,
operable program or batch file.
I have python 2.7 installed on my computer, and it works when I use an interpreter such as Rodeo.
I also get the same error when trying to use pip to install SpaCy, although when I try to install pip I get a message that pip is already installed.
Is there some basic knowledge I'm just missing?
When you installed Python, there would have been a tick box that wanted to know if you would like the Python Path adding to the Environment variables. As you didn't select this, your Windows Path doesn't include the folder where the Python executable lives.
To fix this, rerun the installer and modify your install, it should pop up the screen with the tick boxes on, select the one mentioned above and the job should be done.
This is how it works with the Python3 installer, anyhow and I assume that 2.7 will use the same basic model.
You may need to add the newly installed location of python to your path variable.
Control Panel > System > Advanced system settings > Environment variables
Find "Path" and edit.
Append a semicolon ';' and add the full path to your python install location.
To try your new path, you may need to start up another command line cmd.exe to pick up the new PATH.
You need to add python.exe to your Path:
Locate where Python is installed. It's usually located at:
C:\Users\<username>\AppData\Local\Programs\Python\<version>
Now you need to add this directory to your path. To do that press Windows Key, search for 'Environment Variables' and click on 'Edit the System Environment Variables'.
Then 'Environment Variables...'
Click on 'Path' variable and hit 'Edit...'
Then, 'New'...
Put the directory where your Python.exe is installed and hit okay,
Restart your command prompt and try again.
You need to add python installation path to your environment variable.
Click search icon on windows task bar--> type "environment variable" Edit environment variable will pop (System or User)--> add path to python installation till bin to "Path" variable.

Python path on windows

I have two installations of Python on a corporate Windows computer. One from the Anaconda distribution:
C:\Users\Me\AppData\Local\Continuum\anaconda3\python3.exe
Another one from a corporate installer:
C:\Users\Me\AppData\Local\Downloaded Apps\WinPython\python-3.4.3\python.exe
If I type "python" in the default "cmd" terminal or in the Git Bash, it says "command not found". Probably for the same reason, Jupyter does not allow me to create a Python 3 notebook. How do I set the paths so that Python is available system-wide? I prefer the Anaconda distribution's Python.
EDIT: Creating a new user variable PYTHONPATH and setting it to C:\Users\Me\AppData\Local\Continuum\anaconda3\ via Windows System Properties does not have an effect.
This answer describes step-by-step an approach that worked for me. However, as eryksun notes in the comment, the additional variable should not be named PYTHONPATH. I renamed it PYTHON, which works.
Strangely, adding the paths directly to the PATH variable did NOT work.
You have to add the path of your installation to the Environment variables.
Simply go to the System Properties / Environment Variables /
From there, create a new system variables and add your python path.
In the system variable section select the Path variable.
Add new variable C:\Users\Me\AppData\Local\Continuum\anaconda3\ as environment variable in your advanced System Settings.
This is from where your system will invoke the python interpreter.
For more details see this answer

Categories

Resources