markdownmac10.14(mojave)上的python3.7设置(代码片段)

author author     2022-12-13     153

关键词:

1) Install Python 3.7.x from <https://www.python.org/downloads/> or via [homebrew](http://brew.sh/). 
```
$ brew install python3   # Installed at /usr/local/Cellar/python3
```
Check that python3 has been installed by running it at the terminal:
```
$ python3
>>> Python 3.7.2
```
2) Download `get-pip.py` from <https://bootstrap.pypa.io/get-pip.py> and install (this should already be installed if python was installed from python.org or homebrew):
```sh
$ curl -O https://bootstrap.pypa.io/get-pip.py
$ sudo python3 get-pip.py
```
3) Install virtualenv and [virtualenvwrapper](http://virtualenvwrapper.readthedocs.io/en/latest/install.html)
```sh
$ sudo -H pip3 install virtualenv
$ sudo -H pip3 install virtualenvwrapper --ignore-installed six
```
4) Add the following to your `~/.bash_profile` to load virtualenvwrapper then run `bash -l`
```sh
# Location of python virtual environments
export WORKON_HOME=$HOME/.virtualenvs

if [ -e /usr/local/bin/virtualenvwrapper.sh ]; then
  source /usr/local/bin/virtualenvwrapper.sh
fi
```
5) Create your virtual enviornment named `py3`
```sh
$ mkvirtualenv --python=`which python3` py3
```
/*
* To install all modules: pip3 install -r requirements.txt
*/

bokeh
Flask
ipython
jupyter
keras
matplotlib
nose
numpy
pandas
Pillow
pymc
requests
scikit-image
scikit-learn
scipy
seaborn
statsmodel
tensorflow
Installing [opencv](http://opencv.org) with python3.7
```sh
$ brew update
$ brew install opencv@3 --with-python3   # Add --with-contrib if you want the contrib modules
$ ln -s /usr/local/Cellar/opencv/3.4.5/lib/python3.7/site-packages/cv2/python-3.7/cv2.cpython-37m-darwin.so /usr/local/lib/python3.7/site-packages/cv2.so
```

You may have to export `PYTHONPATH`:
```sh
export PYTHONPATH=$PYTHONPATH:/usr/local/Cellar/opencv/3.4.5/lib/python3.7/site-packages
```

If you installed a previous version of opencv and no longer need it, remove it:
```
brew cleanup opencv
```

Test:
```
$ python3
In[1]: import cv2
In[2]: cv2.__version__
Out[2]: '3.4.5'
```
Install these modules from Github as their py3 support is currently not published on PyPI.
Their master branch works with Python3.7

Set your locale in an environment variable in `~/.bash_profile`
```sh
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
```
Type `bash -l` in your terimal to run the updated bash_profile.   
Now, install the modules:

```sh
$ pip3 install git+git://github.com/cython/cython@master
$ pip3 install git+git://github.com/statsmodels/statsmodels
$ pip3 install git+git://github.com/pymc-devs/pymc3
```
```sh
$ brew install llvm
$ brew link llvm --force
$ pip3 install numba
```

Test code from [numba](http://numba.pydata.org)

无法在 macOS Mojave 10.14 中安装 Spring Roo 2

】无法在macOSMojave10.14中安装SpringRoo2【英文标题】:ImpossibletoinstallSpringRoo2inmacOSMojave10.14【发布时间】:2019-06-1504:34:59【问题描述】:我试图在STSIDE中的macOSMojave10.14(Java11)中安装SpringRoo2.0.0.RELEASE,但没有成功。在STS(3.9.7.RELEASE)中... 查看详情

CoreAudio Input Render 回调从外部音频接口 Mac OS 10.14 Mojave 渲染所有 0

】CoreAudioInputRender回调从外部音频接口MacOS10.14Mojave渲染所有0【英文标题】:CoreAudioInputRendercallbackrendersall0\'sfromexternalaudiointerfaceMacOS10.14Mojave【发布时间】:2018-12-1716:04:48【问题描述】:当我的Mac在10.11上时,我正在处理一个CoreAu... 查看详情

macOS Mojave (10.14) 到 Lion (10.7) 上的 JAVA_HOME 在哪里?

】macOSMojave(10.14)到Lion(10.7)上的JAVA_HOME在哪里?【英文标题】:WhereisJAVA_HOMEonmacOSMojave(10.14)toLion(10.7)?【发布时间】:2011-09-2902:59:57【问题描述】:Java是最新版本macOS上的可选包。然而,一旦安装,它似乎JAVA_HOME环境变量未正确设... 查看详情

macos10.14mojave无法打开和预览jpg的解决方法

分析:之所以会出现这样的问题。是因为你用了独显而没有驱动核显导致的。想要预览正常只要用核显或者开启核显加速就OK了就可以正常预览了。解决办法:换无核显的机型试试,比如MacPro6.1,iMacPro或者iMac13.2(这个是有核显... 查看详情

节点应用程序无法在 mojave 上运行:ReferenceError: internalBinding 未定义

...但该应用程序在HighSierra和Windows10上运行良好,但在Mojave10.14 查看详情

Mac OS X Mojave 上的 XAMPP 错误

...121:07:58【问题描述】:我正在运行带有XAMPP7.2.5的MacOSMojave10.14今天早些时候,我尝试在崩溃/重新启动后启动XAMPP。XAMPPManager无法启动MYSQLServer。Apache确实启动了。发现可能存在损坏,我使用TimeMachine将我的XAMPP文件 查看详情

如何在 macOS 10.14 上检测暗模式?

】如何在macOS10.14上检测暗模式?【英文标题】:HowcandarkmodebedetectedonmacOS10.14?【发布时间】:2019-01-1107:37:20【问题描述】:在macOS10.14中,用户可以选择采用系统范围的浅色或深色外观,我需要根据当前模式手动调整一些颜色。【... 查看详情

如何在 mac os 10.14 上安装 vcremote?

】如何在macos10.14上安装vcremote?【英文标题】:Howtoinstallvcremoteonmacos10.14?【发布时间】:2018-12-2900:34:47【问题描述】:我已在MacOSMojave10.14上进行了更新,并想在其上安装vcremote。我运行的命令是sudonpminstall-g--unsafe-permvcremote取自ht... 查看详情

麻烦在 MacOS Mojave 上安装 pymssql

】麻烦在MacOSMojave上安装pymssql【英文标题】:TroublinginstallingpymssqlonMacOSMojave【发布时间】:2018-11-0613:06:02【问题描述】:我已将我的MAC操作系统更新到最新版本(Mojave),并安装了最新版本的XCode(10.1)。然后我安装了freetds,并使用p... 查看详情

无法在 Mojave 上安装 XCode

】无法在Mojave上安装XCode【英文标题】:CannotinstallXCodeonMojave【发布时间】:2020-07-1716:16:13【问题描述】:我正在运行MacOS10.14.6,并希望将XCode安装到/Applications文件夹中。尝试使用Appstore下载它,我收到错误消息“无法安装Xcode,... 查看详情

如何在 macOS 10.14.4 Mojave 上使用 fink

】如何在macOS10.14.4Mojave上使用fink【英文标题】:HowtousefinkonmacOS10.14.4Mojave【发布时间】:2019-05-1215:51:51【问题描述】:我的macos是Mojave,10.14.4,Xcode已经全面更新。我今天早上完成了任务。另外,我通过AppStore下载Xcode后,弹出一... 查看详情

如何在 OSX Mojave 上安装 MySQL 5.6?

】如何在OSXMojave上安装MySQL5.6?【英文标题】:HowtoinstallMySQL5.6onOSXMojave?【发布时间】:2019-07-2222:45:19【问题描述】:我需要在我的Mac上安装MySQL5.6,在Mojave下运行。(因为AWSAuroraServerless只允许MySQL5.6)如果.dmg可用,那将不是问... 查看详情

OpenGL Glut显示功能在Mojave上显示黑屏[关闭]

】OpenGLGlut显示功能在Mojave上显示黑屏[关闭]【英文标题】:OpenGLGlutdisplayfunctionshowingablackscreenonMojave[closed]【发布时间】:2018-09-2921:36:36【问题描述】:我正在尝试在OpenGlut上为我的课堂作业运行一个非常简单的示例,但由于某种... 查看详情

markdownmac命令(代码片段)

查看详情

markdownmac包(代码片段)

查看详情

markdownmac设置(代码片段)

查看详情

无论我尝试啥,GDB 都无法在我的 Mac (Mojave) 上运行。常见错误,但我没有找到解决方案

】无论我尝试啥,GDB都无法在我的Mac(Mojave)上运行。常见错误,但我没有找到解决方案【英文标题】:NomatterwhatItried,GDBjustwon\'tworkonmyMac(Mojave).CommonerrorbutI\'vefoundnosolutions无论我尝试什么,GDB都无法在我的Mac(Mojave)上运行。常见错... 查看详情

无法在 mac os x mojave 上安装 mysqlclient

】无法在macosxmojave上安装mysqlclient【英文标题】:can\'tinstallmysqlclientonmacosxmojave【发布时间】:2019-04-0606:11:14【问题描述】:我正在尝试在macosxmojave上安装mysqlclient:sudopip3installmysqlclient我收到以下错误:clang-Wno-unused-result-Wsign-comp... 查看详情