安装NLP所需环境 pip install -r deeplearning_requirement.txt

先展示我要安装的环境文件,文件名为deeplearning_requirement.txt

absl-py==0.15.0
aiohttp==3.8.1
aiosignal==1.2.0
astunparse==1.6.3
async-timeout==4.0.2
asynctest==0.13.0
attrs==21.4.0
boto3==1.20.30
botocore==1.23.30
cachetools==4.2.4
certifi==2021.10.8
charset-normalizer==2.0.10
click==8.0.3
cycler==0.11.0
datasets==1.17.0
dill==0.3.4
fasttext @ file:///root/fastText
filelock==3.4.2
flatbuffers==1.12
fonttools==4.28.5
frozenlist==1.2.0
fsspec==2021.11.1
gast==0.3.3
google-auth==2.3.3
google-auth-oauthlib==0.4.6
google-pasta==0.2.0
google-trans-new==1.1.9
grpcio==1.32.0
h5py==2.10.0
huggingface-hub==0.2.1
idna==3.3
importlib-metadata==4.10.0
jieba==0.42.1
jmespath==0.10.0
joblib==1.1.0
Keras-Preprocessing==1.1.2
kiwisolver==1.3.2
Markdown==3.3.6
matplotlib==3.5.1
mkl-fft==1.3.1
mkl-random @ file:///tmp/build/80754af9/mkl_random_1626179032232/work
mkl-service==2.4.0
multidict==5.2.0
multiprocess==0.70.12.2
numpy==1.19.5
oauthlib==3.1.1
olefile==0.46
opt-einsum==3.3.0
packaging==21.3
pandas==1.3.5
Pillow==8.4.0
protobuf==3.19.1
pyarrow==6.0.1
pyasn1==0.4.8
pyasn1-modules==0.2.8
pybind11==2.9.0
pyparsing==3.0.6
python-dateutil==2.8.2
pytz==2021.3
PyYAML==6.0
regex==2021.11.10
requests==2.27.1
requests-oauthlib==1.3.0
rsa==4.8
s3transfer==0.5.0
sacremoses==0.0.46
scipy==1.7.3
seaborn==0.11.2
sentencepiece==0.1.96
six==1.15.0
tensorboard==2.7.0
tensorboard-data-server==0.6.1
tensorboard-plugin-wit==1.8.1
tensorflow==2.4.0
tensorflow-estimator==2.4.0
termcolor==1.1.0
tokenizers==0.10.3
torch==1.10.1
torchaudio==0.10.1
torchsummary==1.5.1
torchvision==0.11.2
tqdm==4.62.3
transformers @ file:///root/nlp_base/codeNLP/05fasttext%E5%8F%8A%E8%BF%81%E7%A7%BB%E5%AD%A6%E4%B9%A0/transformers
typing-extensions==3.7.4.3
urllib3==1.26.7
Werkzeug==2.0.2
wordcloud==1.8.1
wrapt==1.12.1
xxhash==2.0.2
yarl==1.7.2
zipp==3.7.0

1.用Anaconda创建虚拟环境,命名为NLP_learn

conda create -n NLP_learn python==3.7.2

报错:CondaHTTPError: HTTP None None for url
在这里插入图片描述
再次之前我已经是改为清华源了,结果还是报错
解决办法:改镜像源 https -->http
C:\Users\19820.condarc

channels:
  - defaults
show_channel_urls: true
default_channels:
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
custom_channels:
  conda-forge: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  msys2: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  bioconda: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  menpo: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  pytorch: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  simpleitk: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud

然后重新运行

conda create -n NLP_learn python==3.7.2

这时候就创建成功了,查看是否有了NLP_learn这个环境

conda env list

在这里插入图片描述
2.在NLP_learn环境下安装
2.1首先把deeplearning_requirements.txt放到“C:\Users\你的用户名”的路径下:
在这里插入图片描述
2.2激活虚拟环境

activate NLP_learn

2.3运行安装命令

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/ -r deeplearning_requirement.txt

在这里插入图片描述
这里又报错了
解决办法:手动删除文件中的下载链接,删除后的效果如下:

absl-py==0.15.0
aiohttp==3.8.1
aiosignal==1.2.0
astunparse==1.6.3
async-timeout==4.0.2
asynctest==0.13.0
attrs==21.4.0
boto3==1.20.30
botocore==1.23.30
cachetools==4.2.4
certifi==2021.10.8
charset-normalizer==2.0.10
click==8.0.3
cycler==0.11.0
datasets==1.17.0
dill==0.3.4
fasttext 
filelock==3.4.2
flatbuffers==1.12
fonttools==4.28.5
frozenlist==1.2.0
fsspec==2021.11.1
gast==0.3.3
google-auth==2.3.3
google-auth-oauthlib==0.4.6
google-pasta==0.2.0
google-trans-new==1.1.9
grpcio==1.32.0
h5py==2.10.0
huggingface-hub==0.2.1
idna==3.3
importlib-metadata==4.10.0
jieba==0.42.1
jmespath==0.10.0
joblib==1.1.0
Keras-Preprocessing==1.1.2
kiwisolver==1.3.2
Markdown==3.3.6
matplotlib==3.5.1
mkl-fft==1.3.1
mkl-random 
mkl-service==2.4.0
multidict==5.2.0
multiprocess==0.70.12.2
numpy==1.19.5
oauthlib==3.1.1
olefile==0.46
opt-einsum==3.3.0
packaging==21.3
pandas==1.3.5
Pillow==8.4.0
protobuf==3.19.1
pyarrow==6.0.1
pyasn1==0.4.8
pyasn1-modules==0.2.8
pybind11==2.9.0
pyparsing==3.0.6
python-dateutil==2.8.2
pytz==2021.3
PyYAML==6.0
regex==2021.11.10
requests==2.27.1
requests-oauthlib==1.3.0
rsa==4.8
s3transfer==0.5.0
sacremoses==0.0.46
scipy==1.7.3
seaborn==0.11.2
sentencepiece==0.1.96
six==1.15.0
tensorboard==2.7.0
tensorboard-data-server==0.6.1
tensorboard-plugin-wit==1.8.1
tensorflow==2.4.0
tensorflow-estimator==2.4.0
termcolor==1.1.0
tokenizers==0.10.3
torch==1.10.1
torchaudio==0.10.1
torchsummary==1.5.1
torchvision==0.11.2
tqdm==4.62.3
transformers 
typing-extensions==3.7.4.3
urllib3==1.26.7
Werkzeug==2.0.2
wordcloud==1.8.1
wrapt==1.12.1
xxhash==2.0.2
yarl==1.7.2
zipp==3.7.0

重新运行

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/ -r deeplearning_requirement.txt

这里可以安装了,为了避免下载速度慢,用的清华源
这里说一下安装时怎么使用清华源:
安装总包时:

conda install --yes --file requirements.txt

或者

pip install -i https://pypi.doubanio.com/simple/ -r requirements.txt

安装单个包时:

 pip --default-timeout=100 install tensorflow==2.0.0 -i https://pypi.tuna.tsinghua.edu.cn/simple 

这时命令已经可以正常运行了,不过很不幸又出现了错误:
在这里插入图片描述
这里的意思就是发生了版本冲突,不同的包对numpy要求的版本不一样,第一行写的现在安装的是1.19.5,下面写的是不同的包对numpy版本的需求,简直头秃,不知道找哪个版本合适了,他还给了解决方法和链接,说可以试试不指定numpy的版本,不过我试了一下也不行,最后我是单独安装的这些冲突的包,不指定版本,让它自己匹配,例如下面这样:

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

之后就是用pip list命令看一下现在环境中还缺什么包,逐个安装一下
3.结果展示
在这里插入图片描述
大功告成了!!!

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

泡沫不是茶香

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值