Edgewall Software
Modify

Opened 2 months ago

Closed 5 weeks ago

#13238 closed defect (fixed)

Travis CI: ImportError: No module named _md5

Reported by: Ryan J Ollos Owned by: Jun Omae
Priority: normal Milestone: 1.0.20
Component: general Version:
Severity: normal Keywords: travis-ci
Cc: Branch:
Release Notes:

Avoid using openssl from homebrew on building Python 2.6 for OSX in Travis CI.

API Changes:

Description (last modified by Ryan J Ollos)

https://travis-ci.org/edgewall/trac/jobs/628381820

$ if [ "$TRAVIS_OS_NAME" = osx ]; then
    test -d $HOME/venv-lib || mkdir $HOME/venv-lib
    eval "$(pyenv init -)"
    pyver_latest="$(pyenv install -l | grep -E "^[ ]*${pyver/./\\.}\.[0-9]+$" | tail -1 | tr -d '[:blank:]')"
    venv="$HOME/venv-$pyver_latest"
    pyenv install --skip-existing $pyver_latest
    pyenv shell $pyver_latest
    pip install --upgrade virtualenv
    python -m virtualenv $venv
    source $venv/bin/activate
  fi
  
Traceback (most recent call last):
  File "/Users/travis/.pyenv/versions/2.6.9/bin/pip", line 7, in <module>
    from pip import main
  File "/Users/travis/.pyenv/versions/2.6.9/lib/python2.6/site-packages/pip/__init__.py", line 21, in <module>
    from pip._vendor.urllib3.exceptions import DependencyWarning
  File "/Users/travis/.pyenv/versions/2.6.9/lib/python2.6/site-packages/pip/_vendor/urllib3/__init__.py", line 8, in <module>
    from .connectionpool import (
  File "/Users/travis/.pyenv/versions/2.6.9/lib/python2.6/site-packages/pip/_vendor/urllib3/connectionpool.py", line 29, in <module>
    from .connection import (
  File "/Users/travis/.pyenv/versions/2.6.9/lib/python2.6/site-packages/pip/_vendor/urllib3/connection.py", line 39, in <module>
    from .util.ssl_ import (
  File "/Users/travis/.pyenv/versions/2.6.9/lib/python2.6/site-packages/pip/_vendor/urllib3/util/__init__.py", line 6, in <module>
    from .ssl_ import (
  File "/Users/travis/.pyenv/versions/2.6.9/lib/python2.6/site-packages/pip/_vendor/urllib3/util/ssl_.py", line 7, in <module>
    from hashlib import md5, sha1, sha256
  File "/Users/travis/.pyenv/versions/2.6.9/lib/python2.6/hashlib.py", line 136, in <module>
    md5 = __get_builtin_constructor('md5')
  File "/Users/travis/.pyenv/versions/2.6.9/lib/python2.6/hashlib.py", line 63, in __get_builtin_constructor
    import _md5
ImportError: No module named _md5
New python executable in /Users/travis/venv-2.6.9/bin/python
Installing setuptools<37, pip, wheel<0.30...
  Complete output from command /Users/travis/venv-2.6.9/bin/python - setuptools<37 pip wheel<0.30:
  Traceback (most recent call last):
  File "<stdin>", line 11, in <module>
  File "/Users/travis/.pyenv/versions/2.6.9/lib/python2.6/site-packages/virtualenv_support/pip-9.0.3-py2.py3-none-any.whl/pip/__init__.py", line 21, in <module>
  File "/Users/travis/.pyenv/versions/2.6.9/lib/python2.6/site-packages/virtualenv_support/pip-9.0.3-py2.py3-none-any.whl/pip/_vendor/urllib3/__init__.py", line 8, in <module>
  File "/Users/travis/.pyenv/versions/2.6.9/lib/python2.6/site-packages/virtualenv_support/pip-9.0.3-py2.py3-none-any.whl/pip/_vendor/urllib3/connectionpool.py", line 29, in <module>
  File "/Users/travis/.pyenv/versions/2.6.9/lib/python2.6/site-packages/virtualenv_support/pip-9.0.3-py2.py3-none-any.whl/pip/_vendor/urllib3/connection.py", line 39, in <module>
  File "/Users/travis/.pyenv/versions/2.6.9/lib/python2.6/site-packages/virtualenv_support/pip-9.0.3-py2.py3-none-any.whl/pip/_vendor/urllib3/util/__init__.py", line 6, in <module>
  File "/Users/travis/.pyenv/versions/2.6.9/lib/python2.6/site-packages/virtualenv_support/pip-9.0.3-py2.py3-none-any.whl/pip/_vendor/urllib3/util/ssl_.py", line 7, in <module>
  File "/Users/travis/.pyenv/versions/2.6.9/lib/python2.6/hashlib.py", line 136, in <module>
    md5 = __get_builtin_constructor('md5')
  File "/Users/travis/.pyenv/versions/2.6.9/lib/python2.6/hashlib.py", line 63, in __get_builtin_constructor
    import _md5
ImportError: No module named _md5
----------------------------------------
...Installing setuptools<37, pip, wheel<0.30...done.
Traceback (most recent call last):
  File "/Users/travis/.pyenv/versions/2.6.9/lib/python2.6/runpy.py", line 122, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/Users/travis/.pyenv/versions/2.6.9/lib/python2.6/runpy.py", line 34, in _run_code
    exec code in run_globals
  File "/Users/travis/.pyenv/versions/2.6.9/lib/python2.6/site-packages/virtualenv.py", line 2349, in <module>
    main()
  File "/Users/travis/.pyenv/versions/2.6.9/lib/python2.6/site-packages/virtualenv.py", line 712, in main
    symlink=options.symlink)
  File "/Users/travis/.pyenv/versions/2.6.9/lib/python2.6/site-packages/virtualenv.py", line 953, in create_environment
    download=download,
  File "/Users/travis/.pyenv/versions/2.6.9/lib/python2.6/site-packages/virtualenv.py", line 904, in install_wheel
    call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=SCRIPT)
  File "/Users/travis/.pyenv/versions/2.6.9/lib/python2.6/site-packages/virtualenv.py", line 796, in call_subprocess
    % (cmd_desc, proc.returncode))
OSError: Command /Users/travis/venv-2.6.9/bin/python - setuptools<37 pip wheel<0.30 failed with error code 1
/Users/travis/.travis/functions: line 118: /Users/travis/venv-2.6.9/bin/activate: No such file or directory
The command "if [ "$TRAVIS_OS_NAME" = osx ]; then
    test -d $HOME/venv-lib || mkdir $HOME/venv-lib
    eval "$(pyenv init -)"
    pyver_latest="$(pyenv install -l | grep -E "^[ ]*${pyver/./\\.}\.[0-9]+$" | tail -1 | tr -d '[:blank:]')"
    venv="$HOME/venv-$pyver_latest"
    pyenv install --skip-existing $pyver_latest
    pyenv shell $pyver_latest
    pip install --upgrade virtualenv
    python -m virtualenv $venv
    source $venv/bin/activate
  fi
  " failed and exited with 1 during .
Your build has been stopped.

Attachments (0)

Change History (8)

comment:1 by Ryan J Ollos, 2 months ago

Description: modified (diff)
Summary: Travis CI Python 2.6: ImportError: No module named _md5Travis CI: ImportError: No module named _md5

comment:2 by Ryan J Ollos, 2 months ago

Also, some problems loading PostgreSQL bindings on 1.0-stable: https://travis-ci.org/edgewall/trac/jobs/628381820

comment:3 by Jun Omae, 7 weeks ago

After cache is deleted, the ImportError has gone. However, PostgreSQL bindings is unable to load yet.

Last edited 7 weeks ago by Jun Omae (previous) (diff)

in reply to:  3 ; comment:4 by Jun Omae, 7 weeks ago

After cache is deleted, the ImportError has gone. However, PostgreSQL bindings is unable to load yet.

Ah, I noticed that pyenv failed to build Python 2.6. Unfortunately, CI was not stopped even failing build Python. It seems that pyenv exits with 0.

https://travis-ci.org/edgewall/trac/jobs/633705000#L177

in reply to:  4 comment:5 by Jun Omae, 7 weeks ago

Replying to Jun Omae:

After cache is deleted, the ImportError has gone. However, PostgreSQL bindings is unable to load yet.

Ah, I noticed that pyenv failed to build Python 2.6. Unfortunately, CI was not stopped even failing build Python. It seems that pyenv exits with 0.

https://travis-ci.org/edgewall/trac/jobs/633705000#L177

Python 2.6 requires openssl 1.0.x but openssl from homebrew is 1.1 now. It is unable to build Python 2.6 with openssl 1.1. I think we have no choice but to remove jobs for python 2.6 on macosx in .travis.yml. Thoughts?

comment:6 by Jun Omae, 7 weeks ago

Owner: set to Jun Omae
Status: newassigned

Python 2.6 is successfully built on Mac OS X in Travis CI and all tests pass.

I'll push the changes if no objections.

comment:7 by Ryan J Ollos, 5 weeks ago

Oh I see. The OSX pyver=2.6 builds are currently passing, but they are actually running against Python 2.7.

No objections to the workaround.

comment:8 by Jun Omae, 5 weeks ago

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Thanks for the reviewing.

Committed in [17232] (1.0-stable) and merged in [17233] (1.2-stable).

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jun Omae.
The resolution will be deleted. Next status will be 'reopened'.
to as closed The owner will be changed from Jun Omae to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.