win,各種python包的安裝歷程……

win10-cpu

快捷鍵:win+R,輸入cmd,然後開始吧~

keras-cpu

pip install keras
# Successfully installed keras-2.2.4 keras-applications-1.0.6 keras-preprocessing-1.0.5

tensorflow-cpu

pip install --upgrade tensorflow
# Cannot uninstall 'wrapt'
pip install --upgrade tensorflow --ignore-installed wrapt

# 用pip安裝tensorflow換成國內源快速安裝
pip install --index-url https://pypi.douban.com/simple tensorflow

# conda安裝
conda install --channel https://conda.anaconda.org/conda-forge tensorflow

sklearn

pip install sklearn
# Successfully installed sklearn-0.0

GIT

下載地址:Git for Windows 2.12.1

安裝教程:Windows10下安裝Git

其他:

(1)cmd 裏面運行git提示“不是內部或外部命令,也不是可運行的程序”:

# 配置環境變量:
D:\Program Files\Git\mingw64\bin
D:\Program Files\Git\mingw64\libexec\git-core

(2)fatal: Not a git repository

git init
# 也就是說,在命令行敲入git init回車之後,再重新執行添加文件的命令即可。

pyltp

HIT-SCIR/pyltp

第一次嘗試:

pip install pyltp
# 結果:
# error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools

第二、三次嘗試:

由於pyltp安裝時報錯,需要Visual C++14.0的編譯環境,因此首先電腦中需要先安裝VC++14.0,對應的VS版本爲VS2015。參考VS2015安裝教程(帶圖解+下載地址+超詳細)進行安裝。

pip install pyltp
# 結果
# error: command 'D:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2

下載並安裝對應的ecos包(下載地址:https://www.lfd.uci.edu/~gohlke/pythonlibs/#ecos

pip install D:\Tencent\ecos-2.0.7.post1-cp35-cp35m-win_amd64.whl
# Successfully installed ecos-2.0.7.post1

# 結果依然:
pip install pyltp
# error: command 'D:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2

第四次嘗試:

參考:Python3.6.3中pyltp的安裝錯誤總結

set STATICBUILD=true && python -m pip install pyltp==0.1.9.1
# Successfully installed pyltp-0.1.9.1

成功安裝後下載模型(隨便存放在哪裏,但是使用時要調用模型地址的,可以統一存放在MODELDIR = "D:/Anaconda3/Lib/site-packages/pyltp-0.1.9.1.dist-info/ltp_data_v3.4.0"):

地址:http://ltp.ai/download.html

注:3.4.0 版本 SRL模型 pisrl.model 如在windows系統下不可用,可以到 此鏈接 下載支持windows的語義角色標註模型。

pymysql

whl地址:https://www.lfd.uci.edu/~gohlke/pythonlibs/#Mysqlclient

# 第一次:
pip install mysqlclient

# 第二次:(先下載whl文件)
pip install D:\Tencent\mysqlclient-1.3.13-cp35-cp35m-win_amd64.whl
# Successfully installed mysqlclient-1.3.13

pytorch

https://pytorch.org/#pip-install-pytorch

conda install pytorch-cpu torchvision-cpu -c pytorch
# 結果
>>> import pytorch
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named 'pytorch'

# 我真愚蠢,應該:
>>> import torch

gensim

https://radimrehurek.com/gensim/install.html

conda install -c conda-forge gensim

python-Levenshtein

pip install python-Levenshtein

textrank4zh

pip install textrank4zh

fasttext

whl地址:https://www.lfd.uci.edu/~gohlke/pythonlibs/#fasttext

# 第一次:先下載whl放至文件夾下(D:\..文件夾地址..\fasttext-0.8.22-cp35-cp35m-win_amd64.whl)
pip install D:\Tencent/fasttext-0.8.22-cp35-cp35m-win_amd64.whl
# 結果:socket.timeout: The read operation timed out

# 第二次:設置超時時間
pip --default-timeout=100 install D:\軟件\開發工具\whl\fasttext-0.8.22-cp35-cp35m-win_amd64.whl
# Successfully installed fasttext-0.8.22 pybind11-2.2.4

pyhanlp

hankcs/pyhanlp

pip install pyhanlp
# Successfully installed jpype1-0.6.3 pyhanlp-0.1.44

# 下載hanlp的安裝包:
# 第一次:import pyhanlp   #它會自動下載jar包、data文件和properties文件到默認的目錄
# 結果:No such file or directory: 'D:\\Anaconda3\\lib\\site-packages\\pyhanlp\\static\\hanlp-1.7.1-release.zip

# 第二次:手動下載:https://github.com/hankcs/HanLP/
1、下載:data.zip
2、下載jar和配置文件:hanlp-release.zip
# 結果:github-production-release-asset-2e65be.s3.amazonaws.com 意外終止了連接。
# 解決:將網址複製粘貼到他處後,將前https改爲http再前往下載

# 第三次:import pyhanlp後
# 結果:jpype._jvmfinder.JVMNotFoundException: No JVM shared library file (jvm.dll) found. Try setting up the JAVA_HOME environment variable properly.
# 解決:下載jdk文件並配置環境變量
下載教程:https://jingyan.baidu.com/article/25648fc14849779191fd00fd.html
安裝和配置環境變量教程:https://jingyan.baidu.com/article/f96699bb163475894e3c1be4.html

https://github.com/hankcs/HanLP/

tqdm

pip install tqdm
# Successfully installed tqdm-4.29.1

scrapy

先安裝Twisted,whl地址:https://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted

pip install D:\軟件\開發工具\whl\Twisted-18.9.0-cp35-cp35m-win_amd64.whl
# Successfully installed PyDispatcher-2.0.5 cssselect-1.0.3 parsel-1.5.1 pyasn1-modules-0.2.3 queuelib-1.5.0 scrapy-1.5.1 service-identity-18.1.0 w3lib-1.20.0

pip install scrapy
# Successfully installed PyDispatcher-2.0.5 cssselect-1.0.3 parsel-1.5.1 pyasn1-modules-0.2.3 queuelib-1.5.0 scrapy-1.5.1 service-identity-18.1.0 w3lib-1.20.0

py2neo

Py2Neo 是用來對接 Neo4j 的 Python 庫

https://pypi.org/project/py2neo/

# To install the latest stable version of py2neo, simply use pip:

pip install py2neo

# Or to install the latest bleeding edge code directly from GitHub, use:

pip install git+https://github.com/technige/py2neo.git#egg=py2neo

# Note that code installed directly from GitHub is likely to be unstable. Your mileage may vary.

pyspark

https://blog.csdn.net/HJXINKKL/article/details/81951551

pip install -U pyspark


# 或者添加鏡像

pip install -U -i https://pypi.tuna.tsinghua.edu.cn/simple pyspark

pyahocorasick

https://github.com/liuhuanyong/QASystemOnMedicalKG/issues/10

conda install -c https://conda.anaconda.org/conda-forge pyahocorasick

synonyms

huyingxi/Synonyms

## 第一次:
pip install -U synonyms
# 結果:
# Cannot uninstall 'six'. It is a distutils installed project and thus we cannot accurately # determine which files belong to it which would lead to only a partial uninstall.
# 解決:
pip install six --upgrade --ignore-installed six
# Successfully installed six-1.12.0

## 第二次:
pip install -U synonyms
# 結果:
# Cannot uninstall 'scikit-learn'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
# 解決:
pip install --ignore-installed  scikit-learn
# Successfully installed numpy-1.15.4 scikit-learn-0.20.2 scipy-1.2.0

## 第三次:
pip install -U synonyms
# Successfully installed scikit-learn-0.19.1 scipy-1.0.0 synonyms-3.10.1
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章