3

I am using python 2.7.11 on TravisCI and I want to configure TravisCI to work properly. But travis CI fails on

import mysql.connector

I have tried adding

pip install mysql-connector-python==2.1.3 --allow-external mysql-connector-python 

to my .travis.yml. However, travisCI report that

--allow-external

is deprecated and has no effect. If I remove it the

--allow-external

it still fails. Also no matter what version I change it to it also will never install the mysql-connector-python.

Does anyone know how I configure my .travis.yml to get TravisCI to work with mysql.connector?

Here is full file:

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=
Brent
  • 303
  • 3
  • 11

1 Answers1

2

Looks to me like 2.1.2 may not be hosted at PyPI: https://pypi.python.org/pypi/mysql-connector-python only shows 2.0.4 and a 1.x.

I cannot install mysql-connector-python using pip leads me to believe that the package maintainer may not be publishing to PyPI correctly.

Try replacing the package name with a known working package download URL? E.g. https://cdn.mysql.com/Downloads/Connector-Python/mysql-connector-python-2.1.2.tar.gz? (Latest is 2.1.3 as of time of writing - probably also available via CDN.)

Alternatively, try downgrading to 2.0.4 - it is on PyPI: https://pypi.python.org/pypi/mysql-connector-python/2.0.4.

Community
  • 1
  • 1
Mark A. Fitzgerald
  • 1,249
  • 1
  • 9
  • 20
  • 2
    Thanks! I hadn't realized I could use a URL with pip install...here is the line in my .travis.yml updated. This works: install: pip install pymongo Flask flask-cors tornado coverage codeclimate-test-reporter ddt https://cdn.mysql.com/Downloads/Connector-Python/mysql-connector-python-2.1.2.tar.gz – Brent May 11 '16 at 10:13
  • You're welcome. Thanks for confirming the fix worked - should help future Travis CI Pythonistas! – Mark A. Fitzgerald May 11 '16 at 10:53