[PYTHON] [Résolu] ImportError: Aucun module nommé pyexpat et pyenv install n'est moss

~~ Je suis désolé. Il n’est toujours pas résolu. Si vous l'avez résolu par le passé, j'apprécierais que vous me donniez quelques conseils. ~~

Il semble qu'il a bougé d'une manière ou d'une autre.

Comment réparer

Maintenant ça marche! https://github.com/yyuu/pyenv/issues/448#issuecomment-220652296

export CFLAGS="-I$(brew --prefix openssl)/include"
export LDFLAGS="-L$(brew --prefix openssl)/lib -L$(brew --prefix sqlite3)/lib"
export CPPFLAGS="-I$(brew --prefix sqlite3)/include"

Mais je ne sais pas pourquoi cela n'a pas fonctionné et pourquoi cela a été corrigé. .. ..

Le processus suivant

J'ai eu une erreur en essayant d'installer 3.5.2 avec pyenv

$ pyenv install 3.5.2
Installing Python-3.5.2...

BUILD FAILED (OS X 10.12.1 using python-build 20160602)

Inspect or clean up the working tree at /var/folders/g5/b_nhsv5546g9pf7_k7xynpxw0000gn/T/python-build.20161103191050.41922
Results logged to /var/folders/g5/b_nhsv5546g9pf7_k7xynpxw0000gn/T/python-build.20161103191050.41922.log

Last 10 log lines:
    import pip
  File "/var/folders/g5/b_nhsv5546g9pf7_k7xynpxw0000gn/T/tmp3hlbqezp/pip-8.1.1-py2.py3-none-any.whl/pip/__init__.py", line 14, in <module>
  File "/var/folders/g5/b_nhsv5546g9pf7_k7xynpxw0000gn/T/tmp3hlbqezp/pip-8.1.1-py2.py3-none-any.whl/pip/utils/__init__.py", line 27, in <module>
  File "/var/folders/g5/b_nhsv5546g9pf7_k7xynpxw0000gn/T/tmp3hlbqezp/pip-8.1.1-py2.py3-none-any.whl/pip/_vendor/pkg_resources/__init__.py", line 36, in <module>
  File "/private/var/folders/g5/b_nhsv5546g9pf7_k7xynpxw0000gn/T/python-build.20161103191050.41922/Python-3.5.2/Lib/plistlib.py", line 65, in <module>
    from xml.parsers.expat import ParserCreate
  File "/private/var/folders/g5/b_nhsv5546g9pf7_k7xynpxw0000gn/T/python-build.20161103191050.41922/Python-3.5.2/Lib/xml/parsers/expat.py", line 4, in <module>
    from pyexpat import *
ImportError: No module named 'pyexpat'
make: *** [install] Error 1

Même sur github, il a été dit: "Parce que c'est du silane cassé"

ImportError: No module named pyexpat · Issue #544 · yyuu/pyenv

Pyenv n'est-il pas mal installé via homebrew?

Je veux faire quelque chose qui n'était pas là une fois.

Effaçons PYENV_ROOT

$ echo $PYENV_ROOT
/usr/local/var/pyenv
$ rm -r /usr/local/var/pyenv

Pour le moment, essayez d'effacer l'association qui a été entrée via infusion

$ brew uninstall pyenv python

Réinstaller pyenv

$ brew install pyenv

3.5.2 Relancer l'installation

$ pyenv install 3.5.2

Non, ce n'est pas bon!


Downloading Python-3.5.2.tar.xz...
-> https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tar.xz
Installing Python-3.5.2...

BUILD FAILED (OS X 10.12.1 using python-build 20160602)

Inspect or clean up the working tree at /var/folders/g5/b_nhsv5546g9pf7_k7xynpxw0000gn/T/python-build.20161103193542.66147
Results logged to /var/folders/g5/b_nhsv5546g9pf7_k7xynpxw0000gn/T/python-build.20161103193542.66147.log

Last 10 log lines:
    import pip
  File "/var/folders/g5/b_nhsv5546g9pf7_k7xynpxw0000gn/T/tmpsbqryzv7/pip-8.1.1-py2.py3-none-any.whl/pip/__init__.py", line 14, in <module>
  File "/var/folders/g5/b_nhsv5546g9pf7_k7xynpxw0000gn/T/tmpsbqryzv7/pip-8.1.1-py2.py3-none-any.whl/pip/utils/__init__.py", line 27, in <module>
  File "/var/folders/g5/b_nhsv5546g9pf7_k7xynpxw0000gn/T/tmpsbqryzv7/pip-8.1.1-py2.py3-none-any.whl/pip/_vendor/pkg_resources/__init__.py", line 36, in <module>
  File "/private/var/folders/g5/b_nhsv5546g9pf7_k7xynpxw0000gn/T/python-build.20161103193542.66147/Python-3.5.2/Lib/plistlib.py", line 65, in <module>
    from xml.parsers.expat import ParserCreate
  File "/private/var/folders/g5/b_nhsv5546g9pf7_k7xynpxw0000gn/T/python-build.20161103193542.66147/Python-3.5.2/Lib/xml/parsers/expat.py", line 4, in <module>
    from pyexpat import *
ImportError: No module named 'pyexpat'
make: *** [install] Error 1

Configurer CFLAGS et réessayer

Reportez-vous ici ...

Python 3.4.2 doesn't build on OS X 10.10 Yosemite · Issue #298 · yyuu/pyenv

$ CFLAGS="-I$(xcrun --show-sdk-path)/usr/include" pyenv install 3.5.2
Downloading Python-3.5.2.tar.xz...
-> https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tar.xz
Installing Python-3.5.2...

BUILD FAILED (OS X 10.12.1 using python-build 20160602)

Inspect or clean up the working tree at /var/folders/g5/b_nhsv5546g9pf7_k7xynpxw0000gn/T/python-build.20161103193925.80736
Results logged to /var/folders/g5/b_nhsv5546g9pf7_k7xynpxw0000gn/T/python-build.20161103193925.80736.log

Last 10 log lines:
    import pip
  File "/var/folders/g5/b_nhsv5546g9pf7_k7xynpxw0000gn/T/tmp7cp6pxz_/pip-8.1.1-py2.py3-none-any.whl/pip/__init__.py", line 14, in <module>
  File "/var/folders/g5/b_nhsv5546g9pf7_k7xynpxw0000gn/T/tmp7cp6pxz_/pip-8.1.1-py2.py3-none-any.whl/pip/utils/__init__.py", line 27, in <module>
  File "/var/folders/g5/b_nhsv5546g9pf7_k7xynpxw0000gn/T/tmp7cp6pxz_/pip-8.1.1-py2.py3-none-any.whl/pip/_vendor/pkg_resources/__init__.py", line 36, in <module>
  File "/private/var/folders/g5/b_nhsv5546g9pf7_k7xynpxw0000gn/T/python-build.20161103193925.80736/Python-3.5.2/Lib/plistlib.py", line 65, in <module>
    from xml.parsers.expat import ParserCreate
  File "/private/var/folders/g5/b_nhsv5546g9pf7_k7xynpxw0000gn/T/python-build.20161103193925.80736/Python-3.5.2/Lib/xml/parsers/expat.py", line 4, in <module>
    from pyexpat import *
ImportError: No module named 'pyexpat'
make: *** [install] Error 1

Cela va-t-il changer ...

Le système Something 2 est déjà en mousse

 $ pyenv install 2.7.12
Downloading Python-2.7.12.tar.xz...
-> https://www.python.org/ftp/python/2.7.12/Python-2.7.12.tar.xz
Installing Python-2.7.12...
WARNING: The Python readline extension was not compiled. Missing the GNU readline lib?
Installing pip from https://bootstrap.pypa.io/get-pip.py...
error: failed to install pip via get-pip.py

BUILD FAILED (OS X 10.12.1 using python-build 20160602)

Inspect or clean up the working tree at /var/folders/g5/b_nhsv5546g9pf7_k7xynpxw0000gn/T/python-build.20161103194730.10697
Results logged to /var/folders/g5/b_nhsv5546g9pf7_k7xynpxw0000gn/T/python-build.20161103194730.10697.log

Last 10 log lines:
    info = _mac_ver_xml()
  File "/usr/local/var/pyenv/versions/2.7.12/lib/python2.7/platform.py", line 739, in _mac_ver_xml
    pl = plistlib.readPlist(fn)
  File "/usr/local/var/pyenv/versions/2.7.12/lib/python2.7/plistlib.py", line 78, in readPlist
    rootObject = p.parse(pathOrFile)
  File "/usr/local/var/pyenv/versions/2.7.12/lib/python2.7/plistlib.py", line 401, in parse
    from xml.parsers.expat import ParserCreate
  File "/usr/local/var/pyenv/versions/2.7.12/lib/python2.7/xml/parsers/expat.py", line 4, in <module>
    from pyexpat import *
ImportError: No module named pyexpat

Recommended Posts

[Résolu] ImportError: Aucun module nommé pyexpat et pyenv install n'est moss
python / netCDF / CentOS 6.8> ImportError: Aucun module nommé netCDF4> sudo yum install netcdf4-python.x86_64
python> import seiral> ImportError: aucun module nommé serial
Installez pyenv et pyenv-virtualenv
Résoudre aucun module nommé tkinter
Django, nginx, uWSGI, virtualenv ImportError: aucun module nommé site Solution Note
Playbook Ansible pour installer et configurer `pyenv`
Le mur pour mettre OpenCV 3.1.0 dans raspberry pi 3 et exécuter l'exemple en python3: ImportError: Aucun module nommé solution cv2