程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Resolve the conflict between the required library versions in Python multiple projects [contrib library cannot be used for versions above tensorflow2]

編輯:Python

1、 Problem prospect : Existing projects paddlespeech, In this project numpy Version and new project ocr What is required is numpy Version conflict

2、 Solution : install anaconda, Configure virtual environment

【anaconda The installation process is a little bit 】

3、anaconda Automatically create new after installation python Environmental Science ( I automatically install it here python3.9 了 ). To install one python3.7↓

  Click on CREATE, Name yourself , Then select what you want to install python edition

conda env list: See all environments , It can detect whether the configuration is successful

4、 There's a problem here :create It's grey and doesn't move .

solve : open C:\Users\Administrator In the catalog .condarc file , Replace the content with

channels:
- http://mirrors.ustc.edu.cn/anaconda/cloud/menpo/
- http://mirrors.ustc.edu.cn/anaconda/cloud/bioconda/
- http://mirrors.ustc.edu.cn/anaconda/cloud/msys2/
- http://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/
- http://mirrors.ustc.edu.cn/anaconda/pkgs/free/
- http://mirrors.ustc.edu.cn/anaconda/pkgs/main/
show_channel_urls: true

  After the save anaconda You can normally create a new virtual environment

5、 The new virtual environment has been created successfully python3.7【anaconda The interface will display the local location 】

Click the green button -》 Click on “open Terminal” Access terminal . Here you can execute pip Command to install the required libraries

6、 Input... At the terminal pip install tensorflow=1.13.1 -i http://pypi.douban.com/simple

install tensorflow1.13.1 edition .

【!! Because the project needs tensorflow.contrib, therefore tensorflow The version of is in 1.15 following ,1.15.0 Can not be !! Because I am safe 1.15.0 All morning QAQ!!】

【 There are many ways on the Internet to say that there is no need to reduce the version , I tried it, but it didn't work well , Fear that the downgrade will affect other projects can anaconda Just configure a virtual environment 】

 conda list : View the installed packages in the current environment , Check whether there is a specified version of tensorflow

7、 Attached separately anaconda Common terminal commands :

Anaconda Common command line operations - You know


  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved