Download Numerical Python for free. A package for scientific computing with Python. NEWS: NumPy 1.11.2 is the last release that will be made on sourceforge. Wheels for Windows, Mac, and Linux as well as archived source distributions can be found on PyPI. Download Python 3.4 for iOS for iOS to python 3.4 for iOS is a Python 3.4.0a0 development environment for the iOS.
Latest version Released:
Get MAC addresses of remote hosts and local interfaces
Project description
Pure-Python package to get the MAC address of network interfaces and hosts on the local network.
It provides a platform-independent interface to get the MAC addresses of:
- System network interfaces (by interface name)
- Remote hosts on the local network (by IPv4/IPv6 address or hostname)
It provides one function:
get_mac_address()
Should you use this package?
If you only need the addresses of network interfaces, have a limited setof platforms to support, and are able to handle C-extension modules, thenyou should instead check out the excellent netifacespackage by Alastair Houghton. It is significantly faster, well-maintained,and has been around much longer than this has. Another great option thatfits these requirements is the well-known and battle-hardenedpsutil package by Giampaolo Rodola.
If the only system you need to run on is Linux, you can run as root,and C-extensions modules are fine, then you should instead check out thearpreq package by Sebastian Schrader.It can be significantly faster, especially in the case of hosts thatdon't exist (at least currently).
If you want to use
psutil
, scapy
, or netifaces
, I have examples of how to doso in a GitHub Gist.Installation
Stable release from PyPI
Latest development version
Python examples
Terminal examples
Python 2 users: use
getmac2
or python -m getmac
instead of getmac
.Function: get_mac_address()
interface
: Name of a network interface on the systemip
: IPv4 address of a remote hostip6
: IPv6 address of a remote hosthostname
: Hostname of a remote hostnetwork_request
: If an network request should be made to updateand populate the ARP/NDP table of remote hosts used to lookup MACsin most circumstances. Disable this if you want to just use what'salready in the table, or if you have requirements to prevent networktraffic. The network request is a empty UDP packet sent to a highport, 55555 by default. This can be changed by settinggetmac.PORT
to the desired integer value. Additionally, on Windows, this willsend a UDP packet to 1.1.1.1:53 to attempt to determine the default interface.
Configuration
logging.getLogger('getmac')
: Runtime messages and errors are recorded to thegetmac
logger using thelogging
module. They can be configured by usinglogging.basicConfig()
or adding handlers to thegetmac
logger.getmac.getmac.DEBUG
: integer value that controls debugging output. The higher the value, the more output you get.getmac.getmac.PORT
: UDP port used to populate the ARP/NDP table(see the documentation of thenetwork_request
argument inget_mac_address()
for details)
Features
- Pure-Python (no compiled C-extensions required!)
- Python 2.7 and 3.4+
- Lightweight, with no dependencies and a small package size
- Can be dropped into a project as a standalone .py file
- Supports most interpreters: CPython, pypy, pypy3, IronPython 2.7, and Jython 2.7
- Provides a simple command line tool (when installed as a package)
- MIT licensed!
Legacy Python versions
If you are running a old Python (2.6/3.3 and older) or interpreter, then youcan install an older version of
getmac
that supported that version.The wheels are available in theGitHub releases, orfrom PyPI with a current version of pip
and some special arguments.- Python 2.5: get-mac 0.5.0
- Python 2.6: getmac 0.6.0
- Python 3.2: get-mac 0.3.0
- Python 3.3: get-mac 0.3.0
NOTE: these versions do not have many of the performance improvements,platform support, and bug fixes that came with later releases.They generally work, just not as well. However, if you're using suchan old Python, you probably don't care about all that :)
Notes
- If none of the arguments are selected, the defaultnetwork interface for the system will be used.
- 'Remote hosts' refer to hosts in your local layer 2 network, alsocommonly referred to as a 'broadcast domain', 'LAN', or 'VLAN'. As faras I know, there is not a reliable method to get a MAC address for aremote host external to the LAN. If you know any methods otherwise, pleaseopen a GitHub issue or shoot me an email, I'd love to be wrong about this.
- The first four arguments are mutually exclusive.
network_request
does not have any functionality when theinterface
argument isspecified, and can be safely set if using in a script. - The physical transport is assumed to be Ethernet (802.3). Others, such asWi-Fi (802.11), are currently not tested or considered. I plan toaddress this in the future, and am definitely open to pull requestsor issues related to this, including error reports.
- Exceptions will be handled silently and returned as a None.If you run into problems, you can set DEBUG to true and get moreinformation about what's happening. If you're still having issues,please create an issue on GitHub and include the output with DEBUG enabled.
Commands and techniques by platform
- Windows
- Commands:
getmac.exe
,ipconfig.exe
,arp.exe
,wmic.exe
- Libraries:
uuid
,ctypes
,socket
- Commands:
- Linux/Unix
- Commands:
arp
,ip
,ifconfig
,netstat
,ip link
,lanscan
- Libraries:
uuid
,fcntl
,socket
- Files:
/sys/class/net/{iface}/address
,/proc/net/arp
- Default interfaces:
/proc/net/route
,route
,ip route list
- Commands:
- Mac OSX (Darwin)
networksetup
- Same commands as Linux
- WSL
- Windows commands are used for remote hosts
- Unix commands are used for interfaces
- OpenBSD
- Commands:
ifconfig
,arp
- Default interfaces:
route
- Commands:
- FreeBSD
- Commands:
ifconfig
,arp
- Default interfaces:
netstat
- Commands:
Platforms currently supported
All or almost all features should work on 'supported' platforms.While other versions of the same family or distro may work, theyare untested and may have bugs or missing features.
- Windows
- Desktop: 7, 8, 8.1, 10
- Server: TBD
- Partially supported (untested): 2000, XP, Vista
- Linux distros
- CentOS/RHEL 6+ (Only with Python 2.7+)
- Ubuntu 16.04+ (15.10 and older should work, but are untested)
- Fedora (24+)
- Mac OSX (Darwin)
- The latest two versions probably (TBD)
- Windows Subsystem for Linux (WSL)
- FreeBSD (11+)
- OpenBSD
- Docker
Docker
Caveats
- Depending on the platform, there could be a performance detriment,due to heavy usage of regular expressions.
- Platform test coverage is imperfect. If you're having issues,then you might be using a platform I haven't been able to test.Keep calm, open a GitHub issue, and I'd be more than happy to help.
Known Issues
- Linux, WSL: Getting the mac of a local interface IP does not currently work(
getmac -4 10.0.0.4
will fail if10.0.0.4
is the IP address of a local interface).This issue may be present on other POSIX systems as well. - Hostnames for IPv6 devices are not yet supported.
- Windows: the 'default' (used when no arguments set or specified)of selecting the default route interface only works effectivelyif
network_request
is enabled. If not,Ethernet
is used as the default. - IPv6 support is good but lags behind IPv4 in some placesand isn't as well-tested across the supported platform set.
Background and history
The Python standard library has a robust set of networking functionality,such as
urllib
, ipaddress
, ftplib
, telnetlib
, ssl
, and more.Imagine my surprise, then, when I discovered there was not a way to get aseemingly simple piece of information: a MAC address. This package was bornout of a need to get the MAC address of hosts on the network withoutneeding admin permissions, and a cross-platform way get the addressesof local interfaces.In Fall 2018 the package name changed to
getmac
from get-mac
. Thisaffected the package name, the CLI script, and some of the documentation.There were no changes to the core library code. While both package nameswill updated on PyPI, the use of getmac
is preferred.Contributing
Contributors are more than welcome!See the contribution guide to get started,and checkout the todo list for a full list of tasks and bugs.
Before submitting a PR, please make sure you've completed thepull request checklist!
The Python Discord server is a good placeto ask questions or discuss the project (Handle: @KnownError).
Contributors
- Christopher Goes (@ghostofgoes) - Author and maintainer
- Calvin Tran (@cyberhobbes) - Windows interface detection improvements
- Izra Faturrahman (@Frizz925) - Unit tests using the platform samples
- Jose Gonzalez (@Komish) - Docker container and Docker testing
- @fortunate-man - Awesome usage videos
- @martmists - legacy Python compatibility improvements
- @hargoniX - scripts and specfiles for RPM packaging
- Ville Skyttä (@scop) - arping lookup support
Sources
Many of the methods used to acquire an address and the core logic frameworkare attributed to the CPython project's UUID implementation.
Other notable sources
License
MIT. Feel free to copy, modify, and use to your heart's content. Enjoy :)
NOTE: if any changes significantly impact your project or use case,please open an issue on GitHubor send me an email (see git commit author info for address).
NEXT (XX/XX/XXXX)
- TBD
0.8.2 (12/07/2019)
Announcement: Python 2 compatibility will be dropped in getmac 1.0.0, which will be finished sometime in 2020. If you are stuck on Python 2, consider loosely pinning the version in your dependencies list, e.g.
getmac<1
. I will continue to fix reported bugs and accept patches for the last release before 1.0.0, however active development will cease and new features will not be backported.Changed
- Added warning about Python 2 compatibility being dropped in 1.0.0
- Officially support Python 3.8
- Documented a known issue with looking up IP of a local interface on Linux/WSL (See the 'Known Issues' section in the README)
- Added remote host lookup using
arping
as last resort
Dev
- Standardized formatting on Black
- Lint additions:
vulture
, several Flake8 plugins - Pinned test dependencies (pytest 5 dropped Python 2 support)
- Various quality-of-life improvements for contributors/developers
0.8.1 (05/14/2019)
Changed
- Fixed sockets being opened and not closed when
ip
orip6
were used,which could lead to aResourceWarning
(GH-42)
0.8.0 (04/09/2019)
Added
- OpenBSD support
- FreeBSD support
- Python logging is now used instead of
print
(logger:getmac
) - Include tests in the source distribution
- (CLI) Added aliases for
--no-network-requests
:-N
and--no-net
- (CLI) New argument:
-v
/--verbose
Changed
- Errors are now logged instead of raising a
RuntimeWarning
- Improved Ubuntu support
- Performance improvements
Development
- Significant increase in overall test coverage
- Fixed and migrated the sample tests to
pytest
- Added tests for the CLI
0.7.0 (01/27/2019)
Added
- Type annotations (PEP 484)
Removed
- Dropped support for Python 2.6
- Removed the usage of third-party packages (
netifaces
,psutil
,scapy
, andarpreq
).This should improve the performance of lookups of non-existent interfacesor hosts, since this feature was punishing that path without providing much value.If you want to use these packages directly, I have a guide on how to do so on aGitHub Gist.
Changed
- Significantly improved the performance of the common cases on Linuxfor interfaces and remote hosts
- Improved POSIX interface performance. Commands specific to OSXwill be run only on that platform, and vice-versa.
- Significantly improved the speed and accuracy of determiningthe default interface on Linux
- Python 2 will install an executor named getmac2 and Python 3 anexecutor named getmac so they do not conflict when both RPMs areinstalled on the same system (Credit: @hargoniX)
- The
warnings
module will only be imported if a error/warningoccurs (improve compatibility with some freezers, notably PyInstaller) - Improved system platform detection
- Various other minor performance improvements
Development
- Added unit tests for the samples (Credit: @Frizz925)
- Scripts for building RPMs in the /scripts directory (Credit: @hargoniX)
- Improved code quality and health checks
- Include the CHANGELOG on the PyPI project page
- Using
pytest
for all tests now instead ofunittest
Documentation
- Added instructions on how to build a Debian package (Credit: @kofrezo)
0.6.0 (10/06/2018)
Added
- Windows default interface detection if
network_request
is enabled (Credit: @cyberhobbes) - Docker container (Credit: @Komish)
Changed
- Changed project name to
getmac
. This applies to thecommand line tool, GitHub, and the documentation. - Use proper Python 2-compatible print functions (Credit: @martmists)
Removed
- Support for Python 2.5. It is not feasible to test, and potentiallybreaks some useful language features, such as
__future__
- Variables PORT and DEBUG from top-level package imports, since changingthem would have no actual effect on execution. Instead, use
getmac.getmac.DEBUG
.
Dev
- Added example videos demonstrating usage (Credit: @fortunate-man)
- Added contribution guide
- Added documentation on ReadTheDocs
- Added a manpage
0.5.0 (09/24/2018)
Added
- Full support for Windows Subsystem for Linux (WSL). This is working forall features, including default interface selection! The only edge caseis lookup of remote host IP addresses that are actually local interfaceswill not resolve to a MAC (which should be ff-ff-ff-ff-ff-ff).
Changed
- Require
argparse
if Python version is 2.6 or older
Dev
- Updated tox tests: added Jython and IronPython, removed 2.6
0.4.0 (09/21/2018)
Added
- New methods for remote host MACs
- Windows:
arp
- POSIX:
arpreq
package
- Windows:
- New methods for interface MACs
- Windows:
wmic nic
- Windows:
- DEBUG levels: DEBUG value is now an integer, and increasing it willincrease the amount and verbosity of output. On the CLI, it can beconfigured by increasing the amount of characters for the debug argument,e.g. '-dd' for DEBUG level 2.
- Jython support (Note: on Windows Jython currently only works with interfaces)
- IronPython support
Changed
- Significant performance improvement for remote hosts. Previously,the average for
get_mac_address(ip='10.0.0.100')
was 1.71 seconds.Now, the average is12.7 miliseconds
, with the special case of a unpopulatedarp table being only slightly higher. This was brought about by changes inhow the arp table is populated. The original method was to use thehost'sping
command to send an ICMP packet to the host. This took time,which heavily delayed the ability to actually get an address. The solutionis to instead simply send a empty UDP packet to a high port. The portthis packet is sent to can be configured using the module variablegetmac.PORT
. - 'Fixed' resolution of localhost/127.0.0.1 by hardcoding the response.This should resolve a lot of problematic edge cases. I'm ok with thisfor now since I don't know of a case when it isn't all zeroes.
- Greatly increased the reliability of getting host and interface MACs on Windows
- Improved debugging output
- Tightened up the size of
getmac.py
- Various minor stability and performance improvements
- Add LICENSE to PyPI package
Removed
- Support for Python 3.2 and 3.3. The total downloads from PyPI withthose versions in August was ~53k and ~407K, respectfully. The majorityof those are likely from automated testing (e.g. TravisCI) and notactual users. Therefore, I've decided to drop support to simplifydevelopment, especially since before 3.4 the 3.x series was stillvery much a 'work in progress'.
Dev
- Added automated tests for Windows using Appveyor
- Tox runner for tests
- Added github.io page
- Improved TravisCI testing
0.3.0 (08/30/2018)
Added
- Attempt to use Python modules if they're installed. This is usefulfor larger projects that already have them installed as dependencies,as they provide a more reliable means of getting information.
psutil
: Interface MACs on all platformsscapy
: Interface MACs and Remote MACs on all platformsnetifaces
: Interface MACs on Non-Windows platforms
- New methods for remote MACs
- POSIX:
ip neighbor show
, Abuse ofuuid._arp_getnode()
- POSIX:
- New methods for Interface MACs
- POSIX:
lanscan -ai
(HP-UX)
- POSIX:
Changed
- Certain critical failures that should never happen will now warninstead of failing silently.
- Added a sanity check to the
ip6
argument (IPv6 addresses) - Improved performance in some areas
- Improved debugging output
Fixed
- Major Bugfix: search of
proc/net/arp
would return shorter addresses in thesame subnet if they came earlier in the sequence. Example: a search for192.168.16.2
on Linux would instead return the MAC address of192.168.16.254
with no errors or warning whatsoever. - Significantly improved default interface detection. Defaultinterfaces are now properly detected on Linux and most otherPOSIX platforms with
ip
orroute
commands available, or thenetifaces
Python module.
Dev
- Makefile
- Vagrantfile to spin up testing VMs for various platforms using Vagrant
- Added more samples of command output on platforms (Ubuntu 18.04 LTS)
0.2.4 (08/26/2018)
Fixed
- Fixed identification of remote host on OSX
- Resolved hangs and noticeable lag that occurred when 'network_request'was True (the default)
0.2.3 (08/07/2018)
Fixed
- Remote host for Python 3 on Windows
0.2.2
Added
Python 3.4 Download Mac Installer
- Short versions of CLI arguments (e.g. '-i' for '--interface')
Changed
- Improved usage of 'ping' across platforms and IP versions
- Various minor tweaks for performance
- Improved Windows detection
Fixed
- Use of ping command with hostname
Dev:
- Improvements to internal code
0.2.1
Nothing changed. PyPI just won't let me push changes without a new version.
0.2.0 (04/15/2018)
Added
- Checks for default interface on Linux systems
- New methods of hunting for addresses on Windows, Mac OS X, and Linux
Changed
- CLI will output nothing if it failed, instead of 'None'
- CLI will return with 1 on failure, 0 on success
- No CLI arguments now implies the default host network interface
- Added an argumnent for debugging:
--debug
- Removed
-d
option from--no-network-requests
Fixed
- Interfaces on Windows and Linux (including Bash for Windows)
- Many bugs
Removed
- Support for Python 2.6 on the CLI
Dev
- Overhaul of internals
0.1.0 (04/15/2018):
Added
- Addition of a terminal command:
get-mac
- Ability to run as a module from the command line:
python -m getmac
Changed
arp_request
argument was renamed tonetwork_request
- Updated docstring
- Slight reduction in the size of getmac.py
Dev
- Overhauled the README
- Moved tests into their own folder
- Added Python 3.7 to list of supported snakes
0.0.4 (11/12/2017):
- Python 2.6 compatibility
0.0.3 (11/11/2017):
- Fixed some addresses returning without colons
- Added more rigorous checks on addresses before returning them
0.0.2 (11/11/2017):
- Remove print statements and other debugging output
0.0.1 (10/23/2017):
![Python 3.4 download mac installer Python 3.4 download mac installer](/uploads/1/1/7/8/117896939/592720590.png)
- Initial pre-alpha
Release historyRelease notifications | RSS feed
0.8.2
0.8.1
0.8.0
0.7.0
0.5.1
0.5.0
0.4.0
0.3.0
0.2.4
0.2.3
0.2.2
0.2.1
0.2.0
0.0.4
0.0.3
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size get_mac-0.8.2-py2.py3-none-any.whl (24.3 kB) | File type Wheel | Python version py2.py3 | Upload date | Hashes |
Filename, size get-mac-0.8.2.tar.gz (47.7 kB) | File type Source | Python version None | Upload date | Hashes |
Hashes for get_mac-0.8.2-py2.py3-none-any.whl
Algorithm | Hash digest |
---|---|
SHA256 | e288724bf5b83a0f43ae7993e36c8a75ccd34a3ac8517036396d973705cdbc55 |
MD5 | 4de6662df65928e8c305b3dc4635bd78 |
BLAKE2-256 | 27ed64afb71e59125c41fe66bbe2b6d240ae5f051e5912decf7f5ecf6ffdc5f3 |
Hashes for get-mac-0.8.2.tar.gz
Algorithm | Hash digest |
---|---|
SHA256 | 3b1bb3277f442450a9ef6135e830213b8d6f2a8f25a337dd3ebdf83018dd6a42 |
MD5 | 2a3140c47f1ee2d967e06721d68f1d58 |
BLAKE2-256 | 38aae6a8716ca82fd370920e0ca39c9f6feed2d2ff986a1605909b41cafd6fb8 |
DownloadMacintosh IDLE and tkinter with Tcl/Tk on Mac OS X
Important
If you are using Python from a python.org64-bit/32-bit Python installer for Mac OS X 10.6 and later,you should only use IDLE or tkinter with an updatedthird-party Tcl/Tk 8.5, likeActiveTcl 8.5installed.
If you are using OS X 10.9 Mavericks and a Python from a python.org64-bit/32-bit installer,application windows may not update properly due toa Tk problem.Installthe latest ActiveTcl 8.5.15.0 if possible.(Also, a critical OS X 10.9 problemthat could cause Python to crash when used interactively has been fixed asof the 3.4.0, 3.3.3, and 2.7.6 installers.)
If you are using Mac OS X 10.6, do not use IDLE or Tkinterfrom the Apple-supplied Python 2.6.1 in Mac OS X 10.6. If possible,install and use a newer version of Python and of Tcl/Tk.
Python's integrated development environment,IDLE, and thetkinter GUI toolkitit uses, depend on the Tk GUI toolkit which isnot part of Python itself. For best results, it is important that theproper release of Tcl/Tk is installed on your machine.For recent Python installers for Mac OS X downloadable from this website,here is a summary of current recommendations followed by more detailedinformation.
PythonRelease | InstallerVariant | Mac OS XRelease | RecommendedTcl/Tk | AlternateTcl/Tk | NotRecommended |
---|---|---|---|---|---|
3.4.1,3.3.5,2.7.7rc1 | 64-/32-bit | 10.9 | ActiveTcl8.5.15.0 | Apple8.5.9 | |
10.8 | ActiveTcl8.5.15.0 | Apple8.5.9 | |||
10.7 | ActiveTcl8.5.15.0 | Apple8.5.9 | |||
10.6 | ActiveTcl8.5.15.0 | Apple8.5.7 | |||
32-bit-only | 10.5 | ActiveTcl8.4.20 | Apple8.4.7 | ||
2.7.6 | 64-/32-bit | 10.9 | ActiveTcl8.5.15.0 | Apple8.5.9 | |
10.8 | ActiveTcl8.5.15.0 | Apple8.5.9 | |||
10.7 | ActiveTcl8.5.15.0 | Apple8.5.9 | |||
10.6 | ActiveTcl8.5.15.0 | Apple8.5.7 | |||
32-bit-only | 10.5 | ActiveTcl8.4.20 | Apple8.4.7 | ||
10.4 | ActiveTcl8.4.20 | Apple8.4.7 | |||
10.3.9 | ActiveTcl8.4.20 |
Tk On Mac OS X
There are currently three major variants of Tk in common use on Mac OS X:
- Aqua Carbon Tk
- This has been the most common native version on Mac OS X.Because is is implemented with older Mac OS X Carbon interfaces, it isonly available as a 32-bit binary (usually for Intel and PowerPCprocessors). Aqua Carbon Tk 8.4 is included with Mac OS X releases 10.4through 10.9 and is also available from ActiveState. Aqua Carbon variantsof Tk 8.5 had been available as an ActiveState Community Download priorto ActiveTcl 8.5.9. As of 8.5.13, the Tk project no longer supportsCarbon builds of Tk 8.5.
- Aqua Cocoa Tk
- A newer native implementation availableas a universal 64-bit and 32-bit binary. This variant is the standard nativeOS X variant in Tk 8.6 and as of Tk 8.5.13. Aqua Cocoa support wasbackported to Tk 8.5 (prior to 8.5.13) and released by Apple starting with Mac OS X 10.6and by ActiveState starting with their 8.5.9.1 release. While the Pythoninstallers downloadable from this website do not support Aqua Cocoa Tk 8.6,other distributors of Python for Mac OS X may do so.
- X11 Tk
- The traditional platform-independent UNIX Tk implementation whichrequires an X11 server, such as the Apple X11.app available as anoptional component in all recent Mac OS X releases. 64-bit and32-bit binaries can be built. While the Python installers downloadablefrom this website do not support X11 Tk, other distributors ofPython for Mac OS X may do so.
Tcl/Tk Releases
ActiveTcl 8.5.15.0
ActiveState provides binary distributions of Tcl/Tk which are upward compatiblewith and generally more up-to-date than those provided by Apple in Mac OS Xreleases. This version of Tcl/Tk includes fixes for some critical problemsthat you may encounter using tkinter or IDLE (see Apple 8.5.9 below).Note that, while the ActiveState web site refers to 8.5.15.0,the installer dmg link has been updated to download ActiveTcl 8.5.15.1.The 8.5.15.1 update contains the fix for the OS X 10.9 Mavericks windowupdate problem.You can download an installer for this release fromthe ActiveState web site.Note that ActiveState Community Edition binaries are not open source andare covered by an ActiveState license. You should read the licensebefore downloading to verify that your usage complies with its terms of use.This is an Aqua Cocoa Tk.
Apple 8.5.9
This release is included in Mac OS X 10.9, 10.8, and 10.7. As of this writing,there are at least two known issues with Tk 8.5.9 thatare present in Apple 8.5.9 Tk but fixed in more recent upstream 8.5 releases.The more serious problem is an immediate crash in Tkwhen entering a composition character, like Option-u on a US keyboard.(This problem is documented asTk bug 2907388.)There is also the more general problem of input manager support for compositecharacters(Tk bug 3205153)which has also been fixed in more recent Tcl/Tk 8.5 releases.You can avoid these problems by using a current python.org installerthat links with ActiveTcl 8.5.15.0.This is an Aqua Cocoa Tk.
Apple 8.5.7
This release is included in Mac OS X 10.6. IDLE is known to hang or crashwhen used with the Apple 8.5.7 included in all versions of Mac OS X 10.6.x.Because of this,we strongly recommend that you do not attempt to use Tkinter or IDLE withthe Apple-supplied Python 2.6.1 in 10.6. Instead, install a newer version ofPython that supports a newer version of Tk.This is an Aqua Cocoa Tk.
ActiveTcl 8.4.20
Download Python 3.5 For Windows
ActiveState provides binary distributions of Tcl/Tk which are upward compatiblewith and generally more up-to-date than those provided by Apple in Mac OS Xreleases. You can download an installer for this release fromthe ActiveState web site.Note that ActiveState Community Edition binaries are not open source andare covered by an ActiveState license. You should read the licensebefore downloading to verify that your usage complies with its terms of use.This is an Aqua Carbon Tk.
Apple 8.4.19
This release is included in Mac OS X 10.9, 10.8, 10.7, and 10.6.This is an Aqua Carbon Tk.
Apple 8.4.7
How To Install Python 3.4
This release is included in Mac OS X 10.5 and 10.4. This is an AquaCarbon Tk.
How Python Chooses Which Tk Library To Use
Note
![Install Install](/uploads/1/1/7/8/117896939/666701619.png)
While Tcl and Tk areseparate frameworks and libraries, they are closely related and arenormally installed or updated simultaneously. You should notattempt to mix-and-match Tcl and Tk versions. References toa specific version of Tk assume the corresponding version ofTcl is installed as well.
The Python for Mac OS X installers downloaded from this website dynamicallylink at runtime to Tcl/Tk Mac OS X frameworks. The Tcl/Tk major version isdetermined when the installer is created and cannot be overridden.The Python 64-bit/32-bit Mac OS X installers for Python 3.4.x, 3.3.x, 3.2.x,and 2.7.x dynamically link to Tcl/Tk 8.5 frameworks.32-bit-only Python installers for Mac OS X dynamically link to Tcl/Tk 8.4frameworks.
Python 3.4 Download Mac Os
In either case, the dynamically linking occurs when tkinter (Python 3)or Tkinter (Python 2) is first imported (specifically, the internal_tkinter C extension module). By default, the Mac OS X dynamic linkerlooks first in /Library/Frameworks for Tcl and Tk frameworks withthe proper major version. This is the standard location for third-partyor built from source frameworks, including the ActiveTcl releases.If frameworks of the proper major version are not found there,the dynamic linker looks for the same version in/System/Library/Frameworks, the location for Apple-suppliedframeworks shipped with Mac OS X. (Note, you should normally not modifyor delete files in /System/Library.)
As is common on Mac OS X, the installed Pythons and the Tcl and Tkframeworks are built to run on multiple CPU architectures (universalbinaries) and across multiple Mac OS X levels (minimum deploymenttarget). For Python to be able to dynamically link with a particularTcl and Tk version, the available architectures in the Tcl/Tk frameworksmust include the architecture that Python is running in and theirminimum deployment target should be no greater than that of Python.The 64-bit/32-bit Mac OS X installers for Python 3.4.x, 3.3.x, 3.2.x,and 2.7.x are built with Intel-64 (x86_64) and Intel-32 (i386)architectures and a minimum deployment target of Mac OS X 10.6. TheApple 8.5.9 and ActiveTcl 8.5.15.0 releases discussed below are compatiblewith these installers. The 32-bit-only Python installers for Mac OS Xfrom this web site are built with Intel-32 (i386) and PowerPC-32 (ppc)architectures and are compatible with all current releases of Apple 8.4.x andActiveTcl 8.4.x. Starting with Python 3.3.0, the minimum deployment targetfor 32-bit-only installers is Mac OS X 10.5; for earlier releases, it isMac OS X 10.3.9.
Revision history
Python 3.5 Download
- 2014-05-18 - updated for 3.4.1 and 2.7.7rc1
- 2014-03-16 - updated for 3.4.0 and 3.3.5
- 2014-02-10 - updated for 3.3.4 and 3.4.0rc1
- 2014-01-05 - updated for 3.4.0b2
- 2013-11-24 - clarify that the ActiveState website still refers to 8.5.15.0
- 2013-11-24 - removed built-in for 3.4.0b1, removed 3.3.2 and 2.7.5
- 2013-11-10 - ActiveTcl 8.5.15.1; removed built-in for 3.3.3rc2 and 2.7.6.
- 2013-10-27 - updated for 3.3.3rc1 and 2.7.6rc1 and their built-in 8.5.15.
- 2013-10-24 - updated for OS X 10.9 and ActiveTcl 8.5.15, removed 3.2.5.
- 2013-10-20 - updated for 3.4.0a4 and its built-in 8.5.15.
- 2013-09-29 - updated for 3.4.0a3
- 2013-09-09 - updated for 3.4.0a2 and its built-in 8.5.14.
- 2013-08-03 - updated for 3.4.0a1 and ActiveTcl 8.4.20
- 2013-05-18 - updated for ActiveTcl 8.5.14
- 2013-05-15 - updated for 3.3.2, 2.7.5, and 3.2.5
- 2013-04-06 - updated for 3.3.1, 2.7.4, and 3.2.4
- 2012-12-26 - updated for ActiveTcl 8.5.13 and Issue 15853 patch installer
- 2012-09-29 - updated for 3.3.0 final and reverted to ActiveTcl 8.5.11.1
- 2012-08-02 - updated for ActiveTcl 8.5.12
- 2012-07-28 - updated for OS X 10.8
- 2012-04-11 - updated for 3.2.3 final and 2.7.3 final
- 2012-03-18 - updated for 3.2.3rc2 and 2.7.3rc2
- 2012-03-04 - updated for ActiveTcl 8.5.11.1, 3.2.3rc1, 2.7.3rc1, removed 3.1.4
- 2011-11-12 - updated for ActiveTcl 8.5.11
- 2011-09-04 - updated for 3.2.2 final
- 2011-07-21 - updated for OS X 10.7 and ActiveTcl 8.5.10.1
- 2011-07-09 - updated for 3.2.1 final and ActiveTcl 8.5.10
- 2011-06-12 - updated for 2.7.2 final and 3.1.4 final
- 2011-05-30 - updated for 3.2.1rc, 2.7.2rc, and 3.1.4rc
- 2011-03-08 - add warnings and include details on how Python links with Tcl/Tk releases
- 2011-02-20 - updated for 3.2 final
- 2011-01-31 draft 1 - preliminary info for 3.2rc2
- 2011-01-14 draft 0