I have installed python 2.7 on my computer. I am able to run python from anaconda but not from command line. The command line says python not found.
Also, how can I have two python versions(2.7 and 3.4) at the same time?
I have installed python 2.7 on my computer. I am able to run python from anaconda but not from command line. The command line says python not found.
Also, how can I have two python versions(2.7 and 3.4) at the same time?
run this command line:
ipython myprogram.py
To create a new virtual environment with a specific version of python, using conda:
conda create -n my_env python=3.6
To switch environments:
on osx/linux: source activate my_env
on windows: activate my_env
to exit source deactivate
, or deactivate
on windows
more details here: managing conda environments
It can be, that two different python versions are running on your pc. Make sure, you have the same version running on anaconda and the command line.
If on windows just install them both and rename the python.exe tot python2.exe for version 2.7 and python3.exe for python 3.
Now you can call python 2 in the command prompt with python2
and you can acces python3 with python3
Also make sure your python path is in your environment variables.
Sure, you can have two Pythons installed.
The command line searches the executable you wanted to run (python, in this case) in the current directory and in all directories specified in PATH environment variable.
It depends on OS, but search how to insert the binary directory (where the python executable resides) into the PATH environment variable.