装完环境有一阵了,现在回忆起来还是很崩溃(。
我知道theano已经凉了……
dlatk:Differential Language Analysis ToolKit,是一个端到端的人类文本分析软件包,简单理解就是做人工智能中的文本分析、对话系统时能用到的东西。
https://dlatk.wwbp.org/index.html
首先装了pycharm + python 3.5, 之后下dlatk时:
1.错误
pip install dlatk
原因:pip版本不足
解决方法:pip install --upgrade pip
2.错误
time out
解决方法:pip install --default-timeout=1000 dlatk
或者V-N
3.错误
Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: 'C:UsersADMINI~1AppDataLocalTemppip-req-tracker-1v3crbz0987d09294c43f7870dd1f7d888fbe137612073b371e7c2545b07597d'
解决方法:pip install --user pyspider
4.错误
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
解决方法:https://blog.csdn.net/bbhdeal/article/details/81144783
5.错误
_mysql.c MySQLdb/_mysql.c(29): fatal error C1083: Cannot open include file: 'mysql.h': No such file or directory error: command 'C:Program Files (x86)Microsoft Visual Studio 14.0VCBINamd64cl.exe' failed with exit status 2
解决方法:https://github.com/AngusWG/TestProject/tree/master/%E5%B7%A5%E5%85%B7/%E8%A7%A3%E5%86%B3%E5%90%84%E7%A7%8D%E7%96%91%E9%9A%BE%E6%9D%82%E7%97%87%E7%9A%84%E7%8E%AF%E5%A2%83%E5%8C%85/mysqlclient%20wheel
下载适合自己电脑和python版本的mysqlclient并安装
还有问题的话,看下这个:
python3.7中mysqlclient安装错误的解决办法-雪鹰的世界-51CTO博客
终于整儿八经的装了啊
pip install dlatk
Collecting dlatk
Using cached ......dlatk-1.1.4.tar.gz R.......matplotlib>=1.3.1 ........mysqlclient (1.4.2)
……………………………………
Building wheel for SQLAlchemy (setup.py) ... done Stored in directory:
Successfully built dlatk nltk SQLAlchemy
Installing collected packages: singledispatch, nltk, pytz, pandas, patsy, scipy, scikit-learn, SQLAlchemy, statsmodels, dlatk
Successfully installed SQLAlchemy-1.3.0 dlatk-1.1.4 nltk-3.4 pandas-0.24.1 patsy-0.5.1 pytz-2018.9 scikit-learn-0.20.3 scipy-1.2.1 singledispatch-3.4.0.3 statsmodels-0.9.0
下一步,Load NLTK corpus
python -c "import nltk; nltk.download('wordnet')"
结果:
[nltk_data] Downloading package wordnet to
[nltk_data] C:UsersAdministratorAppDataRoamingnltk_data...
[nltk_data] Unzipping corporawordnet.zip.
第三步:Theano
C:UsersAdministrator>pip install theano
Collecting theano
Downloading https://files.pythonhosted.org/packages/7d/c4/6341148ad458b6cd8361b774d7ee6895c38eab88f05331f22304c484ed5d/Theano-1.0.4.tar.gz (2.8MB)
100% |████████████████████████████████| 2.8MB 14kB/s
Requirement already satisfied: numpy>=1.9.1
Requirement already satisfied: scipy>=0.14
Requirement already satisfied: six>=1.9.0
Building wheels for collected packages: theano
Building wheel for theano (setup.py) ... done
Successfully built theano
Installing collected packages: theano
Successfully installed theano-1.0.4
这时候有趣的事情来了:我打开研究生姐姐发给我的项目一看,要求是Theano 0.9, python 2.7 and Blocks……想哭啊!这包和版本要改多久啊!而且python2.7明年就凉了吧!
噢差点忘记theano已经凉了:)
决定配个python2.7和3.5双版本,上面的流程又走了一遍,pip改成python2 -m pip
https://www.cnblogs.com/wongbingming/p/6819212.html
C:Python27 将python.exe,pythonw.exe 改为python2.exe,pythonw2.exe
就当是熟悉命令行指令好了……
注意,python2.7搭配dlatk < 1.0,版本下错了又一堆事
第二:
装theano不配anaconda是很麻烦的,你要自己手动把minGW和libpython下下来,同时添加的环境变量,具体加多少,我没测试过,这里有一张别人的图:
![c251ca567ad229785df393ba27be5eef.png](https://i-blog.csdnimg.cn/blog_migrate/79ed26129e67343e081372ecf6d884d0.jpeg)
不然什么g++ not availableg++ not detected等着你
而且anaconda3是不能配合python2.7的,这里又调了一堆版本,怎么解决的我都忘了……我好像是下了个miniconda2,只把minGW那些配给了环境,interpreter还是用的python2.7
添加环境变量:path: XXX/Anaconda/MinGW/bin;E:/Anaconda/MinGW/x86_64-w64-mingw32/lib;(按照自己的路径修改)
(32bit E:/Anaconda/MinGW/i686-w64-mingw32/lib;)
新建环境变量: PYTHONPATH: E:/Anaconda/Lib/site-packages/theano;
装anaconda用清华镜像:在anaconda自带的命令行里:
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yes
还遇到了个错误,解决是:conda install m2w64-toolchain
Error1:
刚才python35要装Microsoft Visual C++ 14.0,换成python27时又要Microsoft Visual C++ 9.0了
解决:https://www.cnblogs.com/ldm1989/p/4210743.html
Error2:
在2.7装theano时:
The scripts theano-cache.exe and theano-nose.exe are installed in 'C:Python27Scripts' which is not on PATH.Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
把环境变量添加上吧,希望我能记得以后删掉
装blocks、用python word cloud
git clone 。。。。/block.gitcd 文件夹python2 setup.py install
File "C:Python27libsite-packagestablesfile.py", line 35, in <module>
from . import hdf5extension
ImportError: DLL load failed: 找不到指定的程序。
解决:外网查询得出,h5py换成2.8版本
https://stackoverflow.com/questions/54366505/importerror-dll-load-failed-while-file-is-in-working-directory
最后:
手动安装Python库或安装第三方库的方法https://blog.csdn.net/ssjdoudou/article/details/84036156
https://www.douban.com/note/594462204/