语言处理 之 conda,pip

conda create -n tensorflowtts2 python=3.7

conda remove -n tensorflowtts2 --all

查看用 conda info --envs

激活python环境用:

conda activate tensorflowtts

cd data1/TensorFlowTTS

pip install TensorFlowTTS

不激活用conda deactivate

只能装tensorflow-gpu==2.2.0,2.4.0就不行了,tensorflow根本不行。2.3.0就不能用addons

然后tensorflow和tensorflowaddons应该都安装了。

出现问题:

ModuleNotFoundError: No module named 'yaml'

用pip安装就可以了,注意更换阿里源

pip install tensorflow==2.2.0 -i https://pypi.doubanio.com/simple/

pip install

感觉阿里云的好少啊。。。用豆瓣源试试。如果不行,多换几个源试试。

pip install tensorflow-gpu==2.3.0 -i  https://pypi.tuna.tsinghua.edu.cn/simple/ --default-timeout=1000

没有pytest,soundfile,jamo,inflect,unidecode好多。。。

阿里云 http://mirrors.aliyun.com/pypi/simple/

中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/

豆瓣(douban) http://pypi.douban.com/simple/

清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/

华中理工大学:http://pypi.hustunique.com/

山东理工大学:http://pypi.sdutlinux.org/

pip --default-timeout=100 install XXX

pip install pytest soundfile jamo inflect unidecode pypinyin g2p_en pyyaml tensorflow-addons==0.10.0

pip install librosa -i  https://pypi.doubanio.com/simple/

pip install matplotlib -i https://pypi.doubanio.com/simple/

  • pip install git+https://github.com/repodiac/german_transliterate

这个问题,这么解决。

明白了,可能用得是pytest,然后pytest用的是跟springboot一样,注释,通过yaml来运行的,就是这样的。

看来并不能用pip install . 去更新,老是有不兼容的东西。只能慢慢来。

最后还要添加一个python运行环境,

作用于当前用户,修改当前用户目录下的'~/.bashrc'文件
  $ vi ~/.bashrc
  加入内容:
  export PYTHONPATH=$PYTHONPATH:/home/hadoop/MyBI
  也可以加入多个路径,用分号分隔
  export PYTHONPATH=$PYTHONPATH:<你的要加入的路径1>:<你的要加入的路径2>:等等
 
  注1:需要执行如下命令后生效(或者注销后重新登陆)
  $ source ~/.bashrc

出现问题:

ImportError: cannot import name 'keras_tensor' from 'tensorflow.python.keras.engine'

这是因为tensorflow_addons不兼容,需要安装正确的,

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/HeroIsUseless/article/details/112308622