6

How do I install Python Flask without using pip?

I do not have pip, virtualenv nor easy_install.

The context of this question is that I am on a tightly controlled AIX computer. I cannot install any compiled code without going through several layers of management. However, I can install python modules.

Python 2.7 is installed.

I have some existing python code that generates a report.

I want to make that report available on a web service using Flask.

I am using bottle, but I am going to want to use https, and support for https under Flask seems much more straight forward.

I would like to put the flask library (and its dependencies) into my project much like bottle is placed into the project.

What I tried: I downloaded the flask tarball and looked at it. It had quite a bit of stuff that I did not know what to do with. For instance, there was a makefile.

1

4 Answers 4

9

Yes you can but it will be little difficult.

get flask source code from this and Extract it.

https://pypi.python.org/packages/source/F/Flask/Flask-0.10.1.tar.gz

There will be a file with name setup.py in that you can see dependencies , I listed them here. download those packages and install them first.

'Werkzeug>=0.7',    https://pypi.python.org/packages/source/W/Werkzeug/Werkzeug-0.10.4.tar.gz
'Jinja2>=2.4',  https://pypi.python.org/packages/source/J/Jinja2/Jinja2-2.7.3.tar.gz
'itsdangerous>=0.21' , https://pypi.python.org/packages/source/i/itsdangerous/itsdangerous-0.24.tar.gz
MarkupSafe==0.23 ,https://pypi.python.org/packages/source/M/MarkupSafe/MarkupSafe-0.23.tar.gz

download all those from pypi and install using python setup.py install for every module.

Now you can install flask by running python setup.py install in the flask source code folder.

Now you system is acquainted with flask.

:-)

Sign up to request clarification or add additional context in comments.

2 Comments

And note that installing setuptools (as mentioned in the previous comment) means that you can now use easy_install...
Please note that you may need to install MarkupSafe before installing Jinja2.
4

On Debian-based systems you can install with Apt.

For Python 3.x use:

sudo apt-get install python3-flask

For Python 2.x use:

sudo apt-get install python-flask

1 Comment

Aix is an rpm-based system. (Well it is not, but newer versions have got yum)
0

One way to go around the problem is to use another machine with pip installed on which you can download all dependencies.

On this first machine you would then run these commands below

$ mkdir myapp
$ pip install flask --target ./myapp

Then transfer the myapp folder to the AIX machine.

Then develop your program inside the myapp folder as this is the only place flask will be accessible. Unless you setup the environment path accordingly.

Comments

-1

You can try with wheel pacakges .

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.