1、在finder的偏好设置
中选择边栏
选中个人收藏下房子的图标
,然后在边栏就可以看到用户目录,然后就可以找到目录了。
2、在finder的偏好设置
中选择通用
,然后选择磁盘
,磁盘就出现在桌面了,这样也可以很方便的进入根目录
,进而找到用户目录;
3、桌面目录
下,菜单前往
-个人
也可以进入用户目录
jupyter notebook
jupyter notebook
这个问题多出现于mac用户,因为mac有一个系统自带的python,成功安装的第三方包都被安装到了系统自带的python里。因此需要确保我们使用的是conda自己的pip,即需要指定pip的路径名,比如我的pip路径名在:/Users/datalab/anaconda/bin/pip,那么在terminal里输入:
/Users/datalab/anaconda/bin/pip install package_name
pip install package_name
conda install package_name
打开terminal,输入: conda list
conda remove tornado
pip install -U graphlab-create
添加清华镜像
https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/
conda config --add channels https://mirrors.sjtug.sjtu.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.sjtug.sjtu.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.sjtug.sjtu.edu.cn/anaconda/cloud/conda-forge/
conda config --set show_channel_urls yes
conda config --set show_channel_urls yes
如果命令行方法添加不上,可以在用户目录下的.condarc
中添加https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/%EF%BC%9A
如果没有该文件可以直接创建,Windows为C://Users/username/.condarc
,Linux/Mac为~/.condarc
https://conda.io/docs/user-guide/tasks/manage-python.html
Creating a new environment and install the second Python version into it. To create the new environment for Python 2.7, in your Terminal window or an Anaconda Prompt, run:
conda create -n py27 python=2.7 anaconda=4.0.0
source activate py27
activate py27
退出环境: source deactivate py27
也可以使用 activate root
切回root环境
python --version
source activate py27
jupyter notebook
source deactivate py27
运行以下代码
import graphlab as gl
from IPython.display import display
from IPython.display import Image
gl.canvas.set_target('ipynb')
A newer version of GraphLab Create (v1.9) is available! Your current version is v1.8.5. You can use pip to upgrade the graphlab-create package. For more information see https://dato.com/products/create/upgrade.
conda remove package_name
原因:matplotlib默认字体并不是中文字体。
解决方法:将某中文字体设为默认首选字体,本文拟将默认字体设为微软雅黑。
环境:windows
过程:
在python的安装目录中找到配置文件:%Python_Home%\Lib\site-packages\matplotlib\mpl-data\matplotlibrc,用任意文本编辑器打开。(最好先备份一下)
找到第139行:#font.family, 将其注释去掉,冒号后面的值改为Microsoft YaHei
找到第151行:#font.sans-serif, 将其注释去掉,并将Microsoft YaHei添加到冒号后面的最前面,注意还要再加一个英文逗号(,)
为保险其间,到C:\Windows\Fonts\中找到微软雅黑对应的字体文件msyh.ttf,将其复制到D:\Python32\Lib\site-packages\matplotlib\mpl-data\fonts\ttf\目录下
原因:matplotlib默认字体并不是中文字体。
解决方法:将某中文字体设为默认首选字体,本文拟将默认字体设为微软雅黑。
环境:Mac
过程:
下载微软雅黑对应的字体文件msyh.ttf,双击并安装msyh.ttf。
在python的安装目录中找到配置文件:%Python_Home%\Lib\site-packages\matplotlib\mpl-data\matplotlibrc,用任意文本编辑器打开。(最好先备份一下) > Users/datalab/Applications/anaconda/lib/python3.5/site-packages/matplotlib/mpl-data/
为保险期间,可以将msyh.ttf复制到%Python_Home%\Lib\site-packages\matplotlib\mpl-data\fonts\ttf\目录下
%matplotlib inline
import matplotlib.pyplot as plt
plt.plot(2, 2)
plt.text(2, 2, '汉字', fontsize = 300)
plt.show()
http://jupyter-contrib-nbextensions.readthedocs.io/en/latest/
https://github.com/ipython-contrib/jupyter_contrib_nbextensions
http://localhost:8888/nbextensions
A jupyter notebook serverextension providing config interfaces for nbextensions.
https://github.com/Jupyter-contrib/jupyter_nbextensions_configurator
前者是各类型有用的插件,后者是能够直接在Jupyter 上图形话调节界面的功能。
a、安装pandoc
https://github.com/jgm/pandoc/releases/tag/1.19.2.1
b、安装MiKTeX
c、安装 GNU make for windows
http://gnuwin32.sourceforge.net/packages/make.htm
d、把上面安装好的软件路径,全部添加到环境变量里面
e、PDF支持中文
C:\Python27\Lib\site-packages\nbconvert\templates\latex\article.tplx
把 \documentclass[11pt]{article} 修改为 \documentclass[11pt]{ctexart} 即可!!!
Pandoc 支持中文
pandoc infile.md -o outfile.pdf --latex-engine=xelatex -V mainfont="SimSun"