简体   繁体   中英

Install python 3.5 via conda get unsatisfiable error “backport.os”

I install anaconda with python version 3.7 on Windows. Then I want to install TensorFlow, but it don't support python 3.7. I try to install python 3.5, but get this error: python错误

How to resolve this conflict to install python 3.5?

You can create an environment with the Python version of your choice.

Example create an environment called deep with python 3.5 and tensorflow:

conda create -n deep python=3.5 tensorflow

After that we can activate it with

conda activate deep

While in this environment you will have Python 3.5 and tensorflow. You can add other packages to your environment anywhere. Eg adding latest scipy, pandas, and jupyter

conda install --name deep scipy pandas jupyter

Updated: While in the environment, you don't have to specify the environment name, when installing packages. You can do:

conda install package_name

When done doing awesomeness, you can deactivate as so:

conda deactivate

;) So your workflow when working with Tensorflow, would include activating your 'deep' environment and use Python 3.5 there ;) eg

conda activate deep
jupyter lab

Assuming you have installed tensorflow and jupyter, this will start a service on your default browser where you can start building your project.

Happy coding ...

Check out conda documentation https://conda.io/docs/user-guide/tasks/manage-pkgs.html

Today Tensorflow doesn't support Python 3.7 . You have to create a new environment with Python 3.4, 3.5 or 3.6. With conda it's easy to handle different environments and versions. In addition it's recommended using pip to install Tensorflow.

Python 3.6 with CPU:

conda create -y -n name_of_env python=3.6  # create new environment
source activate name_of_env                # activate the new environment
pip install tensorflow                     # install tensorflow

Python 3.6 with GPU ( please check the additional setup for using a GPU ):

conda create -y -n name_of_env python=3.6
source activate name_of_env
pip install tensorflow-gpu

Tip: Finally you can test your installation with the following command:

echo 'import tensorflow as tf; print(tf.__version__)' | python
# 1.12.0

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM