Cannot install flask with pip in docker

I’m trying to install flask in docker container and have the following error.

Installing collected packages: flask, blosc, pyzmq, numpy, leos-math, messaging-system, rest-framework, Werkzeug, Jinja2, itsdangerous, ZODB, markupsafe, persistent, BTrees, ZConfig, transaction, zc.lockfile, zdaemon, zope.interface
  Running setup.py install for flask
    Running command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/flask/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('rn', 'n'), __file__, 'exec'))" install --record /tmp/pip-WbqVyv-record/install-record.txt --single-version-externally-managed --compile
    Error [Errno 2] No such file or directory: '/tmp/pip_build_root/flask' while executing command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/flask/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('rn', 'n'), __file__, 'exec'))" install --record /tmp/pip-WbqVyv-record/install-record.txt --single-version-externally-managed --compile
Cleaning up...
  Removing temporary dir /tmp/pip_build_root...
Exception:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 283, in run
    requirement_set.install(install_options, global_options, root=options.root_path)
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1436, in install
    requirement.install(install_options, global_options, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 707, in install
    cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
  File "/usr/lib/python2.7/dist-packages/pip/util.py", line 680, in call_subprocess
    cwd=cwd, env=env)
  File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory: '/tmp/pip_build_root/flask'

Permissions for the /tmp/ directory are

drwxrwxrwt   2 root root 4096 Jul  6 08:28 tmp

and the command I use in pip install -r requirements.txt.

Where requirements.txt looks like this

flask
blosc
pyzmq
numpy
-e git+git@bitbucket.org:opticsdevelopment/leos_math.git#egg=leos_math
-e git+git@bitbucket.org:opticsdevelopment/messaging_system.git#egg=messaging_system
-e git+git@bitbucket.org:opticsdevelopment/rest_framework.git#egg=rest_framework


Source: ubuntu

Leave a Reply