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.
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)
Thanks in advance for any help you can provide.
I've installed Python3 on my MacBook using Homebrew. This is so I can access the latest version (3.7.5).
However I've recently updated to Catalina, which already has Python3 installed (3.7.3).
The problem is, when I type "python3" into the Command Line, it starts the MacOS version of Python (3.7.3) not the latest version I've installed using Homebrew.
Is there a way I can make sure I'm always accessing my dev/Homebrew version of Python?
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 use pyenv to manage python versions. I'm using Python 3.4.1 :: Anaconda 2.1.0 (x86_64), but in python cgi running on python server, python version seems to become 2.7.10.
How can I fix this to use version 3.4.1 on python server?
If you run python3 --version on the server, what version is it ? I'm making the assumption that you are using a newer version of Linux on the server which might be shipped with both a Python 2.7.x and Python 3.x version.
If not, you'll have to download and install it yourself, preferably into it's own location, as you do not wish to override the system version of Python that can be used for things such as package management.
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.