當前位置:首頁 » 編程語言 » macpython36

macpython36

發布時間: 2024-05-28 07:43:18

① macpython榛樿ゅ瓧浣

棰樹富鏄鍚︽兂璇㈤棶鈥渕ac鐨刾ython榛樿ゅ瓧浣撴槸浠涔堚濓紵ArialUnicodeMS銆傛牴鎹鏌ヨpython瀹樼綉寰楃煡錛宮ac鐢佃剳鐢ㄦ埛涓嬭澆python鍚庯紝鏄劇ず鐨勯粯璁ゅ瓧浣撲負python鑷甯︾殑ArialUnicodeMS鑻辨枃瀛椾綋錛屽洜姝mac鐨刾ython榛樿ゅ瓧浣撴槸ArialUnicodeMS錛岀敤鎴峰彲浠ヤ笅杞藉瓧浣撳畨瑁呭寘鎴栬呭湪杞浠朵富欏甸潰淇鏀瑰瓧浣撱侾ython鐢辮嵎鍏版暟瀛﹀拰璁$畻鏈虹戝︾爺絀跺︿細鐨勪簬1990騫翠唬璁捐★紝浣滀負涓闂ㄥ彨鍋欰BC璇璦鐨勬浛浠e搧銆

② macpython3解釋器卸載了為什麼終端還有

重新卸載。
1、刪除Python 3.7 框架。
2、刪除Python 3.7 應用目錄。
3、刪除/usr/local/bin 目錄下指向的Python3.7 的連接。
4、刪除python的環境路徑。
5、刪除Python3.7設置的環境路徑,確認python是否已經刪除。
6、python解釋器其實就是一個可執行文件,該可執行文件的功能是把你寫的python代碼翻譯成機器可執行的機器代碼。

③ python蘋果電腦能用嗎

都可以呀Windows, Linux ,MacBook都可以,沒有誰合適不合適,不過工作中編程用MacBook是最多的.

④ 濡備綍鍦ㄨ嫻鏋滅郴緇熶笂瀹夎匬yQt4

瀹夎匬tQt4鍓嶄綘闇鍑嗗囷細

Xcode 錛10.6.1 鑷甯Xcode錛
Qt - 鎴戜嬌鐢ㄧ殑鏄痲t-mac-cocoa-opensource-4.6.2.dmg
SIP - 鎴戜嬌鐢ㄧ殑鏄痵ip-4.12.1.tar.gz
PyQt4 - 鎴戜嬌鐢ㄧ殑鏄疨yQt-mac-gpl-snapshot-4.8.4.tar.gz
鍒涘緩浜嗕竴涓猵yqt鏂囦歡澶瑰湪紜鐩樻牴鐩褰曚笅錛屽苟灝唖ip-4.12.1.tar.gz鍜孭yQt-mac-gpl-snapshot-4.8.4.tar.gz
鏀懼埌鍏朵腑騫惰В鍘嬨
1銆傚厛瀹夎卶t錛岄粯璁ゅ畨瑁咃紝榪欎竴姝ュぇ閮ㄥ垎浜轟笉浼氭湁闂棰橈紝璺寵繃銆
2銆傛帴涓嬫潵錛屾墦寮緇堢(Terminal錛屽湪 Applications(搴旂敤紼嬪簭)/Utilities(瀹炵敤宸ュ叿)/ 涓)錛屽湪緇堢杈撳叆錛歟xport VERSIONER_PYTHON_PREFER_32_BIT=yes銆
3.
浣跨敤"cd 璺寰"鍛戒護灝嗗綋鍓嶇洰褰曡句負sip-4.12.1錛屽傦細 cd /pyqt/sip-4.12.1/錛 鐒跺悗榪涜岄厤緗(configure)銆怰e-build SIP in 32bit 銆戝湪緇堢涓鎵ц
python configure.py --arch i386
閰嶇疆(configure)瀹屾垚鍚庡氨寮濮嬬紪璇戱紝鍦ㄧ粓絝涓鎵ц屽紩鐢╩ake clean(娓呴櫎浠ュ墠鐨勫畨瑁呬俊鎮)make
緙栬瘧瀹屾垚鍚庡氨瀹夎咃紝鍦ㄧ粓絝涓鎵ц屽紩鐢╯udo make install

鍦ㄨ繖涓榪囩▼涓娌″嚭鐜伴敊璇灝辨槸瀹夎呮垚鍔熶簡

緙栬瘧瀹夎匬yQt4錛岃繃紼嬪拰涓婇潰鐨勪竴鏍楓 銆怋uild PyQt4 in 32bit 銆
鍦ㄧ粓絝涓浣跨敤"cd 璺寰"鍛戒護灝嗗綋鍓嶇洰褰曡句負PyQt-mac-gpl-snapshot-4.8.4錛屽
寮曠敤cd /Users/schi/pyqt/PyQt-mac-gpl-snapshot-4.8.4

鐒跺悗榪涜岄厤緗(configure)錛屽湪緇堢涓鎵ц屽紩鐢╬ython configure.py --use-arch i386
閰嶇疆鏃朵細閬囧埌寮曠敤Determining the layout of your Qt installation...
This is the GPL version of PyQt 4.6 (licensed under the GNU General Public
License) for Python 2.6.2 on darwin.

Type '2' to view the GPL v2 license.
Type '3' to view the GPL v3 license.
Type 'yes' to accept the terms of the license.
Type 'no' to decline the terms of the license.

Do you accept the terms of the license?

杈撳叆yes錛屽啀鎸夊洖杞﹀氨琛

閰嶇疆(configure)瀹屾垚鍚庡氨寮濮嬬紪璇戱紝鍦ㄧ粓絝涓鎵ц
寮曠敤make cleanmake

緙栬瘧姣旇緝鑺辨椂闂達紝璇瘋愬績絳夊緟銆
緙栬瘧瀹屾垚鍚庡氨瀹夎咃紝鍦ㄧ粓絝涓鎵ц
寮曠敤sudo make install

鍦ㄨ繖涓榪囩▼涓娌″嚭鐜伴敊璇灝辨槸瀹夎呮垚鍔熶簡

涔熷彲浠ュ湪IDLE涓瀵煎叆PyQt4鐨勬ā鍧楋紝鑳芥垚鍔熷煎叆灝辮存槑瀹夎呮垚鍔
Python浠g爜
from PyQt4 import QtCore, QtGui
涓嬮潰鍒嗘瀽涓涓嬪畨瑁呰繃紼嬩腑鍙鑳介亣鍒扮殑闂棰橈細
1.闂棰樺備笅
##############
ld: warning: in /Library/Frameworks/Python.framework/Python, missing required architecture x86_64 in file
Undefined symbols:
"_Py_Initialize", referenced from:
PyCustomWidgets::PyCustomWidgets(QObject*)in pluginloader.o
"_PyLong_AsVoidPtr", referenced from:
PyCustomWidgets::PyCustomWidgets(QObject*)in pluginloader.o
"_PyErr_Print", referenced from:
PyCustomWidgets::getMoleAttr(char const*, char const*)in pluginloader.o
PyCustomWidgets::getMoleAttr(char const*, char const*)in pluginloader.o
PyCustomWidgets::PyCustomWidgets(QObject*)in pluginloader.o
PyCustomWidgets::PyCustomWidgets(QObject*)in pluginloader.o
PyCustomWidgets::PyCustomWidgets(QObject*)in pluginloader.o
PyCustomWidgets::PyCustomWidgets(QObject*)in pluginloader.o
"_PyString_FromString", referenced from:
PyCustomWidgets::PyCustomWidgets(QObject*)in pluginloader.o
"_PyType_IsSubtype", referenced from:
PyCustomWidgets::PyCustomWidgets(QObject*)in pluginloader.o
"_PyMole_GetDict", referenced from:
PyCustomWidgets::PyCustomWidgets(QObject*)in pluginloader.o
"_PyObject_CallObject", referenced from:
PyCustomWidgets::PyCustomWidgets(QObject*)in pluginloader.o
"_PyObject_CallFunctionObjArgs", referenced from:
PyCustomWidgets::PyCustomWidgets(QObject*)in pluginloader.o
"_PyList_Append", referenced from:
PyCustomWidgets::PyCustomWidgets(QObject*)in pluginloader.o
"_Py_IsInitialized", referenced from:
PyCustomWidgets::PyCustomWidgets(QObject*)in pluginloader.o
"_PyDict_Next", referenced from:
PyCustomWidgets::PyCustomWidgets(QObject*)in pluginloader.o
"_PyImport_ImportMole", referenced from:
PyCustomWidgets::getMoleAttr(char const*, char const*)in pluginloader.o
PyCustomWidgets::PyCustomWidgets(QObject*)in pluginloader.o
"_PyObject_GetAttrString", referenced from:
PyCustomWidgets::getMoleAttr(char const*, char const*)in pluginloader.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[1]: *** [libpythonplugin.dylib] Error 1
make: *** [all] Error 2
榪欎釜闂棰樼殑鍘熷洜灝辨槸錛歲t鏄鍦32浣峬ac涓婄紪璇戠殑錛屼絾pyqt榛樿ゆ槸鍦64浣嶆満瀛愪笂緙栬瘧鐨勶紝鎵浠ユ垜浠鍦ㄧ紪璇戠殑鏃跺欒佸埗瀹氱紪璇戠幆澧冿細鏄痠386 榪樻槸x86_64.
璇峰弬鑰冨備笅鐨勪俊鎮錛
The problem is that the Qt library is 32bit while, by default, python builds PyQt4 in 64bit. That caused problem when it tried to link 64bit object files with 32bit Qt library. To fix this issue, we need to force python to build PyQt4 in 32bit, and we also need to re-build SIP in 32bit mode. If you use the python version that comes with Mac OS (2.5 for Snow Leopard), make sure that it runs in 32bit mode by issuing the command

2.涓闂棰樺備笅錛

>>> from PyQt4 import QtGui
Traceback (most recent call last):
File "<stdin>", line 1, in <mole>
ImportError: dlopen(/Library/Python/2.6/site-packages/PyQt4/QtGui.so, 2): Symbol not found: __
Referenced from: /Library/Python/2.6/site-packages/PyQt4/QtGui.so
Expected in: flat namespace
in /Library/Python/2.6/site-packages/PyQt4/QtGui.so

榪欎釜闂棰樻槸鎵鏈夌殑鍖呭畨瑁呴兘娌℃湁闂棰樹絾鏄褰撳煎叆QtGui鎴栧叾浠栧寘鏃訛紝鎬繪姤榪欎釜闂棰橈紝榪欎釜闂棰樼殑鍘熷洜鏄錛屽綋鍓峱yqt release鐨勫寘鏈韜甯︾殑涓涓猙ug錛孭yQt-mac-gpl-snapshot-4.8.3錛 鎵浠ヤ綘涓嬭澆涓嬩釜瑕乺elease鐨勫寘灝卞彲浠ヤ簡銆傚傛垜涓嬬殑鏄錛歅yQt-mac-gpl-snapshot-4.8.4銆
涓嬮潰緇欏ぇ瀹朵粙緇嶄竴涓嬫垜鍐欑殑鑷鍔ㄥ畨瑁呰繖浜涚▼搴忕殑python婧愮爜錛
#!/usr/bin/env python
"""
Automated installer for Python 2.6 (final)
This installer is able to handle any previous
versions of Python.
NOTE: This file *must* be copied to
//nssgsvr/tools/pyInstall_OSX when modified!
"""
import os
import sys
import re
import shutil
import platform
import tarfile
# Constants
PYTHON_PKGS = {"dmgFile" : "python-2.6.1-macosx2008-12-06.dmg",
"mpkgList": ["MacPython.mpkg"] }
#WXPYTHON_PKGS = {"dmgFile" : "wxPython2.8-osx-unicode-2.8.9.2-universal-py2.6.dmg",
# "mpkgList": ["wxPython2.8-osx-unicode-universal-py2.6.pkg"] }
#ANGELIA
XCODE_PKGS = {"dmgFile" : None, "mpkgList": ["Xcode.mpkg"]}
QT_PKGS = {"dmgFile" : "qt-mac-cocoa-opensource-4.6.2.dmg",
"mpkgList": ["Qt.mpkg"] }
THIRD_PARTY_INSTALL = ["sip-4.12.1", "PyQt-mac-gpl-snapshot-4.8.4","Pyro-3.9.1", "pyserial-2.4"]
# Environment constants
TCSH_ENV_FILE = '/etc/csh.login'
BASH_ENV_FILE = '/etc/profile'
SCRIPTS_ROOT_ENV = "TEST_SCRIPTS_ROOT"
TARGET_VER = "2.6"
IS_POSIX = (os.name == 'posix')
IS_MAC = (sys.version.find('Apple') != -1)
IS_OSX = (IS_MAC and IS_POSIX)
IS_OSX_LEOPARD = (IS_OSX and platform.mac_ver()[0].startswith('10.5'))
IS_OSX_SNOWLEOPARD = (IS_OSX and platform.mac_ver()[0].startswith('10.6'))
# NSSGSVR Constants
MOUNT_POINT = "/Volumes/Test"
HOSTSERVER = "NSSGSVR.global.avidww.com" # Server that contains SQA scripts
SHARE = "TEST" # NSSGSVR share that contains the Python scripts directory
USER = "qatest"
PASSWD = "Cmqat/$/$/$" # slashes needed to escape special character '$'

⑤ m1macpython如何調用多核

1、纖穗首先多進程是在各自單獨的進程內慧腔存管理下運行代碼,而多線程是共享一個進程內存。
2、其次首先打開m1macpython,點擊主界面。
3、最後在主菜單點擊調用多核即可毀碧卜。

⑥ python os模塊怎麼使用

常用方法:

1. os.name——判斷現在正在實用的平台,Windows 返回 『nt'; Linux 返回』posix'。

2. os.getcwd()——得到當前工作的目錄。

3. os.listdir()——指定所有目錄下所有的文件和目錄名。

例:

⑦ 如何在anaconda運行python2和python3 mac

打開terminal,輸入
conda create --name python36 python=3.61

目的是創建一個新的Python 3.6的環境。然後,終端會請求安裝新的包到目錄/Applications/anaconda/envs/python36下,按y同意請求(Anaconda之前選擇裝在了應用程序下,其實Python 3的包就單獨裝在.../envs/下)。

激活Python 3.6
激活新建的Python 3.6環境,輸入
source activate python361

激活後,會發現terminal輸入的地方多了python36的字樣, 再輸入
python --version1

可以看到系統已經成功切換到了Python 3.6的環境。

⑧ 怎麼在mac 系統上使用Python怎麼安裝Anaconda

1. 首先安裝python,我選擇安裝Anaconda (Windows 64-Bit Python 2.7 Graphical Installer 下載地址)。
Anaconda的一些命令(在Anaconda的命令行窗口輸入):
conda list #該命令,將列出Anaconda安裝的所有應用包,我們可以看到Anaconda已經安裝了numpy, nose, pip, python, scipy, mingw等等。
conda install <pkg name> #該命令用於安裝應用包,如 conda install numpy.
pip install <pkg name> #該命令用於安裝應用包,如 pip install theano.
conda update <pkg name> #升級應用包,如 conda update python
2. 安裝Theano,在Anaconda 的命令窗口中輸入 pip install theano,可以看到程序開始下載安裝包,並檢查是否滿足安裝條件:numpy>=1.5.0,scipy>=0.7.2,滿足條件之後開始運行setup.py安裝theano,安裝完成後會顯示Successfully installed theano。
3. 測試Theano安裝情況。
(1)在ipython中輸入以下兩行代碼:
import theano
theano.test()
會顯示theano的版本號,安裝位置,已經其他包的安裝版本,如numpy,nose,python等。
在運行中出現g++不是內部或外部命令,也不是可運行的程序或批處理文件。
(2)在Anaconda的命令行窗口輸入:python Lib\site-packages\theano\tests\run_tests_in_batch.py
顯示unable to find theano-nose,查看run_tests_in_batch.py發現,其中路徑設置為在bin下尋找theano-nose文件,而實際上Anaconda文件夾下根本沒有bin這個文件夾,theano-nose存放在Scripts文件夾中。
》》》嘗試1:將Scripts更名為bin,重新運行這句命令,可以成功運行。但是出現一個warning,提示沒有檢測到g++,所以無法運行優化後的C代碼版本,只能執行python版本。
該種嘗試的結果是,下次打開Anaconda 命令窗口後出現錯誤,因為其運行路徑為Scripts,所以還是不要修改了。
(3)g++問題。我們打開MinGW文件夾,可以很清楚的看到有g++,但是為什麼使用不了呢??在Anaconda 命令窗口中輸入g++也能成功調用g++.exe啊。所以結論是,鑒於這個代碼中出現很明顯的漏洞,所以說不定這里也是錯誤,先不管這些了。
試著做了以下配置,也不知行不行。
添加環境變數: path: C:\Anaconda\MinGW\bin;C:\Anaconda\MinGW\x86_64-w64-mingw32\lib;
新建環境變數: PYTHONPATH: C:\Anaconda\Lib\site-packages\theano;
在home目錄下(cmd可以看到,我的是C:\Users\Administrator),創建 .theanorc.txt 文件內容如下:
[global]
openmp=False
[blas]
ldflags=
[gcc]
cxxflags = -IC:\MinGW\include
(4)驗證BLAS是否安裝成功。由於numpy是依賴BLAS的,如果BLAS沒有安裝成功,雖然numpy亦可以安裝,但是無法使用BLAS的加速。驗證numpy是否真的成功依賴BLAS編譯,用以下代碼試驗:
>>> import numpy
>>> id(numpy.dot) == id(numpy.core.multiarray.dot)
False
結果為False表示成功依賴了BLAS加速,如果是Ture則表示用的是python自己的實現並沒有加速。

⑨ mac 下怎麼安裝python 搭建開發環境

一. 安裝python
mac系統其實自帶了一個python的執行執行環境,用來運行python還行,但是開發可能就不夠了,因此我們需要重新安裝python。這里有兩種方案安裝:
1.homebrew
brew install python

這個方案比較簡單,如果出錯的話可以給前面加sudo試試,這個安裝的python可能不是最新版.
2.從官網下載安裝
大家可以從https://www.python.org/download下載安裝最新版的python,安裝比較無腦,一路按下去就OK,缺點是以後升級,卸載都得自己維護.
這兩個方法安裝的python的位置是不一樣的,大家可以用:
which python

來查看安裝位置.安裝完成後在終端中鍵入python來驗證安裝是否成功.
二. 安裝pip
這里好多文章中說要先安裝easy_install, 其實是不用的.
1.我們先獲取pip安裝腳本:
wget https://bootstrap.pypa.io/get-pip.py

如果沒有安裝wget可以去這里將所有內容復制下來,新建get-pip.py文件,將內容拷進去就OK了.
2.安裝pip
sudo python get-pip.py

用python執行剛才獲取的腳本,這里sudo可以選擇使用,若遇到類似這個報錯則必須加sudo:
Exception:
Traceback (most recent call last):
...
OSError: [Errno 13] Permission denied: 'XXX/pip-0.7.2-py2.7.egg/EGG-INFO/dependency_links.txt'
Storing debug log for failure in /Users/bilt/.pip/pip.log

安裝成功後可以在終端中鍵入pip來檢測,如果不行重啟終端後嘗試.
3.修改pip源
在天朝,由於功夫網的原因,使用pip安裝一些模塊會特別慢甚至無法下載,因此我們需要修改pip的源到國內的一些鏡像地址,特別感謝國內無私奉獻的組織~
首先進入HOME路徑:
cd ~

創建.pip目錄:
mkdir .pip

創建pip.conf文件:
touch pip.conf

大家可以用自己喜歡的編輯器打開pip.conf文件,我現在使用的時v2ex的源,所以添加:
[global]
index-url = http://pypi.v2ex.com/simple

大家可以把index-url的值設置為自己實際源的地址.
至此pip源修改成功,以後使用pip安裝模塊時都會從這個源去下載安裝,大家可以自行測試一下.
三. 其他模塊安裝
1.Pillow/PIL
想用python處理圖片,自然少不了PIL這個模塊, 由於PIL長期沒有更新了, 所以有了Pillow這個模塊, 依賴於PIL, 新版的pip安裝後會自帶Pillow, 但是好像沒有zlib模塊, 所以會報錯:
File "/Library/Python/2.7/site-packages/PIL/Image.py", line 1105, in paste
im.load()
File "/Library/Python/2.7/site-packages/PIL/ImageFile.py", line 190, in load
d = Image._getdecoder(self.mode, d, a, self.decoderconfig)
File "/Library/Python/2.7/site-packages/PIL/Image.py", line 389, in _getdecoder
raise IOError("decoder %s not available" % decoder_name)
IOError: decoder zip not available

因此我們需要手動重新安裝:
sudo pip install -U Pillow

2.Mysqldb
在下面的網址下載mysqldb模塊:
http://sourceforge.net/projects/mysql-python/
在mac os x直接雙擊解壓,命令行進入解壓後的目錄, 執行python setup.py build
如果有
sh: mysql_config: command not found

提示,我們需要編輯下mysql的路徑,使用vim打開setup_posix.py
找到:
mysql_config.path = "mysql_config"

改為:
mysql_config.path = "/usr/local/mysql/bin/mysql_config"

然後執行:
sudo python setup.py install

安裝成功後,在命令行輸入python進入python環境,輸入import MySQLdb,我的環境中報下面的錯誤:

>>> import MySQLdb
Traceback (most recent call last):
File "<stdin>", line 1, in <mole>
File "MySQLdb/__init__.py", line 19, in </mole><mole>
import _mysql
ImportError: dlopen(/Library/Python/2.7/site-packages/MySQL_python-1.2.4b4-py2.7-macosx-10.8-intel.egg/_mysql.so, 2): Library not loaded: libmysqlclient.18.dylib
Referenced from: /Library/Python/2.7/site-packages/MySQL_python-1.2.4b4-py2.7-macosx-10.8-intel.egg/_mysql.so
Reason: image not found

解決方法,我們建立一個軟鏈就可以了
sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib

這樣我們就在mac os x的python環境下安裝好了MySQLdb模塊

熱點內容
數據模型於資料庫系統 發布:2024-07-27 09:59:56 瀏覽:849
網站ip訪問量 發布:2024-07-27 09:59:55 瀏覽:286
java字元串字元數組 發布:2024-07-27 09:59:13 瀏覽:593
如何利用無線網路搭建伺服器 發布:2024-07-27 09:59:05 瀏覽:721
it天空解壓密碼 發布:2024-07-27 09:50:39 瀏覽:549
軟體腳本買賣 發布:2024-07-27 09:50:38 瀏覽:917
android對象轉json 發布:2024-07-27 09:50:15 瀏覽:183
安卓平板有什麼可以畫對稱的 發布:2024-07-27 09:36:03 瀏覽:133
羊創意腳本 發布:2024-07-27 09:29:30 瀏覽:895
榮耀v20升級存儲 發布:2024-07-27 09:20:19 瀏覽:486