python在做travis ci的时候的问题
PHPz
PHPz 2017-04-18 09:56:05
0
1
668

Hi all.在build python ci的时候出错,提示无法找到模块, 下面是job log. 我的requirements.txt 为:


argparse
coloredlogs
importlib
unittest

Worker information
hostname: travis-worker-gce-org-prod4-8:c6b27b1f-8fa2-4741-9006-bcbad1a529a0
version: v2.3.1-34-g4ab376b https://github.com/travis-ci/worker/tree/xxx
instance: testing-gce-ebf94c1c-3cfe-45c2-a652-3dcf9d85561e:travis-ci-python-precise-1471814219
startup: 21.421705561s
system_info
Build system information
Build language: python
Build group: stable
Build dist: precise
Build id: 166945997
Job id: 166945998
travis-build version: c31595e05
Build image provisioning date and time
Sun Aug 21 21:35:17 UTC 2016
Operating System Details
Distributor ID:    Ubuntu
Description:    Ubuntu 12.04.5 LTS
Release:    12.04
Codename:    precise
Linux Version
3.13.0-92-generic
Cookbooks Version
f77e708 https://github.com/travis-ci/travis-cookbooks/tree/xx
Git version
git version 1.8.5.6
bash version
GNU bash, version 4.2.25(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
GCC version
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
LLVM version
clang version 3.4 (tags/RELEASE_34/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
Pre-installed Ruby versions
ruby-2.2.5
Pre-installed Node.js versions
v0.10.36
Pre-installed Go versions
1.4.2
mysql --version
mysql  Ver 14.14 Distrib 5.5.50, for debian-linux-gnu (x86_64) using readline 6.2
Pre-installed PostgreSQL versions
9.1.23
9.2.18
9.3.14
9.4.9
Redis version
redis-server 3.0.6
riak version
2.0.2
memcached version
1.4.13
MongoDB version
MongoDB 2.4.14
CouchDB version
couchdb 1.6.1
Neo4j version
1.9.4
Cassandra version
2.0.9
ElasticSearch version
1.4.0
Installed Sphinx versions
2.0.10
2.1.9
2.2.6
Default Sphinx version
2.2.6
Installed Firefox version
firefox 38.4.0esr
PhantomJS version
1.9.8
ant -version
Apache Ant(TM) version 1.8.2 compiled on December 3 2011
mvn -version
Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14T17:29:23+00:00)
Maven home: /usr/local/maven
Java version: 1.7.0_80, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-oracle/jre
Default locale: en, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-92-generic", arch: "amd64", family: "unix"
fix.CVE-2015-7547
$ export DEBIAN_FRONTEND=noninteractive
Reading package lists...
Building dependency tree...
Reading state information...
libc6 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 69 not upgraded.
git.checkout
0.74s$ git clone --depth=50 --branch=master https://github.com/xxxx/xxxx.git xxxx/xxxx
Cloning into 'xxxx/xxxx'...
remote: Counting objects: 203, done.
remote: Compressing objects: 100% (62/62), done.
Receiving objects:  52% (106remote: Total 203 (delta 34), reused 0 (delta 0), pack-reused 140
Receiving objects: 100% (203/203), 39.62 KiB | 0 bytes/s, done.
Resolving deltas: 100% (113/113), done.
Checking connectivity... done.
$ cd xxxx/xxxx
$ git checkout -qf 1d9404346d2b8508c3aecb1a51a25c3b6fe8c243
NaNs$ source ~/virtualenv/python3.5/bin/activate
$ python --version
Python 3.5.2
$ pip --version
pip 8.1.2 from /home/travis/virtualenv/python3.5.2/lib/python3.5/site-packages (python 3.5)
install.1
0.97s$ pip3 install .
Processing /home/travis/build/xxxx/xxxx
Installing collected packages: passme
  Running setup.py install for passme ... done
Successfully installed passme-1.0.0
0.66s$ pip3 install -r requirements.txt
Collecting argparse (from -r requirements.txt (line 1))
  Downloading argparse-1.4.0-py2.py3-none-any.whl
Collecting coloredlogs (from -r requirements.txt (line 2))
  Downloading coloredlogs-5.1.1-py2.py3-none-any.whl
Collecting importlib (from -r requirements.txt (line 3))
  Downloading importlib-1.0.4.zip
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/home/travis/virtualenv/python3.5.2/lib/python3.5/site-packages/setuptools/__init__.py", line 4, in <module>
        import distutils.core
      File "/home/travis/virtualenv/python3.5.2/lib/python3.5/distutils/__init__.py", line 4, in <module>
        import imp
      File "/home/travis/virtualenv/python3.5.2/lib/python3.5/imp.py", line 19, in <module>
        from importlib._bootstrap import _ERR_MSG, _exec, _load, _builtin_from_name
    ImportError: No module named 'importlib._bootstrap'
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-o6ity2w_/importlib/
The command "pip3 install -r requirements.txt" failed and exited with 1 during .
Your build has been stopped.
PHPz
PHPz

学习是最好的投资!

모든 응답(1)
洪涛

importlib 1.0.4

Python 2.7의 importlib.import_module() 백포트

목적

이 패키지에는 Python 2.7에 있는 importlib의 코드가 포함되어 있습니다.
Python 2.7 이전 버전이나
에서
importlib.import_module()을 사용하려는 사람들을 위해 제공됩니다. 3.0에는 쉽게 사용할 수 있는 기능이 있습니다. 코드는 Python 2.7 표준 라이브러리에서 찾을 수 있는 것과 전혀 다르지 않습니다.

필요한 importlib이 무엇인지 실제로 알고 있는지 잘 모르겠습니다. 이는 2.7 및 3.0 이하의 Python 버전에만 적용됩니다. ci에 사용하고 있는 환경은 버전 3.5입니다. 이 패키지는 이미 importlib과 함께 제공되므로 추가 요구 사항이 필요하지 않습니다.

요구사항에서 이 모듈을 제거하거나 테스트에 필요한 Python 버전을 지정하세요.

최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!