Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python and python@2 can build on Mac 10.14, but zlib is not found, which breaks pip #29176

Closed
6 tasks done
jnozsc opened this issue Jun 18, 2018 · 10 comments
Closed
6 tasks done
Labels
outdated PR was locked due to age

Comments

@jnozsc
Copy link
Contributor

jnozsc commented Jun 18, 2018

Please note we will close your issue without comment if you delete, do not read or do not fill out the issue checklist below and provide ALL the requested information. If you repeatedly fail to use the issue template, we will block you from ever submitting issues to Homebrew again.

  • are reporting a bug others will be able to reproduce and not asking a question. If you're not sure or want to ask a question do so on our Discourse: https://discourse.brew.sh
  • have a problem with brew install (or upgrade, reinstall) a single, official formula (not cask)? If it's a general brew problem please file this issue at Homebrew/brew: https://github.com/Homebrew/brew/issues/new/choose. If it's a brew cask problem please file this issue at https://github.com/Homebrew/homebrew-cask/issues/new/choose. If it's a tap (e.g. Homebrew/homebrew-php) problem please file this issue at the tap.
  • ran brew update and can still reproduce the problem?
  • ran brew doctor, fixed all issues and can still reproduce the problem?
  • ran brew gist-logs <formula> (where <formula> is the name of the formula that failed) and included the output link?
  • if brew gist-logs didn't work: ran brew config and brew doctor and included their output with your issue?

To help us debug your issue please explain:

  • What you were trying to do (and why)
    I do brew upgrade today, and python@2 and python, which previously install on Mac 10.13, get updated and build with 10.14 environment

  • What happened (include command output)
    After the install finish without any error,
    when I run python or python3, it still works
    but when I run pip or pip3, I get the following error message

Traceback (most recent call last):
  File "/usr/local/bin/pip3", line 11, in <module>
    load_entry_point('pip==10.0.1', 'console_scripts', 'pip3')()
  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 476, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2700, in load_entry_point
    return ep.load()
  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2318, in load
    return self.resolve()
  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2324, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/local/lib/python3.6/site-packages/pip/_internal/__init__.py", line 20, in <module>
    from pip._vendor.urllib3.exceptions import DependencyWarning
  File "/usr/local/lib/python3.6/site-packages/pip/_vendor/urllib3/__init__.py", line 8, in <module>
    from .connectionpool import (
  File "/usr/local/lib/python3.6/site-packages/pip/_vendor/urllib3/connectionpool.py", line 36, in <module>
    from .response import HTTPResponse
  File "/usr/local/lib/python3.6/site-packages/pip/_vendor/urllib3/response.py", line 3, in <module>
    import zlib
ModuleNotFoundError: No module named 'zlib'
  • What you expected to happen
    pip and pip3 should work

  • Step-by-step reproduction instructions (by running brew install commands)
    here is my brew gist-logs python 's output

https://gist.github.com/jnozsc/afa4e8d3d7e8b827ddc009e482560bb2

I assume this maybe related with Homebrew/brew#4335 , but I tried to rebuild either python@2 or pyhon with this branch, still not work

@ilovezfs
Copy link
Contributor

You have the CLT headers installed so I'm not sure how Homebrew/brew#4335 would be relevant.

@mistydemeo
Copy link
Member

Hm, I can't reproduce this on the master branch of both Homebrew and homebrew-core.

Was your first test on the latest commit of master for Homebrew and homebrew-core? Is there a file named /usr/include/zlib.h?

@jnozsc
Copy link
Contributor Author

jnozsc commented Jun 19, 2018

I tried reinstall everything this morning after upgrade to 10.14 developer preview 2, it seems I can not reproduce this issue either. I think I may mess up my environment before.

Close due to unable to reproduce

@jnozsc jnozsc closed this as completed Jun 19, 2018
@sfdye
Copy link

sfdye commented Jun 20, 2018

I have the same issue with zlib not found.

This worked for me:

  1. brew update
  2. (Re)Install CLT. installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
  3. brew reinstall python@2

@zedtux
Copy link
Contributor

zedtux commented Jun 21, 2018

I'm able to reproduce this issue, even with the Beta 2.

If I can help, please let me know what I can do.

@zedtux
Copy link
Contributor

zedtux commented Jun 21, 2018

I followed instructions from @sfdye and python@2 was successfully installed, which also solved my issue from #29245. 🎉

@narner
Copy link

narner commented Jun 28, 2018

I'm currently having the same issue - have tried the instructions from @sfdye that @zedtux said they got working. Currently getting the following error after brew reinstall Python@2:

==> Reinstalling python@2 
==> Downloading https://www.python.org/ftp/python/2.7.15/Python-2.7.15.tar.xz
Already downloaded: /Users/nicholasarner/Library/Caches/Homebrew/python@2-2.7.15.tar.xz
==> ./configure --prefix=/usr/local/Cellar/python@2/2.7.15_1 --enable-ipv6 --datarootdir=/usr/l
==> make
==> make install PYTHONAPPSDIR=/usr/local/Cellar/python@2/2.7.15_1
==> make frameworkinstallextras PYTHONAPPSDIR=/usr/local/Cellar/python@2/2.7.15_1/share/python@
==> Downloading https://files.pythonhosted.org/packages/1a/04/d6f1159feaccdfc508517dba1929eb93a
Already downloaded: /Users/nicholasarner/Library/Caches/Homebrew/python@2--setuptools-39.2.0.zip
==> Downloading https://files.pythonhosted.org/packages/ae/e8/2340d46ecadb1692a1e455f13f75e596d
Already downloaded: /Users/nicholasarner/Library/Caches/Homebrew/python@2--pip-10.0.1.tar.gz
==> Downloading https://files.pythonhosted.org/packages/2a/fb/aefe5d5dbc3f4fe1e815bcdb05cbaab19
Already downloaded: /Users/nicholasarner/Library/Caches/Homebrew/python@2--wheel-0.31.1.tar.gz
==> make html
Last 15 lines from /Users/nicholasarner/Library/Logs/Homebrew/python@2/05.make:
    return build_main(argv)
  File "/usr/local/Cellar/sphinx-doc/1.7.5_1/libexec/lib/python2.7/site-packages/sphinx/cmd/build.py", line 22, in build_main
    from sphinx import cmdline
  File "/usr/local/Cellar/sphinx-doc/1.7.5_1/libexec/lib/python2.7/site-packages/sphinx/cmdline.py", line 23, in <module>
    from sphinx.application import Sphinx
  File "/usr/local/Cellar/sphinx-doc/1.7.5_1/libexec/lib/python2.7/site-packages/sphinx/application.py", line 29, in <module>
    from sphinx.config import Config
  File "/usr/local/Cellar/sphinx-doc/1.7.5_1/libexec/lib/python2.7/site-packages/sphinx/config.py", line 21, in <module>
    from sphinx.util import logging
  File "/usr/local/Cellar/sphinx-doc/1.7.5_1/libexec/lib/python2.7/site-packages/sphinx/util/__init__.py", line 33, in <module>
    from sphinx.util import logging
  File "/usr/local/Cellar/sphinx-doc/1.7.5_1/libexec/lib/python2.7/site-packages/sphinx/util/logging.py", line 106, in <module>
    class SphinxLoggerAdapter(logging.LoggerAdapter):
AttributeError: 'module' object has no attribute 'LoggerAdapter'
make: *** [build] Error 1

Do not report this issue to Homebrew/brew or Homebrew/core!

These open issues may also help:
python 3.7.0 https://github.com/Homebrew/homebrew-core/pull/29490
python upgrade failing https://github.com/Homebrew/homebrew-core/issues/29214
app-engine-python 1.9.70 https://github.com/Homebrew/homebrew-core/pull/28858
molecule: Use correct `docker` python package dependency https://github.com/Homebrew/homebrew-core/pull/28635
[root] formula does not link against python@2 correctly. https://github.com/Homebrew/homebrew-core/issues/29377
clingo add support for lua, use python 3 https://github.com/Homebrew/homebrew-core/pull/28057
OSError: [Errno 1] Operation not permitted for python@2 –with-tcl-tk https://github.com/Homebrew/homebrew-core/issues/28168

Error: You are using macOS 10.14.
We do not provide support for this pre-release version.
You may encounter build failures or other breakages.
Please create pull-requests instead of filing issues.

Error: You are using macOS 10.14.
We do not provide support for this pre-release version.
You may encounter build failures or other breakages.
Please create pull-requests instead of filing issues.

@zedtux
Copy link
Contributor

zedtux commented Jun 29, 2018

@narner you have a complete different issue than what has been reported in this issue. You should open a new one in my opinion.

Sorry for not being helpful 😞

@muammar
Copy link

muammar commented Jun 30, 2018

I am getting the same problem. I upgraded to Mojave beta public preview. Reinstalling python2 as suggested by @sfdye didn't work for me. As pointed out by @mistydemeo, I don't have /usr/include/zlib.h file present on my installation:

muammar@zarathustra ~
  % file /usr/include/zlib.h                                                                                                                           !10161
/usr/include/zlib.h: cannot open `/usr/include/zlib.h' (No such file or directory)

I proceeded to do a brew install zlib and a brew reinstall python and that did not work either.

@ilovezfs ilovezfs mentioned this issue Jul 1, 2018
6 tasks
@ruchernchong
Copy link
Contributor

@muammar you might want to try it, since there was an issue with a fix referenced after your comment.

@lock lock bot added the outdated PR was locked due to age label Aug 7, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Aug 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

No branches or pull requests

8 participants