Skip to content Skip to sidebar Skip to footer

Python 3.7 Input() Doesnt Work But Raw_input Does

So classic beginner problem here... Ive been trying to use Python on various text editors like VSCode and Atom and none of them seem to work (After installing python 3.7). If I ask

Solution 1:

You need to be using virtual environments. Since you're running on a Mac I would suggest you use the Anaconda distribution of Python. Instructions are here. This simplifies the process of making virtual environments. It's as easy as conda create -n myenv python=3.6 and more detailed instructions are found here. Once conda is installed you can use commands like conda install scipyto install python packages. Once you have virtual environments installed and activated your command should work. Try it in the python 3.6 environment.

Solution 2:

Strange,

I guess something wrong with installation,

Please check what:

import sys
print(sys.version)

Outputs,

and also see what this outputs:

import platform
print(platform.python_version())

And see if this works:

print'hello'

If it does work, you're on python 2, also see what sys.version and platform.python_version() outputs

Solution 3:

As U9-Forward has mentioned in his answer, similarly...

Check that the installtion of Python 3.7 is correct by entering the follwoing into the Python 3.7 native IDLE Shell (you may have been using the IDLE of an older Python version): import sysprint(sys.version)and...import platformprint(platform.python_version())If any of this produces an error, you will know if there was a problem with installation.

It's possible that you have multiple versions of Python installed. Check to see what versions you do have installed. If you have other versions besides Python 3.7 uninstall them. If the problem persists uninstall Python 3.7 and reinstall it.

The problem as you described can occur when one attempt to install a newer version of Python when older version(s) are still installed.

Solution 4:

Sames happends to me, i uninstall all anaconda + spyder. then i install 3.7. -variable-input(), works on 3.0,3.1,3.2,3.3,3.4,3.5,3.6 nd 3.7. on all other -variable-raw_input workds

dsclmer: -variable- replace with your own variable such as name or age etc, eg..

Post a Comment for "Python 3.7 Input() Doesnt Work But Raw_input Does"