Skip to content

builtins import broken in version 0.17.0 #398

Closed

Description

@e-rk

Importing builtins in version 0.17.0 causes error.

>>> import builtins
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named builtins
>>> 

Activity

  1. sylvainduchesne commented on Oct 26, 2018

    @sylvainduchesne

    We have the same issue, but interestingly, if we pip install without cache dir, it works...

    pip install -U --force   future
    >>> import builtins
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    ImportError: No module named builtins
    >>>
    
    pip install -U --force  --no-cache-dir future
    >>> import builtins
    >>>
    
  2. daa commented on Oct 26, 2018

    @daa
    Contributor

    Tell me please haven't you built future wheel with Python-3 and tried to use it with Python-2? If so this may be the cause of issue.

  3. jmadler commented on Oct 27, 2018

    @jmadler
    Contributor

    Sorry folks! This is my first distribution of this particular package (and PyPI as well...)

    When I made the build I ran python setup.py sdist with Py3, and tested pip install dist/future-0.17.0.tgz on both Py2 and Py3 and validated it installed via that mechanism. I conducted install validation by testing a few imports and dir() on the REPL for builtins, reprlib, and future

    Once validated I ran twine upload dist/future-0.17.0.tgz to get it up to PyPI.

    pip2 --version && pip3 --version:

    pip 10.0.1 from /usr/local/lib/python2.7/site-packages/pip (python 2.7)
    pip 18.0 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)

    Another possibility is that the local bdist_wheel is built on Py3 and cached somewhere and treated as universal (when it's not), but I didn't upload a wheel to PyPI.

    I'm unable to repro in an empty venv with pip install future==0.17.0 for Py2 and Py3 on my macOS machine.

    Is it possible that PyPI is rewriting the package somehow? Or perhaps the behavior of pip has changed?

  4. mrquokka commented on Oct 29, 2018

    @mrquokka

    on Windows, removing the cached future 0.17.0 whl from C:\Users\AppData\Local\pip and then re-installing the package fixes it.

    so it looks (It's a theory) like earlier publication of 0.17.0 was broken, but now is fixed.

    I think too. Maybe can someone release 0.17.1 with fix)

  5. sylvainduchesne commented on Oct 29, 2018

    @sylvainduchesne

    Indeed, if the package is installed via py3, it will be cached in the local pip cache. Any future installations of future (beit py2 or py3) will use this cached version as its marked universal.

    However, the setup.py https://github.com/PythonCharmers/python-future/blob/master/setup.py#L61 has that conditional that makes the generated wheel (now in the pip cache) incompatible for py2 (since it was built for py3). I imagine that if the wheel is generated via py2, it could mean bad news for a py3 install.

  6. vphilippon commented on Oct 30, 2018

    @vphilippon
    Contributor

    @jmadler The issue is addressed in master, the only remaining thing would be to merge PR #404 and release v0.17.1

    Right now, with v0.17.0, any user using both Py2 and Py3 on their machine is at risk of getting a bad pip wheel cache and hit this error.

    Is it possible to get a release out ASAP? If you have any questions/concerns, ask away, I'll be happy to help 😃

  7. jmadler commented on Oct 31, 2018

    @jmadler
    Contributor

    Sounds good, I released 0.17.1 with #399 and #404 included. Can you take a look and let me know if it addresses this issue for you?

  8. daa commented on Oct 31, 2018

    @daa
    Contributor

    I had this issue with 0.17.0 and can confirm that 0.17.1 fixed it.

  9. jmadler commented on Oct 31, 2018

    @jmadler
    Contributor

    Glad to hear it!

    Thanks Gilles, Vincent, et al. Your guidance has been super helpful :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions