Différences entre versions de « FEATHER-CHARGER-FICHIER-MICROPYTHON-AMPY »

De MCHobby - Wiki
Sauter à la navigation Sauter à la recherche
Ligne 4 : Ligne 4 :
  
 
== Installer Ampy ==
 
== Installer Ampy ==
To install the A[https://github.com/adafruit/ampy dafruit MicroPython tool] (ampy) you'll first need to make sure you have [http://www.python.org/ Python] installed on your computer. The tool will work with either Python 2.7.x or 3.x so you can use whichever version you prefer.
+
Pour installer l'outil [https://github.com/adafruit/ampy Adafruit MicroPython] (ampy) vous aurez besoin d'installer [http://www.python.org/ Python] sur votre ordinateur. L'outil fonctionnera soit avec Python 2.7.x ou Python 3.x (vous pouvez donc choisir la version de votre choix).
  
'''For Linux and Mac OSX''' you probably already have a version of python installed--trying running the python or pip command to see that it's available. If you don't see python installed consult your package manager or a tool like [http://brew.sh/ Homebrew] to easily install it.
+
'''Pour les utilisateurs Linux et Mac OSX''': vous avez probablement une version de Python déjà pre-installé --essayez d'exécuter la commande {{fname|python}} ou {{fname|pip}} pour voir s'il est disponible). Si vous constatez que Python n'est pas installé, consultez le Gestionnaire de Paquet ou outil tels que [http://brew.sh/ Homebrew] pour l'installer facilement.
  
'''For Windows''' you'll need to install Python and be sure to check the box during installation to add python to your system path.
+
'''Pour les utilisateurs Window''': vous aurez besoin d'installer Python. Durant l'installation, sélectionnez le ''checkbox'' permettant d'ajouter le répertoire d'installation de Python à votre PATH système.
  
 
Once Python is avaialble on your system you can easily install ampy from the Python package index.  If you're using '''Python 2.7.x''' open a terminal and run this command:
 
Once Python is avaialble on your system you can easily install ampy from the Python package index.  If you're using '''Python 2.7.x''' open a terminal and run this command:

Version du 12 novembre 2016 à 20:39


MCHobby investit du temps et de l'argent dans la réalisation de traduction et/ou documentation. C'est un travail long et fastidieux réalisé dans l'esprit Open-Source... donc gratuit et librement accessible.
SI vous aimez nos traductions et documentations ALORS aidez nous à en produire plus en achetant vos produits chez MCHobby.

Installer Ampy

Pour installer l'outil Adafruit MicroPython (ampy) vous aurez besoin d'installer Python sur votre ordinateur. L'outil fonctionnera soit avec Python 2.7.x ou Python 3.x (vous pouvez donc choisir la version de votre choix).

Pour les utilisateurs Linux et Mac OSX: vous avez probablement une version de Python déjà pre-installé --essayez d'exécuter la commande python ou pip pour voir s'il est disponible). Si vous constatez que Python n'est pas installé, consultez le Gestionnaire de Paquet ou outil tels que Homebrew pour l'installer facilement.

Pour les utilisateurs Window: vous aurez besoin d'installer Python. Durant l'installation, sélectionnez le checkbox permettant d'ajouter le répertoire d'installation de Python à votre PATH système.

Once Python is avaialble on your system you can easily install ampy from the Python package index. If you're using Python 2.7.x open a terminal and run this command:

pip install adafruit-ampy

Note on some Linux and Mac OSX systems you might need to install as root with sudo:

sudo pip3 install adafruit-ampy

Or if you'd like to use Python 3.x run the pip3 command instead (using sudo if necessary):

pip3 install adafruit-ampy

{{{2}}}
Crédit: AdaFruit Industries www.adafruit.com

Finally in some rare cases like Mac OSX with Homebrew and multiple Python versions installed you might need to use the pip2 command to explicitly install in Python 2.7.x:

pip2 install adafruit-ampy

Make sure the pip command finishes without an error. If you see an error then go back and check you have python installed and are running it as root with sudo if necessary.

To check that ampy installed successfully run the following command to print its usage:

ampy --help

{{{2}}}
Crédit: AdaFruit Industries www.adafruit.com

You should see usage information for the tool printed, like what commands it has and options for using them. If you see an error instead go back and carefully check the pip install command above succeeded, and that python is in your system path.

Installer depuis les sources

If you'd like to install ampy from its source on GitHub you can do so easily with a few commands. If you followed the above steps to install from the Python package index this isn't necessary, but if you'd like the current code or are perhaps modifying it then you'll want to install from source.

First download the source or use the git tool to clone it from GitHub:

git clone https://github.com/adafruit/ampy.git

Then in a terminal navigate to the directory with the cloned or extracted source and run the following command to install with 'Python 2.7.x:

python setup.py install

Note on some Linux and Mac OSX machines you might need to run as root with sudo:

sudo python setup.py install

Or to install for Python 3.x use the python3 command (using sudo when necessary too):

python3 setup.py install

{{{2}}}
Crédit: AdaFruit Industries www.adafruit.com

Carefully inspect the output of the command to make sure it finished without an error or exception. You should see something like 'Finished processing dependencies for adafruit-ampy...' as the last line. Once installed in this way the ampy tool should be available in your path just like if installed from the Python package index.

One final way to install ampy from source is in develop mode, this way the cloned / downloaded code will actually be the code Python runs instead of copying and installing it into an internal Python module cache. This is handy if you're working on the code and want to see your changes immediately updated. To install in develop mode just run the setup.py command above but change install to develop.

Also note on Python 2.7.x if you plan to run the unit tests in the source code you will need the mock module installed:

pip install mock

Source: MicroPython Basics: Load Files & Run Code
Créé par Tony DiCola pour AdaFruit Industries.

Traduit par Meurisse D. pour MCHobby

Toute référence, mention ou extrait de cette traduction doit être explicitement accompagné du texte suivant : «  Traduction par MCHobby (www.MCHobby.be) - Vente de kit et composants » avec un lien vers la source (donc cette page) et ce quelque soit le média utilisé.

L'utilisation commercial de la traduction (texte) et/ou réalisation, même partielle, pourrait être soumis à redevance. Dans tous les cas de figures, vous devez également obtenir l'accord du(des) détenteur initial des droits. Celui de MC Hobby s'arrêtant au travail de traduction proprement dit.

Traduit avec l'autorisation d'AdaFruit Industries - Translated with the permission from Adafruit Industries - www.adafruit.com