본문 바로가기

카테고리 없음

Best Python Setup For Mac

Active7 years ago

May 17, 2017  In this Python Beginner Tutorial, we will start with the basics of how to install and setup Python for Mac and Windows. We will also take a look at.

Pygame Setup for Windows, Mac, and Linux After installing Python (see Appendix A ), you’ll want to install Pygame to run the animations and games in Chapter 8 through Chapter 10. This appendix will get you up and running. With the py2app package you can compile a Python script and create a portable Mac application. If you’re using windows, you can check py2exe. First of all, we need to install the py2app python package. For Google's Python Class, it's best to use Python 2.7. Although Python 3.x is becoming more popular, this course is designed for Python 2.6 or later. Mac -- The built in TextEdit works, but not very well. In class, we want a work setup that matches that: a text editor working on the current file.py, and a separate command line window. This tutorial will go through how to set up python on a Mac ( Windows users can go here). There are many schools of thought on the ‘best’ development environments, IDE’s, etc to work with. The goal of this article is to help you get up and running on a Mac writing Python using the Sublime Text IDE. Install both version of python in your mac and you can switch between both the versions by just simply typing the version of python. If you want to open and use python 2.x, type python2./ prog_name.py or if you wonna use the python 3.x, type python3./ prog_name.py where prog_name is, the name of your python file that you want to run it from terminal. The official home of the Python Programming Language. While Javascript is not essential for this website, your interaction with the content will be limited.

I installed python on mac os (mountain lion) with Macports.When I run $python It gives an error on 'cannot import urandom' when I try to import pandas or matplotlib.

If I run $python 2.7 Everything runs perfectly.

I want to change python to use python2.7 always.

Best Python Setup For Mac

I tried using sudo port select python python27. But that didn't help.

• Intelligent Python Support Enjoy outstanding coding assistance with smart code completion, code inspections, on-the-fly error highlighting, auto-fixes, along with automated code refactorings and rich navigation capabilities for all major Python implementations. Take advantage of language-aware code completion, error detection, and on-the-fly code fixes! Osx python ide.

Please help me on this, I'm new to mac.

KakashiKakashi

2 Answers

First let me preface by saying that OSX already comes with python installed. Lion and Mountain Lion have python2.7 as the system defaults.

Now assuming you really did want to use a macports version, my guess is that you only installed it, but didn't do the step of modifying your PATH to have it look first for macport installed executables..

  1. Edit your ~/.profile
  2. Add this line: export PATH=/opt/local/bin:/opt/local/sbin:$PATH

The next time you open a shell, it will place the macports install location at the front of your path, giving you access to the executables.

Best Python Setup For Macjdijdi
72.9k14 gold badges127 silver badges168 bronze badges

If I remember correctly, you may want to do a 'sudo port activate python'. What does 'which python' tell you? If it's /usr/bin/python, you're running OSX Python. If, OTOH, it's /usr/local/bin/python you're probably using the ports version.

Best Python Setup For Mac
rbanffyrbanffy

Not the answer you're looking for? Browse other questions tagged pythonmacospython-2.7 or ask your own question.

Mac OS X comes with Python 2.7 out of the box.

You do not need to install or configure anything else to use Python 2. Theseinstructions document the installation of Python 3.

The version of Python that ships with OS X is great for learning, but it’s notgood for development. The version shipped with OS X may be out of date from theofficial current Python release,which is considered the stable production version.

Doing it Right¶

Let’s install a real version of Python.

Before installing Python, you’ll need to install GCC. GCC can be obtainedby downloading Xcode, the smallerCommand Line Tools (must have anApple account) or the even smaller OSX-GCC-Installerpackage.

Note

If you already have Xcode installed, do not install OSX-GCC-Installer.In combination, the software can cause issues that are difficult todiagnose.

Note

If you perform a fresh install of Xcode, you will also need to add thecommandline tools by running xcode-select--install on the terminal.

While OS X comes with a large number of Unix utilities, those familiar withLinux systems will notice one key component missing: a package manager.Homebrew fills this void.

To install Homebrew, open Terminal oryour favorite OS X terminal emulator and run

The script will explain what changes it will make and prompt you before theinstallation begins.Once you’ve installed Homebrew, insert the Homebrew directory at the topof your PATH environment variable. You can do this by adding the followingline at the bottom of your ~/.profile file

If you have OS X 10.12 (Sierra) or older use this line instead

Best blog apps for windows. C# and Mac Xamarin.Mac allows developers to build fully-native Cocoa applications for Mac OS X with C#. With the release of Xamarin.Mac, it is now possible to build apps in C# for over 2.2 billion devices worldwide: 1.2 billion Windows devices, and using Xamarin, 1 billion,, and devices. Don’t miss our Introduction to Xamarin.Mac seminar, hosted by Miguel de Icaza on January 10th at 9am Pacific. Today we’re proud to announce which makes it possible to use C# to build self-contained Mac OS X apps suitable for publication in the Mac App Store. Xamarin.Mac exposes native platform APIs, making it possible for developers to build sophisticated apps that integrate with platform conventions and leverage the rich spectrum of platform-specific functionality that make Mac apps so beautiful and distinctive.

Now, we can install Python 3:

This will take a minute or two.

Pip¶

Homebrew installs pip pointing to the Homebrew’d Python 3 for you.

Working with Python 3¶

At this point, you have the system Python 2.7 available, potentially theHomebrew version of Python 2 installed, and the Homebrewversion of Python 3 as well.

The 10 Best Games for Mac in 2015 By Sherlock on January 14, 2015 No Comments It is widely perceived that gaming isn’t the Mac’s strongest point, but given its powerful hardware and powerful high definition displays, it would be nonsensical if you won’t put video games into its arsenal. This War of Mine’s Mac requirements are so low, it's one of the best games you can play on a MacBook. ⚠ Fairly Demanding: You'll need a recent Mac. System requirements: OS X 10.7, 2.4 Ghz Intel Core 2 Duo, 2 GB RAM, 1.5 GB HD space, Geforce 9600 GS, Radeon HD4000 with 512 MB of Video Memory. In fact, there are enough quality games on Mac that I could easily rattle out a list with 30 more, but ain’t nobody got time for that. For our money (and yours), these are the best. The 20 Mac games you can't miss from 2015 From lo-fi indies to glossy AAA releases, these are the Mac games to play from this year. Best racing games for mac.

will launch the Homebrew-installed Python 3 interpreter.

Python

will launch the Homebrew-installed Python 2 interpreter (if any).

will launch the Homebrew-installed Python 3 interpreter.

If the Homebrew version of Python 2 is installed then pip2 will point to Python 2.If the Homebrew version of Python 3 is installed then pip will point to Python 3.

The rest of the guide will assume that python references Python 3.

Pipenv & Virtual Environments¶

Install Python 3 On Mac

The next step is to install Pipenv, so you can install dependencies and manage virtual environments.

A Virtual Environment is a tool to keep the dependencies required by different projectsin separate places, by creating virtual Python environments for them. Net nanny. It solves the“Project X depends on version 1.x but, Project Y needs 4.x” dilemma, and keepsyour global site-packages directory clean and manageable.

For example, you can work on a project which requires Django 1.10 while alsomaintaining a project which requires Django 1.8.

Best Python Setup For Mac

So, onward! To the Pipenv & Virtual Environments docs!

This page is a remixed version of another guide,which is available under the same license.