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.
Related
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)
I decided yesterday to do a clean install of Mac OS (as in, erase my entire disk and reinstall the OS).
I am on a Macbook Air 2018. I did a clean install of Mac OS 10.15.1.
I did this clean install due my previous Python environment being very messy.
It was my hope that I could get everything reigned in and installed properly.
I've started reinstalling my old applications, and took care to make sure nothing was installed in a weird location.
However, when I started setting up VS Code, I noticed that my options for Python interpreters showed 4 options. They are as follows:
Python 2.7.16 64-bit, located in /usr/bin/python
Python 2.7.16 64-bit, located in /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
Python 3.7.3 64-bit, located in /user/bin/python
Python 3.7.3 64-bit, located in /Library/Developer/CommandLineTools/usr/bin/python3
In terminal, if I enter where python python3
it returns
/usr/bin/python /usr/bin/python3.
How in the world did python3 get there?
My only idea is that it now is included in the Xcode Developer Tools 11.2 package, as I did install that. I cannot find any documentation of this inclusion.
Any ideas how this got here? More importantly, how do I remove it? I want to use Homebrew for all of my installation needs. Also, why does VS Code show 4 options?
Thanks!
The command line tool to run the python 2.7 environment is at /usr/bin/python, but the framework and dependencies for it are in /System. This includes the Python.app bundle, which is just a wrapper for scripts that need to run using the Mac's UI environment.
Although these files are separate executables, it's likely that they point to the same environment.
Every MacOS has these.
Catalina does indeed also include /usr/bin/python3 by default. The first time you run it, the OS will want to download Xcode or the Command line tools to install the 'complete' python3. So these pair are also the same environment.
I don't think you can easily remove these, due to the security restrictions on system files in Catalina.
Interestingly, Big Sur still comes with python2 !
I upgraded python from 32-bit version to the 64-bit one, I did this by uninstalling python using add or remove programs and installing a new one from the official installer. While doing so, I also upgraded it from python 3.6 to 3.7.
Now when I try running pip I get the following error
The code execution cannot proceed because python36.dll was not found. Reinstalling the program may fix this problem.
It didn't.
python -m pip works for me but I would still like to fix the original functionality.
This happened with me too and I didn't get any solution to it. But when I installed Python 3.7 then I did not face any problem. And the pip too was working.
Maybe there was an error in the bindings of Python 3.6.
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
I'm trying to install cx_freeze on python, and its just doesn't seem to work. I've tried both through pip in the command line (python -m pip install cx_freeze) and through pycharm community add packages.
At first it gave the notorious unable to find vcvarsall.bat - but I installed visual studios latest with all the c++ compilers.
Now it gives another error message - cxfreeze-postinstall does not exist:
enter image description here
Please help me!
Well, I tried installing the win32 version - and it worked... Have no idea why, since my computer is a 64bit OS with a 64bit processor, and I've only installed 64bit version of stuff until now.
UPDATE: well, the cx_freeze installs, but I still can't manage to get an executable file. I think maybe this module/package is not compatible with python 3.5 - I will later try it on 3.4 and see if it works.
UPDATE_2.0: Works great on Python 3.4 - so I guess there's some problem with the package compatibility with Python 3.5