Unable to install Robotframework on Mac - python

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

Related

Modules installed but not found by Python in Raspberry Pi 3

I have a Raspberry Pi 3 with Raspbian and I upgraded python version from 3.7 to 3.8. If I type python --version in the terminal the correct version appears as the system version. However none of the modules that I have installed AFTER the version change seem to work. Python gives ModuleNotFoundError when trying to import ANY of the modules that I have installed.
I can see the modules with pip freeze but Python seems to not be able to find them.
I followed this instructions to purge 3.7. I reinstalled pip after purging python 3.7 but pip as again installed in /home/pi/.local/lib/python3.7/site-packages/pip. How can I get rid of 3.7 completely?
python3.8 -m pip install SomePackage # specifically Python 3.8 should work.
More documentation here: https://docs.python.org/3/installing/index.html#work-with-multiple-versions-of-python-installed-in-parallel
Just to summarize the comments and suggestions from other answers:
The problem I have was caused by the fact that even I had set Python 3.8 as default and python -v was pointing to Python 3.8 the pip script was installing modules for Python 3.7.
The suggested solution was to use pip3.8 (or whatever version someone might have) to install packages for that equivalent Python version and that works good.
Ideally best option if someone wants to have multiple versions of python is to use pyenv. You can create multiple virtual environments with multiple python versions.
However Do not uninstall the default Python. I have also tried to uninstall the default Python 3.7 to avoid having two versions of python 3 and keeping track of which module is installed where. This was a bad idea. I did not know that many Linux distributions have applications which use the default Python. You might get a black screen and who knows what other problems see this discussion Removed Python 3 on 18.04, how can I fix my system?

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.

How to uninstall python 2.7 from terminal?

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.

How can I fix my python installation?

For some work I'm doing at my office I needed to downgrade my python version from 2.7.9 (OS X default installation) to 2.7.6. It seemed the easiest way to do this would be to uninstall python and then reinstall the older version. After following the instructions here and then running the official Python 2.7.6 installer. I then tried to just run python in the terminal to make sure the installation worked and received this error:
-bash: /usr/local/Cellar/python/2.7.9/bin/python: No such file or directory
Running python --version gave the same results. which python yielded the following directory:
/usr/local/bin/python
Does anyone have any idea how I can fix this issue to get the right version of Python running? I'm pretty much out of ideas at this point.
The symlink in/usr/local/bin/Python is still pointing to the other version. Update it to point to the version currently installed and it should work.

Categories

Resources