How to uninstall python 2.7 from terminal? - python

terminal message
I have been having issues with installing things in the terminal Python related like: https://github.com/RomelTorres/alpha_vantage
I did try to uninstall python and install Python 3.8.2 but when I do "python --version" I get Python 2.7.16.

You probably do not have to uninstall it, instead of using the keyword python, try python3. python3 --version will most likely give the version 3.8.2 if you have it installed. On most Linux distributions, and I'm assuming on macOS too, python refers to Python 2 instead of Python 3 for backwards compatibility, so you have to explicitly tell it to use Python 3.

Related

I can't locate my python path (but able to locate python3 path)

I'm currently using Mac Pro and downloaded python through brew install python for the latest version (though it downloaded 3.9.12 instead of 3.10.x).
Also, while playing with the command lines, I also installed pyenv (version 2.2.5).
The problem is, I am now unable to get the default python version.
The command python --version and python -h all gives me zsh: command not found: python.
However, when I do python3 --version, it gives me Python 3.9.12.
Did I mess things up? Is there are way to go back to the state before I altered anything? (or at least recover my default python version?)
What version of MacOS are you running? Starting in 12.3, Python2 was removed from the system.
https://developer.apple.com/documentation/macos-release-notes/macos-12_3-release-notes
Python
Deprecations
Python 2.7 was removed from macOS in this update. Developers should use Python 3 or an alternative language instead. (39795874)

Why is my Mac using python 2.7 when I have 3.8 already installed?

I'm trying to install Selenium using pip. But when I go to my editor (pycharm CE running on 3.8) no such module exists. When I type python -version on terminal it comes up with python 2.7 with a deprecation warning. How to I change this? I'm pretty sure I have to change my path or something like that, but how? Any help is greatly appreciated.
That's because python2.7 is installed by default on Mac. Python3.8 is probably installed besides 2.7. Use python3.8 command and python3.8 -m pip install selenium to install selenium for this specific python version. If pip is not installed for python3.8, install it the official way.
Don't replace system python, because that might break your OS.

Unable to install Robotframework on Mac

I had Python3.6 and Robotframework installed successfully but since python3 does not support Selenium2Library(which i needed to install)i uninstalled both python3.6 and RF, default python2.7 is there but now i am not able to install Robotframework again, it keeps giving me this error -
/Library/Frameworks/Python.framework/Versions/3.6/bin/pip: /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6: bad interpreter: No such file or directory
what am i suppose to do now? where am i going wrong?
Your system is still referring to python 3.6.
Update your PYTHONPATH to point back to python 2.7
See below answer and replace 2.7 with 3.6 in order to remove 3.6 completely
https://stackoverflow.com/a/3819829/8131798
After uninstall type python in terminal and see are you able to start python 2.7

How to install multiple python version on Windows?

I have already python 2.7.9 in C:\Python27
I try to install python 2.7.6 from python.org on C:\Python276
And after the installation :
C:\Python27\python.exe --version return Python 2.7.9
C:\Python276\python.exe --version return Python 2.7.9
Am I missing something ?
How to install multiple python version on Windows 7 (Microsoft Windows [version 6.1.7601]) ?
Use Python Launcher for Windows which allows you to specify which version you want to execute using a shebang. Just place one of these at the top of your script to do so.
#!python276
#!python279
#eryksun give the solution :
python.exe is a loader that's linked to the interpreter DLL, e.g. python27.dll. The problem is likely you installed both versions for all users.
Try installing 2.7.6 for just the current user. That should install the DLL to C:\Python276.

Cygwin not same python version as windows

Background:
I am a .NET developer trying to set up a python programming environment.
I have installed python 2.7.5. However I changed my mind and uninstalled 2.7.5 and installed python 2.7.6.
If I CMD in windows command promopt, the python version is 2.7.6
When I start the cygwin shell and type:
python --version
It says 2.7.5, this version is was uninstalled.
How do I get cygwin to understand it should use the new version. 2.7.6?
I believe there is commands to type in cygwin shell to solve this? Thanks on advance!
Cygwin has its own option to install its own version of Python. If you run setup.exe and poke through the Development packages, you'll find it. You probably installed Python here as well, and are running it in Bash. If you use CMD, you're running a different version. The fact that the version numbers overlap is just coincidental.

Categories

Resources