If you are using a newer version of your Mac system and keep it up to date, you should already have Python 3 installed. To check whether it has been installed, you can enter: python V (note the uppercase V) in the terminal. If the version is 3.X, it means that Python 3 is already installed in the system, and you don't need to install it yourself. If not, you can follow Install this again
http://blog.csdn.net/oabcde12/article/details/78934253I have installed python2 . To upgrade to python3, I need to input in the terminal: brew upgrade python
After installing 3.0 , the terminal gives the switching instruction:
Ifyou need Homebrew's Python 2, `brew install python@2`.
Note: If Python 2 already exists on the system, /usr/bin/python will not change, and Python 3 will exist in the form of python3. Similarly, the IDLE of Python3 will exist in the form of idle3.
Execute a Python statement
Terminal input: python3 pack.py
Here are the problems I encountered and how to fix them:
Question 1: Execute the re-signature instruction, the re-signature fails ==> iPhone Developer: xxx (xxx): ambiguous (matches "iPhoneDeveloper: xxx)
Solution: Reason: There are two identical certificates in the keychain, delete one,
Reference http://blog.csdn.net/skylin19840101/article/details/60764079
Question 2: **EXPORT FAILED**
The package is successful, but the export is wrong: because the push requires a description file, and the description file automatically generated by Xcode cannot be used with this package, it needs to be created in the developer account, downloaded and installed in Xcode, and then modified in the exported plist: DistributionSummary .plist and ExportOptions.plist are the ones generated after Xcode is packaged and can be used directly. If the description file is automatically created, you need to add the provisioningProfiles dictionary in ExportOptions.plis, and add key-value pairs in the dictionary, where key and The same value as the bundleid is the same as the name of the description file.
问题3:IndentationError: expected an indented block
Solution: Explain that indentation is required here, you only need to press the space or Tab (but not mixed) key to indent on the line where the error occurs .
Note: In Python, the next line with a colon is often indented, and the indentation is indented
问题4:ModuleNotFoundError: No module named 'xlrd'
Solution: The error is because Excel needs a separate module support, so you need to install the xlrd module,
Python3 can enter in the command prompt: pip3 install xlrd
Python2 direct input: pip install xlrd
问题5:ModuleNotFoundError: No module named 'tkMessageBox'
Solution: http://blog.csdn.net/jim7424994/article/details/40929939
It is very likely that the code found is python2.x, but it is run in the environment of python3.x. In fact, the above Tkinter library is tkinter in python3, but the first letter is lowercase, but the import statement is case sensitive!
Change import tkMessageBox to from tkinter import messagebox #corresponding to messagebox.py under the tkinter folder
Then it can be written as messagebox.showinfo( "title" , "hello world" )
问题6:NameError: name 'xrang' is not defined
Solution: Change the code for i in xrang(0, lines): to for i in rang(0, lines):;
Question 7: Problems with creating a graphical interface: SyntaxError: invalid syntax
Solution: root= tk.Tk()
问题8:ModuleNotFoundError: No module named'tkFileDialog'
Introduce importtkinter as tk at the top
问题9:NameError:name 'Entry' is not defined
Solution: Add tk. in front of Entry, and use tk.Entry to create it when creating
问题10:NameError: name 'StringVar' is notdefined
Solution: Introduce tkinter at the top ie, from tkinter import *
问题11:AttributeError: module 'os' has noattribute 'startfile'
Solution: http://blog.csdn.net/bmw601055/article/details/77619271
On Windows systems , Python3.X has an os.startfile function that simulates double-clicking a file
This operation is not supported on non- Windows systems , but uses the open command implemented in the OS X command line to achieve a similar effect
#Win32 import them os.startfile(filename) # OS X import subprocess subprocess.call(["open", filename])
The latter implements the execution of the open <filename> command. The list object will be separated by spaces to form the command that is finally passed to the Shell . For more detailed control, please refer to man open
问题12:SyntaxError: invalid syntax
Solution: terminal input: sudo easy_install biplist install the plist library under python --biplist
问题13:AttributeError: module 'os' has noattribute 'quit'
Solution: Exit of the python interactive interface
import sys
sys.exit()
问题14:error: exportArchive: "XXXX.app" requires aprovisioning profile with the Push Notifications and App Groups features.
Solution: Change to the BundleID and Team of the enterprise version on Xcode and then package it.
问题15:ModuleNotFoundError:No module named 'cv2'
Solved: Terminal input: pip install opencv instead of looking for cv2 in terminal