我在TravisCI上使用python 2.7.11,我想配置TravisCI正常工作。但是travis CI失败了
import mysql.connector
我尝试过添加
pip install mysql-connector-python==2.1.3 --allow-external mysql-connector-python
到我的.travis.yml。但是,travisCI报告
--allow-external
已弃用且无效。如果我将其删除
--allow-external
它仍然失败。此外,无论我将它更改为什么版本,它也永远不会安装mysql-connector-python。
有谁知道如何配置我的.travis.yml以使TravisCI与mysql.connector一起使用?
这是完整档案:
language: python
python:
- 2.7.11
install: pip install pymongo Flask flask-cors tornado coverage codeclimate-test-reporter ddt mysql-connector-python==2.1.3
script:
- python -m unittest discover tests
notifications:
slack:
secure: BfAdqax8+zJtKeAOiQyfpOzoYIzmpYIfNFyHxp04mZ79YS6N2NIFAJfkjsqCLw0qC4acjmX4Dy1VTIFylwgqB9tcDBDGX12AJar8llfzsQOheA1mo6dxEC7m4EJ9H7vXnCu78z8PvNta52IPg6JNSg4qnppQ96QoJitsZau1N78ItsdXmFiWv8z/7db+s71sUvLWJ/iTZ0J9KjcYA/YVlBnCDH76K4YuXp5GxH45310kmhTNb31PKhpGAl93pq6ayjV2HoDaSO+jbW70xuL6CR34MAislVmQYItfpmMVCY77I/GKzgt/wk0Rznhh1G8xofS1z3peYOgVgSI0SQ0hL2v9pieqJK7Mlmovm1SfuUG394HKan7mUzUvdCzvsC6wv4gRImrbwKB51eEM+TAICG2OxwIRZslY5sehVwT67YLf5p5Hzrjo7LL5G+0XZOe3IsQP/6MrSaCBC5V0FxoIKJnnOpNHvHJq+Ku3wUTLKobzc0pbgdJ73E3DM9BSQ6sq087qRT6YRWI1WbasZ6puvgs92wtuGFRrsMGqQ3sreorlN6rYsMu7dv8pJs4+sBn1lA8/P2BzvyRlbSTTCjfCAqNqXGiEXfunN/BkRn8HnA1x/P6LmItwZUXtv7LzQIRvtJxGyc3Sg0krRqBG2Urka6uepJjc7Sd0PMPSjxzzy+I=
addons:
code_climate:
repo_token:
secure: h19Nm48/J3+BGrfiG90hgmUaA/oiIYxTpFutQYB8Dm7SV9RHW02ypvpS8B81Ne4WxHZE1DmrO1KUqEQ3j2IH27gjidwci32Wjuv7C8ikOzQ/F0lFt0ydkKQH1NZJQCqQJOYnJSiM95fRKQOWgK0pM2et/5m3Pr9fXnffKYaE2Yhv+zKbcy0wmCiT8n1aMgxs714KcMAcqR1kptEid122ORssawzfkJBewM6Z6RXlUq8EeU86UIllk5eBPMCUso7BSEWl6jptjeyWGo/6/NkE06+XBSkvM5VEdAAA0rUh3n41SZVWo0SegFmE+HZegjE6w76XWcTrbVLZNTSN1jqdZTaPhq+9TB0OqGJp28bziYkVxY9Z2Yd0OacyGlGmdBwkrIEtmA0Wjiubbx96P95m3AEwYJlyYWxUGV8HSJFn1pH9KMb6Ewc+/rCeA5o4f8+r098aqtnNNzxpWaxAn0Up//GVPlH74SiyfHMrd/+uTFC9TCtAazHq4GLiJrESoVaapXTY9XabIGE205NxfQ6PIRPfsFjK0cH5BR0ZkJt5EspEHc7HgAIn0kotuJYgAJ64hcfOimeSTDBSBn138TDJTscTjpZrOl0LYXChhcuTH2MOx2nS/4miKHteFW8mOSuoVaunQHt9+8HDlRrD8n48lm/qYkh8jG1UnPBW7iqKxtI=
答案 0 :(得分:1)
在我看来,可能不会在PyPI上托管2.1.2:https://pypi.python.org/pypi/mysql-connector-python只显示2.0.4和1.x。
I cannot install mysql-connector-python using pip让我相信软件包维护者可能无法正确发布到PyPI。
尝试使用已知的工作包下载URL替换包名称?例如。 https://cdn.mysql.com/Downloads/Connector-Python/mysql-connector-python-2.1.2.tar.gz? (截至撰写本文时,最新版本为2.1.3 - 可能也可通过CDN获得。)
或者,尝试降级到2.0.4 - 在PyPI上 :https://pypi.python.org/pypi/mysql-connector-python/2.0.4。