J'utilise minconda et j'ai installé Python 3.7 sur une machine Windows 7. On m'a demandé d'utiliser les commandes suivantes à l'invite d'Anaconda :
conda create --name=IntroToTensorFlow python=3 anaconda
source activate IntroToTensorFlow
Windows n'a pas reconnu le mot source
mais a accepté la commande lorsque j'ai supprimé le mot source
conda install -c conda-forge tensorflow
le système répond à la dernière commande :
(IntroToTensorFlow) C:\>conda install -c conda-forge tensorflow
Solving environment: done
==> WARNING: A newer version of conda exists. <==
current version: 4.5.11
latest version: 4.5.12
Please update conda by running
$ conda update -n base -c defaults conda
J'ai mis à jour conda en utilisant la commande ci-dessus. Il y a un programme hello world qu'il est suggéré d'exécuter dans un notebook jupyter :
import tensorflow as tf
# Create TensorFlow object called tensor
hello_constant = tf.constant('Hello World!')
with tf.Session() as sess:
# Run the tf.constant operation in the session
output = sess.run(hello_constant)
print(output)
L'erreur est la suivante :
ModuleNotFoundError Traceback (most recent call last) in ----> 1 import tensorflow as tf 2 3 # Create TensorFlow object called tensor 4 hello_constant = tf.constant('Hello World!') 5 ModuleNotFoundError : Aucun module nommé 'tensorflow'
Lorsque j'entre à l'invite d'Anaconda :
conda list
TensorFlow apparaît sur la liste
J'ai lu que Python n'était pas encore supporté et qu'il fallait revenir à une version antérieure de Python 3.6.5 avec quelque chose appelé brew. Est-ce toujours vrai ? L'article date d'il y a 6 mois
https://apple.stackexchange.com/questions/329187/homebrew-rollback-from-Python-3-7-to-Python-3-6-5-x
brew info python 'brew' is not recognized as an internal or external command, operable program or batch file.
Qu'est-ce que le brew et comment l'utiliser ? Existe-t-il une alternative à Windows 7 ? Cela ressemble à une commande système d'Apple.