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 for a simple input the program crashes labelling the input as undefined, but when I use raw_input() it works just fine for some reason. However, raw_input() was changed to input() in Python 3 so why does this keep happening to me?
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Django __str__ returned non-string (type NoneType)
- Evil ctypes hack in python
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 likeconda install scipy
to install python packages. Once you have virtual environments installed and activated your command should work. Try it in the python 3.6 environment.Strange,
I guess something wrong with installation,
Please check what:
Outputs,
and also see what this outputs:
And see if this works:
If it does work, you're on python 2, also see what
sys.version
andplatform.python_version()
outputsAs U9-Forward has mentioned in his answer, similarly...
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.