1、安装wordcloud失败,提示依赖找不到
ERROR: Could not find a version that satisfies the requirement numpy>=1.6.1 (from wordcloud) (from versions: none)
ERROR: No matching distribution found for numpy>=1.6.1 (from wordcloud)
据说是网络问题,需要切换数据源
pip install wordcloud -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
这样就OK了
2、如上操作之后出现了新的问题
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8 -c wordcloud/query_integral_image.c -o build/temp.macosx-10.9-x86_64-3.8/wordcloud/query_integral_image.o
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
error: command 'gcc' failed with exit status
据说是卸载重装xcode之后导致的,重新安装就好了
xcode-select –install
3、附上wordcloud地址: https://github.com/amueller/word_cloud
4、使用wordcloud时如果传入的字符串是中文,则会出现生成的图片上没有文字的问题,原来是wordcloud默认的font-path不支持中文,解决办法,加上字体
wc=wordcloud.WordCloud(width=1000, height=800, background_color="white", font_path="/System/Library/fonts/PingFang.ttc")
5、在anaconda下安装tensorflow失败的原因
安装了最新版本的anaconda(2019-10版本),然后安装tensorflow(conda install tensorflow),总是提示版本冲突,源使用的是清华源(https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/)于是卸载了python3.8,改为3.6,结果还是不好使,然后去源站上看了下tensorflow的版本还是1.0版本,然鹅tensorflow的最新版已经是2.0了,并且2.0版本已经支持3.7了,原来是源的问题,于是看到还有一个源站(https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/),尝试了下把源站更新之后在anaconda的Environments界面点下“update index”,然后完美解决问题
显示anaconda所有环境 conda info -e
切换anaconda环境 conda activate xxxx
5.1、 anaconda 不好使的处理办法
anaconda 有些时候显示的一些软件版本不够实时,怎么更换源,update index都没用,比如最近显示的tensorflow的版本就又变成了1.9,怎么都更新不到2.1上面去。
#激活相应的环境
conda activate xxxx
# 使用pip安装
pip install tensorflow
pip install numpy
# 如若不确定安装位置,则使用如下指令可以看到软件的安装位置
pip show tensorflow
#不启动anaconda navigator启动jupyter的方法,不过还没测试
/Users/zhangfei/opt/anaconda3/envs/python37/bin/jupyter_mac.command ; exit;
6、国内的pip源
阿里云 http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣 http://pypi.douban.com/simple/
中国科学院 http://pypi.mirrors.opencas.cn/simple/
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/