Python Environment Variable Not Working - python

When I type "Python" into the Windows 10 command prompt I get the error "'python' is not recognized as an internal or external command, operable program or batch file." I've tried adding "C:\Python27" to the "Path" environment variable, but it never works. It doesn't work for the as a user variable or a system variable.

Python might not be in your PATH. Check the environment variables and ensure c:\python27 is in the PATH.

Related

VSCode displays "Module numpy could not be resolved"

I have just installed VS Code and trying to run python code. In the past, I had already created some virtual environments (which I am able to see in VS Code), but for the moment I am using the base one.
I am trying to import some standard libraries which are present in the base environment (I tried also the conda environment), but VS code displays that the modules could not be resolved (Pylance).
I have noticed that when I open VS Code, the terminal tries to activate conda with "conda activate PATH_TO_MY_FOLDER/.conda", so it's trying to activate an environment in my folder, but it displays this error: conda : The term 'conda' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
I have also noticed that VS Code warns me of the environment variable PATH which has some """ characters:
EDIT: I add here also the Path environment variable relative to my user (not relative to the system)
Do you have any suggestion on how to proceed?
Thanks.
Try to add path to environment variable.
C:\Users\username\AppData\Local\Programs\Microsoft VS Code\bin
check the path of your VS Code bin folder

Launch pycharm from cmd in windows

I can't be able to launch pycham (community version) from the cmd. I also set up the environment variable but still, I am getting this- 'pycharm-community' is not recognized as an internal or external command,
operable program or batch file.
I have used all these commands - charm, charm., pycharm., pycharm. But, I am getting the same problem.
For MS windows:
Find where your pycharm is installed
If it is installed in C:\Program Files\JetBrains\PyCharm\
Type this in cmd:
setx PATH=%PATH%;C:\Program Files\JetBrains\PyCharm\bin
if not, then replace the path to where you pycharm is installed
setx PATH=%PATH%;C:\Path\to\your\pycharm\bin
If this doesn't work, try to restart you system once.
To start pycharm using command, first see what is the file name for executable for pycharm inside the bin folder and use that name. It can be pycharm.exe or something similar.
If it is pycharm.exe, use 'pycharm' in cmd to start it.

Command prompt does not recognize changes in PATH. How do I fix this?

I am attempting to download modules in Python through pip. No matter how many times I edit the PATH to show the pip.exe, it shows the same error:
'pip' is not recognized as an internal or external command,
operable program or batch file.
I have changed the PATH many different times and ways to make pip usable, but these changes go unnoticed by the command prompt terminal.
How should I fix this?
Are you using PyCharm? if yes change the environment to your desired directory and desired interpreter if you do have multiple interpreter available

Unable to activate Conda environment as 'chcp' and 'cmd' is not recognized as internal or external command operable program

I am currently on the newest Anaconda3-5.0.1, Python 3.6 and using
Windows 8 (during the Anaconda installation I ticked the add to PATH
option). On Anaconda Prompt, I created a new conda env and Anaconda
tells me to activate it with
activate newenv
However, this error code pops up
'chcp' is not recognized as an internal or external command, operable program or batch file
'cmd' is not recognized as an internal or external command, operable program or batch file
'cmd' is not recognized as an internal or external command, operable program or batch file
Any ideas? I have tried this on Anaconda Prompt
set PATH=C:\Users\WIN8.1\Anaconda3\envs\newenv\Scripts;C:\Users\WIN8.1\Anaconda3\envs\newenv;%PATH%
However this is still unsuccessful as when i checked
conda info --envs
I can see the environment newenv I just created on the list, but the * sign is still next to root. The individual paths are also set correctly but not until the Scripts folder.
Would really appreciate help. Thanks so much guys.
I think first you should add the PATH where 'cmd' and 'chcp' located to the environment. (usually in C:\Windows\System32, you should check it out first)
Then add the path, go to:
Control Panel -> Advanced System settings -> Environment Variables ->
Path -> Edit
=====> Then add "C:\Windows\System32\" or "%SystemRoot%\System32;%SystemRoot%"
It worked for the others but actually this didnt work for me, then I run the command as
cd C:\Windows\System32
activate [environment name]
(it means that I have to activate the environment where 'cmd' and 'chcp' located . It's weird, but it worked for me.)
Hope it helps.
In my case, I changed the values order for Path System variable - now I have C:\Windows\System32 set as the first value. I have also added C:\Windows\System32 in the Path user variable.
I had the problem but for installing matplotlib.
I changed my environment variable with C:\windows\system32, closed the Anaconda prompt and reopened as administrator. Executing the command as administrator made it work.
Here are some links which helped my researches :
ContinuumIO
Chinese Forum

error in creating http server on windows

I want to set up Python SimpleHTTPServer on windows XP. I have Python installed on my computer. I am executing the following command:
python -m SimpleHTTPServer 8888
But I am getting the error:
python :
The term 'python' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Looks like Python is not in your PATH enviroment variable. To fix this try this answer:
https://stackoverflow.com/a/6318188/6400392
Hold Win and press Pause.
Click Advanced System Settings.
Click Environment Variables.
Append ;C:\python27 to the Path variable.
Restart Command Prompt.

Categories