jeffreywildman / homebrew-virt-manager

A set of homebrew formulae to install virt-manager and virt-viewer on MAC OSX
1k stars 266 forks source link

ImportError: No module named zlib #109

Closed azinman closed 4 years ago

azinman commented 5 years ago

I'm unable to install virt-manager. It seems to install all the dependencies just fine, including python, but then it's a python that's been compiled without zlib?


Already downloaded: /Users/aaron/Library/Caches/Homebrew/downloads/49a6fae80d7f5d42b62e4525d98c6dee6f468e449b14010f904749f87cf7b0f5--virt-manager-1.5.1.tar.gz
==> Patching
patching file virt-manager
==> Downloading https://files.pythonhosted.org/packages/33/bc/fa0b5347139cd9564f0d44ebd2b147ac97c36b2403943dbee8a25fd74012/virtualenv-16.0.0.tar.gz
Already downloaded: /Users/aaron/Library/Caches/Homebrew/downloads/02e9f856894cc3f1979f2bf31e2f709c30ef64ea80ce14a80cc83e384528d06f--virtualenv-16.0.0.tar.gz
==> python -c import setuptools... --no-user-cfg install --prefix=/private/tmp/virt-manager--homebrew-virtualenv-20181109-33367-zt9hdk/target --install-scripts=/private/tmp/virt-manager--homebrew-virtuale
==> python -s /private/tmp/virt-manager--homebrew-virtualenv-20181109-33367-zt9hdk/target/bin/virtualenv -p python /usr/local/Cellar/virt-manager/1.5.1_3/libexec
Last 15 lines from /Users/aaron/Library/Logs/Homebrew/virt-manager/02.python:

Traceback (most recent call last):
  File "/private/tmp/virt-manager--homebrew-virtualenv-20181109-33367-zt9hdk/target/bin/virtualenv", line 11, in <module>
    load_entry_point('virtualenv==16.0.0', 'console_scripts', 'virtualenv')()
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 484, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2714, in load_entry_point
    return ep.load()
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2332, in load
    return self.resolve()
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2338, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/private/tmp/virt-manager--homebrew-virtualenv-20181109-33367-zt9hdk/target/lib/python2.7/site-packages/virtualenv.py", line 22, in <module>
    import zlib
ImportError: No module named zlib

If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
https://github.com/jeffreywildman/homebrew-virt-manager/issues```
asolochek commented 5 years ago

I just ran into the same problem. This is on macOS 10.14.1. To get it working I first had to manually download the XCode command line tools for XCode 10.1 from developer.apple.com. I installed those, and then followed these instructions: https://holgr.com/fixing-python-zlib-errors-in-macos-mojave-beta/

Those instructions allowed me to finally install vert-manager.

Manually downloading the command line tools was for getting the macOS_SDK_headers_for_macOS_10.14.pkg file, but I believe there may be other ways that don't require a developer account.

swejun commented 5 years ago

I managed to get Xcode Command line tools by runningxcode-select --install and was prompted for installation in the xcode gui popup. After this the brew reinstall python@2and brew reinstall virtmanager was successful.

jeffreywildman commented 5 years ago

The original error regarding python seems to indicate that python2 is in use. The virt-manager formula has since been converted to python3. Is this still an issue?

FYI for follow on comments, CLT for Xcode is a requirement for Homebrew in general: https://docs.brew.sh/Installation#macos-requirements

jeffreywildman commented 4 years ago

Closing since virt-manager formula has moved away from python2 and is at version 2.2.1.