IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Déploiement/Installation Python Discussion :

Impossible d'utiliser numpy sur mon mac [Python 3.X]


Sujet :

Déploiement/Installation Python

  1. #1
    Membre à l'essai
    Homme Profil pro
    Enseignant Chercheur
    Inscrit en
    Août 2023
    Messages
    5
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 49
    Localisation : France, Gironde (Aquitaine)

    Informations professionnelles :
    Activité : Enseignant Chercheur
    Secteur : Enseignement

    Informations forums :
    Inscription : Août 2023
    Messages : 5
    Par défaut Impossible d'utiliser numpy sur mon mac
    Bonjour,

    je cherche depuis maintenant un certain nombre d'heures une solution pour lancer numpy. J'ai essayé un peu toute les solutions que j'ai trouvé ici et là sur le net et je retombe toujours sur le même message d'erreur.

    Traceback (most recent call last):
    File "/Users/XXX/Desktop/python/test numpy.py", line 3, in <module>
    import numpy as np
    File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/numpy/__init__.py", line 139, in <module>
    from . import core
    File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/numpy/core/__init__.py", line 49, in <module>
    raise ImportError(msg)
    ImportError:

    IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

    Importing the numpy C-extensions failed. This error can happen for
    many reasons, often due to issues with your setup or how NumPy was
    installed.

    We have compiled some common reasons and troubleshooting tips at:

    https://numpy.org/devdocs/user/troub...porterror.html

    Please note and check the following:

    * The Python version is: Python3.11 from "/Library/Frameworks/Python.framework/Versions/3.11/bin/python3.11"
    * The NumPy version is: "1.25.2"

    and make sure that they are the versions you expect.
    Please carefully study the documentation linked above for further help.

    Original error was: dlopen(/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/numpy/core/_multiarray_umath.cpython-311-darwin.so, 0x0002): tried: '/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/numpy/core/_multiarray_umath.cpython-311-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/numpy/core/_multiarray_umath.cpython-311-darwin.so' (no such file), '/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/numpy/core/_multiarray_umath.cpython-311-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))
    Pourriez-vous m'aider s'il vous plaît ?

    Merci beaucoup !
    Sgol

  2. #2
    Expert éminent
    Homme Profil pro
    Architecte technique retraité
    Inscrit en
    Juin 2008
    Messages
    21 777
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Manche (Basse Normandie)

    Informations professionnelles :
    Activité : Architecte technique retraité
    Secteur : Industrie

    Informations forums :
    Inscription : Juin 2008
    Messages : 21 777
    Par défaut
    Salut,

    Citation Envoyé par sgol33 Voir le message
    Pourriez-vous m'aider s'il vous plaît ?
    C'est un problème qui est spécifique à votre environnement. Trouver une solution passe par espérer qu'en cherchant sur Internet on pourra appliquer les solutions appliquées par ceux qui ont eu le même type de problème (vous avez un beau message d'erreur à utiliser pour chercher...).
    Maintenant avec un message d'erreur comme (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')). Ca semble dire que vous avez récupéré un kit pré-compilé pour une autre architecture: où avez vous récupéré numpy? Comment l'avez vous installé?

    - W
    Architectures post-modernes.
    Python sur DVP c'est aussi des FAQs, des cours et tutoriels

  3. #3
    Membre à l'essai
    Homme Profil pro
    Enseignant Chercheur
    Inscrit en
    Août 2023
    Messages
    5
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 49
    Localisation : France, Gironde (Aquitaine)

    Informations professionnelles :
    Activité : Enseignant Chercheur
    Secteur : Enseignement

    Informations forums :
    Inscription : Août 2023
    Messages : 5
    Par défaut
    Citation Envoyé par wiztricks Voir le message
    Salut,



    C'est un problème qui est spécifique à votre environnement. Trouver une solution passe par espérer qu'en cherchant sur Internet on pourra appliquer les solutions appliquées par ceux qui ont eu le même type de problème (vous avez un beau message d'erreur à utiliser pour chercher...).
    Maintenant avec un message d'erreur comme (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')). Ca semble dire que vous avez récupéré un kit pré-compilé pour une autre architecture: où avez vous récupéré numpy? Comment l'avez vous installé?

    - W
    J'ai simplement installé numpy avec pip3 install numpy. J'ai navigué sur beaucoup de messages similaires au mien mais aucune des réponses suggérées n'arrivait à régler le problème.

  4. #4
    Expert éminent
    Homme Profil pro
    Architecte technique retraité
    Inscrit en
    Juin 2008
    Messages
    21 777
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Manche (Basse Normandie)

    Informations professionnelles :
    Activité : Architecte technique retraité
    Secteur : Industrie

    Informations forums :
    Inscription : Juin 2008
    Messages : 21 777
    Par défaut
    Citation Envoyé par sgol33 Voir le message
    J'ai simplement installé numpy avec pip3 install numpy.
    D'accord mais ce faisant ça va charger un fichier dont le nom sera de la forme numpy-1.25.2-pp39-pypy39_pp73-macosx_10_9_x86_64.whl et afficher ce nom sur votre terminal.

    - W
    Architectures post-modernes.
    Python sur DVP c'est aussi des FAQs, des cours et tutoriels

  5. #5
    Membre à l'essai
    Homme Profil pro
    Enseignant Chercheur
    Inscrit en
    Août 2023
    Messages
    5
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 49
    Localisation : France, Gironde (Aquitaine)

    Informations professionnelles :
    Activité : Enseignant Chercheur
    Secteur : Enseignement

    Informations forums :
    Inscription : Août 2023
    Messages : 5
    Par défaut
    Citation Envoyé par wiztricks Voir le message
    D'accord mais ce faisant ça va charger un fichier dont le nom sera de la forme numpy-1.25.2-pp39-pypy39_pp73-macosx_10_9_x86_64.whl et afficher ce nom sur votre terminal.

    - W
    Je ne suis pas expert et ne comprends pas en quoi cette réponse peut m'aider. Pourriez-vous m'éclairer s'il vous plaît ce que cela implique ou ce que je dois changer ?

  6. #6
    Expert éminent
    Homme Profil pro
    Architecte technique retraité
    Inscrit en
    Juin 2008
    Messages
    21 777
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Manche (Basse Normandie)

    Informations professionnelles :
    Activité : Architecte technique retraité
    Secteur : Industrie

    Informations forums :
    Inscription : Juin 2008
    Messages : 21 777
    Par défaut
    Citation Envoyé par sgol33 Voir le message
    Je ne suis pas expert et ne comprends pas en quoi cette réponse peut m'aider. Pourriez-vous m'éclairer s'il vous plaît ce que cela implique ou ce que je dois changer ?
    Vous ne devez rien changer, juste ré-installer numpy en étant attentif aux messages qui s'affichent.

    - W
    Architectures post-modernes.
    Python sur DVP c'est aussi des FAQs, des cours et tutoriels

  7. #7
    Membre à l'essai
    Homme Profil pro
    Enseignant Chercheur
    Inscrit en
    Août 2023
    Messages
    5
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 49
    Localisation : France, Gironde (Aquitaine)

    Informations professionnelles :
    Activité : Enseignant Chercheur
    Secteur : Enseignement

    Informations forums :
    Inscription : Août 2023
    Messages : 5
    Par défaut
    Citation Envoyé par wiztricks Voir le message
    Vous ne devez rien changer, juste ré-installer numpy en étant attentif aux messages qui s'affichent.

    - W
    Je viens de désintaller python et de le réinstaller avec brew install python3

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    ==> Downloading https://formulae.brew.sh/api/formula.jws.json
    ######################################################################### 100.0%
    ==> Downloading https://formulae.brew.sh/api/cask.jws.json
    ######################################################################### 100.0%
    ==> Fetching dependencies for python@3.11: mpdecimal, ca-certificates, openssl@3, readline, sqlite and xz
    ==> Fetching mpdecimal
    ==> Downloading https://ghcr.io/v2/homebrew/core/mpdecimal/manifests/2.5.1
    ######################################################################### 100.0%
    ==> Downloading https://ghcr.io/v2/homebrew/core/mpdecimal/blobs/sha256:5b1c62c0
    ######################################################################### 100.0%
    ==> Fetching ca-certificates
    ==> Downloading https://ghcr.io/v2/homebrew/core/ca-certificates/manifests/2023-
    ######################################################################### 100.0%
    ==> Downloading https://ghcr.io/v2/homebrew/core/ca-certificates/blobs/sha256:f6
    ######################################################################### 100.0%
    ==> Fetching openssl@3
    ==> Downloading https://ghcr.io/v2/homebrew/core/openssl/3/manifests/3.1.2-1
    ######################################################################### 100.0%
    ==> Downloading https://ghcr.io/v2/homebrew/core/openssl/3/blobs/sha256:904a07d9
    ######################################################################### 100.0%
    ==> Fetching readline
    ==> Downloading https://ghcr.io/v2/homebrew/core/readline/manifests/8.2.1
    ######################################################################### 100.0%
    ==> Downloading https://ghcr.io/v2/homebrew/core/readline/blobs/sha256:fba42a9bd
    ######################################################################### 100.0%
    ==> Fetching sqlite
    ==> Downloading https://ghcr.io/v2/homebrew/core/sqlite/manifests/3.42.0
    ######################################################################### 100.0%
    ==> Downloading https://ghcr.io/v2/homebrew/core/sqlite/blobs/sha256:c9b11a8dd4f
    ######################################################################### 100.0%
    ==> Fetching xz
    ==> Downloading https://ghcr.io/v2/homebrew/core/xz/manifests/5.4.3
    ######################################################################### 100.0%
    ==> Downloading https://ghcr.io/v2/homebrew/core/xz/blobs/sha256:179cc5316bed5c4
    ######################################################################### 100.0%
    ==> Fetching python@3.11
    ==> Downloading https://ghcr.io/v2/homebrew/core/python/3.11/manifests/3.11.4_1-
    ######################################################################### 100.0%
    ==> Downloading https://ghcr.io/v2/homebrew/core/python/3.11/blobs/sha256:0b34ef
    ######################################################################### 100.0%
    ==> Installing dependencies for python@3.11: mpdecimal, ca-certificates, openssl@3, readline, sqlite and xz
    ==> Installing python@3.11 dependency: mpdecimal
    ==> Pouring mpdecimal--2.5.1.arm64_ventura.bottle.tar.gz
    🍺  /opt/homebrew/Cellar/mpdecimal/2.5.1: 71 files, 2.2MB
    ==> Installing python@3.11 dependency: ca-certificates
    ==> Pouring ca-certificates--2023-05-30.arm64_ventura.bottle.tar.gz
    ==> Regenerating CA certificate bundle from keychain, this may take a while...
    🍺  /opt/homebrew/Cellar/ca-certificates/2023-05-30: 3 files, 216.2KB
    ==> Installing python@3.11 dependency: openssl@3
    ==> Pouring openssl@3--3.1.2.arm64_ventura.bottle.1.tar.gz
    🍺  /opt/homebrew/Cellar/openssl@3/3.1.2: 6,495 files, 28.4MB
    ==> Installing python@3.11 dependency: readline
    ==> Pouring readline--8.2.1.arm64_ventura.bottle.tar.gz
    🍺  /opt/homebrew/Cellar/readline/8.2.1: 50 files, 1.7MB
    ==> Installing python@3.11 dependency: sqlite
    ==> Pouring sqlite--3.42.0.arm64_ventura.bottle.tar.gz
    🍺  /opt/homebrew/Cellar/sqlite/3.42.0: 11 files, 4.5MB
    ==> Installing python@3.11 dependency: xz
    ==> Pouring xz--5.4.3.arm64_ventura.bottle.tar.gz
    🍺  /opt/homebrew/Cellar/xz/5.4.3: 162 files, 2.6MB
    ==> Installing python@3.11
    ==> Pouring python@3.11--3.11.4_1.arm64_ventura.bottle.1.tar.gz
    ==> /opt/homebrew/Cellar/python@3.11/3.11.4_1/bin/python3.11 -Im ensurepip
    ==> /opt/homebrew/Cellar/python@3.11/3.11.4_1/bin/python3.11 -Im pip install -v 
    ==> Caveats
    Python has been installed as
      /opt/homebrew/bin/python3
     
    Unversioned symlinks `python`, `python-config`, `pip` etc. pointing to
    `python3`, `python3-config`, `pip3` etc., respectively, have been installed into
      /opt/homebrew/opt/python@3.11/libexec/bin
     
    You can install Python packages with
      pip3 install <package>
    They will install into the site-package directory
      /opt/homebrew/lib/python3.11/site-packages
     
    tkinter is no longer included with this formula, but it is available separately:
      brew install python-tk@3.11
     
    gdbm (`dbm.gnu`) is no longer included in this formula, but it is available separately:
      brew install python-gdbm@3.11
    `dbm.ndbm` changed database backends in Homebrew Python 3.11.
    If you need to read a database from a previous Homebrew Python created via `dbm.ndbm`,
    you'll need to read your database using the older version of Homebrew Python and convert to another format.
    `dbm` still defaults to `dbm.gnu` when it is installed.
     
    For more information about Homebrew and Python, see: https://docs.brew.sh/Homebrew-and-Python
    ==> Summary
    🍺  /opt/homebrew/Cellar/python@3.11/3.11.4_1: 3,287 files, 61.9MB
    ==> Running `brew cleanup python@3.11`...
    Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
    Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
    ==> Caveats
    ==> python@3.11
    Python has been installed as
      /opt/homebrew/bin/python3
     
    Unversioned symlinks `python`, `python-config`, `pip` etc. pointing to
    `python3`, `python3-config`, `pip3` etc., respectively, have been installed into
      /opt/homebrew/opt/python@3.11/libexec/bin
     
    You can install Python packages with
      pip3 install <package>
    They will install into the site-package directory
      /opt/homebrew/lib/python3.11/site-packages
     
    tkinter is no longer included with this formula, but it is available separately:
      brew install python-tk@3.11
     
    gdbm (`dbm.gnu`) is no longer included in this formula, but it is available separately:
      brew install python-gdbm@3.11
    `dbm.ndbm` changed database backends in Homebrew Python 3.11.
    If you need to read a database from a previous Homebrew Python created via `dbm.ndbm`,
    you'll need to read your database using the older version of Homebrew Python and convert to another format.
    `dbm` still defaults to `dbm.gnu` when it is installed.
     
    For more information about Homebrew and Python, see: https://docs.brew.sh/Homebrew-and-Python
    Puis, j'ai réinstaller numpy

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    pip3 install numpy
    Requirement already satisfied: numpy in ./anaconda3/lib/python3.11/site-packages (1.25.2)
    Enfin j'ai relancé mon programme et j'ai de nouveau l'erreur qui mentionnée plus haut.

  8. #8
    Expert éminent
    Homme Profil pro
    Architecte technique retraité
    Inscrit en
    Juin 2008
    Messages
    21 777
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Manche (Basse Normandie)

    Informations professionnelles :
    Activité : Architecte technique retraité
    Secteur : Industrie

    Informations forums :
    Inscription : Juin 2008
    Messages : 21 777
    Par défaut
    Si j'écris ré-installer numpy, ça ne veut pas dire ré-installer python.
    De plus, l'installation de numpy dit qu'il est déjà installé... (et ça ne ré-installe rien. Du coup on ne sait pas la mouture qu'il installe).
    Pour désinstaller un package, il y a pip uninstall (et un help qui vient avec pip qu'il peut être intéressant d'explorer pour voir ce qu'on peut faire avec...)

    - W
    Architectures post-modernes.
    Python sur DVP c'est aussi des FAQs, des cours et tutoriels

  9. #9
    Membre à l'essai
    Homme Profil pro
    Enseignant Chercheur
    Inscrit en
    Août 2023
    Messages
    5
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 49
    Localisation : France, Gironde (Aquitaine)

    Informations professionnelles :
    Activité : Enseignant Chercheur
    Secteur : Enseignement

    Informations forums :
    Inscription : Août 2023
    Messages : 5
    Par défaut
    Citation Envoyé par wiztricks Voir le message
    Si j'écris ré-installer numpy, ça ne veut pas dire ré-installer python.
    De plus, l'installation de numpy dit qu'il est déjà installé... (et ça ne ré-installe rien. Du coup on ne sait pas la mouture qu'il installe).
    Pour désinstaller un package, il y a pip uninstall (et un help qui vient avec pip qu'il peut être intéressant d'explorer pour voir ce qu'on peut faire avec...)

    - W
    Je viens de désintaller le numpy et je l'ai réinstallé. Il y avait un certain nombre de versions de packages à installer en faisant attention aux versions. Il m'a fait installé NumPy 1.23.3 par exemple. Ensuite, numpy marchait dans le bash via python3 mais ne marchait pas dans pyzo. Il se trouve que pyzo lance automatiquement la version 1.25.2 qui n'est pas compatible avec mon système.

    Je tiens à vous remercier pour ces échanges qui m'ont guidé vers la solution.

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Réponses: 5
    Dernier message: 14/08/2017, 15h51
  2. Réponses: 2
    Dernier message: 24/07/2009, 11h07
  3. impossible d'installer linux sur mon pc
    Par 123quatre dans le forum Windows Vista
    Réponses: 2
    Dernier message: 02/04/2008, 19h50
  4. impossible d'utiliser Vista sur batterie
    Par ilood dans le forum Windows Vista
    Réponses: 4
    Dernier message: 05/07/2007, 12h11
  5. Impossible de démarrer mySql sur mon ordi
    Par tarzanjane dans le forum Installation
    Réponses: 12
    Dernier message: 05/03/2006, 17h01

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo