Read only file system while installing Flask on shared web server. Any workarounds? Read only file system while installing Flask on shared web server. Any workarounds? flask flask

Read only file system while installing Flask on shared web server. Any workarounds?


What the system is basically telling you is that you have no permissions to install stuff in system wide directories (which is expected on a shared hosting).

You have 2 approaches possible:

  • ask the sysadmin/support to install all your needed dependencies globally (which quite probably won't happen)
  • ask the sysadmin of the box/support to install python-virtualenv so you have an isolated environment in which to install your copy of flask (if the host advertises support of python it is entirely possible you have virtualenv available.

Also check: https://pypi.python.org/pypi/virtualenv


Note: This is not a new solution but an elaboration of a part of zeridon's answer, and is more relevant to BigRock Linux shared server.

Opening of terminal and logging in:

For windows users:Install PuTTY client. After installation, open the application and enter the Host Name (or IP address) as yourusername@yourdomain.com and open the connection. It will open a terminal and prompt for your password. Type your password and hit the 'Enter' button.

Mac and Linux users have terminal already installed, so just open it.

Making of virtualenv:

To make a virtuanenv with the name 'virenv', enter this command:

virtualenv virenv

This will make a directory with the name 'virenv' and will make a virtualenv along with pip installed.

Activate virtualenv and install modules:

To activate the virtualenv that was made, enter this command:

source virenv/bin/activate

After the virtuanenv is activated, enter this command to install a module.

pip install <module_name>

(For example, to install flask, enter pip install flask.)

Usage in script:

Get the path to virtualenv:After activating the virtualenv, enter which python and it will give the path to the virtualenv. It would typically be something like '/home//virenv/bin/python'.

To use virtualenv in script, replace !#/usr/bin/python with !#<path to virtualenv>.

(For example, if the virtuanenv path is '/home/username/virenv/bin/python', use #!/home/username/virenv/bin/python at the top of your script.)