mac机器学习开发环境部署及helloworld

为什么80%的码农都做不了架构师?>>>   hot3.png

一、下载并安装Anaconda2.7

https://repo.anaconda.com/archive/Anaconda2-5.2.0-MacOSX-x86_64.pkg

路径:/Users/shijun/anaconda2

二、运行Anaconda Navigator -> Environments -> base(root) -> 点击三角图标 -> Open Terminal

遇到问题:/Users/.anaconda/navigator/a.tool: line 1: activate: No such file or directory

解决问题:指定ANACONDA_HOME路径

export IPFS_HOME=/Users/shijun/Desktop/openSourceProject/go-ipfs

export SONAR_HOME=/Users/shijun/Desktop/openSourceProject/sonarqube-7.1

export ANACONDA_HOME=/Users/shijun/anaconda2

export PATH=$PATH:$IPFS_HOME:$SONAR_HOME:$ANACONDA_HOME/bin

三、激活tensorflow

接着第二步后面执行conda create -n tensorflow python=2.7

激活tensorflow命令:source activate tensorflow

关闭tensorflow命令:(tensorflow)$ source deactivate

四、使用pip安装TensorFlow

pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.11.0rc0-py2-none-any.whl

五、测试python代码

$ python

>>> import tensorflow as tf

>>> print(tf.__version__)

# 0.11.0rc0

六、下载pycharm

https://www.jetbrains.com/pycharm/download/#section=mac

七、注意事项

1、如果报错找不到main,因为Run/Debug Configurations中的配置, Script path必须指定文件,比如/Users/shijun/Desktop/PycharmProjects/untitled2/helloworld.py

2、找不到CAL.PyCAL的问题

# -*- coding:utf8 -*-

from CAL.PyCAL import *

报错:ImportError: No module named CAL.PyCAL

$ sudo pip install CAL后依然报错,使用$ pip list能够找到CAL

查找CAL路径

$ pip show CAL

Name: CAL

Version: 2.2.6

Summary: Package dealing with date, time, and calendars.

Home-page: https://github.com/Tapyr/tapyr

Author: Christian Tanzer

Author-email: [email protected]

License: BSD License

Location: /Users/shijun/anaconda2/lib/python2.7/site-packages

Requires: python-dateutil, TFL

Required-by: 

转载于:https://my.oschina.net/duojin/blog/1832972

你可能感兴趣的:(mac机器学习开发环境部署及helloworld)