WebFaction
Community site: login faq

I've (partially) successfully installed my Flask application. When I call init.py via SSH, it fires up and throws the error ImportError: No module named mysql.connector

Which is to be expected, as I haven't installed that yet.

As I can't operate as root, how can I install the dependancies that my Flask application has?

TIA

asked 13 Jan '15, 23:38

Ben Mayo
3113
accept rate: 0%


You can install packages with pip. More information is available in our python documentation.

For the MySQL connector, I was able to install this from PyPI (using its external link) as follows:

pip install --user --allow-external mysql-connector-python mysql-connector-python

If your Flask application uses a virtual environment, you could install this package into your virtualenv instead of into your main account by activating your application's virtualenv first. In that case, you wouldn't use the "--user" flag.

Hope that helps!

permanent link

answered 14 Jan '15, 01:59

ryans ♦♦
5.0k93360
accept rate: 43%

Thanks ryans, ran that, still get the error ImportError: No module named mysql.connector, but I can see that mysql has now installed...so seems I need to go and educate myself a whole lot more. If you've got any ideas as to what the problem might be, they'd be gratefully received!

(16 Jan '15, 19:47) Ben Mayo
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×337
×44
×5

question asked: 13 Jan '15, 23:38

question was seen: 10,013 times

last updated: 16 Jan '15, 19:47

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM