Skip to Content

Problem pushing python app with numpy and scikit-fuzzy packages in Cloud Foundry


I can't push a python application in SAP Cloud Foundry. I have problems installing the numpy and scikit-fuzzy packages. The application has the following requirements.






- name: pyapp
  memory: 128M
  disk_quota: 256M
  path: .
  command: python

By running cf logs pyapp --recent I get the following:

2019-02-08T10:15:09.83-0400 [API/5] OUT Updated app with guid 6e395c32-5392-4517-9d48-01eca041e9b1 ({"buildpack"=>"", "command"=>"[PRIVATE DATA HIDDEN]", "disk_quota"=>256, "health_check_http_endpoint"=>"", "health_check_type"=>"port", "instances"=>1, "memory"=>128, "name"=>"pyapp", "space_guid"=>"49f9beb7-ae91-4202-bb17-300b529310d1"})
   2019-02-08T10:15:10.19-0400 [API/0] OUT Uploading bits for app with guid 6e395c32-5392-4517-9d48-01eca041e9b1
   2019-02-08T10:15:14.70-0400 [API/4] OUT Creating build for app with guid 6e395c32-5392-4517-9d48-01eca041e9b1
   2019-02-08T10:15:14.80-0400 [API/4] OUT Updated app with guid 6e395c32-5392-4517-9d48-01eca041e9b1 ({"state"=>"STARTED"})
   2019-02-08T10:15:14.89-0400 [STG/0] OUT Cell bd568339-1521-47aa-b578-839e02352a93 creating container for instance 856d14a4-ece8-4564-a37d-c66bb3edf612
   2019-02-08T10:15:15.20-0400 [STG/0] OUT Cell bd568339-1521-47aa-b578-839e02352a93 successfully created container for instance 856d14a4-ece8-4564-a37d-c66bb3edf612
   2019-02-08T10:15:15.37-0400 [STG/0] OUT Downloading app package...
   2019-02-08T10:15:15.42-0400 [STG/0] OUT Downloaded app package (4K)
   2019-02-08T10:15:16.92-0400 [STG/0] OUT -----> Download go 1.11.4
   2019-02-08T10:15:22.83-0400 [STG/0] OUT -----> Running go build supply
   2019-02-08T10:15:22.83-0400 [STG/0] OUT /tmp/buildpackdownloads/fe158333cd0331a0073936bf6f26e45e ~
   2019-02-08T10:15:27.02-0400 [STG/0] OUT ~
   2019-02-08T10:15:27.02-0400 [STG/0] OUT -----> Python Buildpack version 1.6.28
   2019-02-08T10:15:27.02-0400 [STG/0] OUT -----> Supplying Python
   2019-02-08T10:15:27.02-0400 [STG/0] OUT -----> Installing python 3.6.8
   2019-02-08T10:15:27.02-0400 [STG/0] OUT        Download []
   2019-02-08T10:15:30.23-0400 [STG/0] OUT -----> Installing pip-pop 0.1.3
   2019-02-08T10:15:30.23-0400 [STG/0] OUT        Download []
   2019-02-08T10:15:34.37-0400 [STG/0] OUT -----> Running Pip Install
   2019-02-08T10:15:34.80-0400 [STG/0] OUT        Collecting Flask==1.0.2 (from -r /tmp/app/requirements.txt (line 1))
   2019-02-08T10:15:34.90-0400 [STG/0] OUT          Downloading (91kB)
   2019-02-08T10:15:34.93-0400 [STG/0] OUT        Collecting numpy==1.16.1 (from -r /tmp/app/requirements.txt (line 2))
   2019-02-08T10:15:35.24-0400 [STG/0] OUT          Downloading (17.3MB)
   2019-02-08T10:15:36.04-0400 [STG/0] OUT        Collecting scikit-fuzzy==0.4.0 (from -r /tmp/app/requirements.txt (line 3))
   2019-02-08T10:15:36.06-0400 [STG/0] OUT          Downloading (994kB)
   2019-02-08T10:15:36.37-0400 [STG/0] OUT            Complete output from command python egg_info:
   2019-02-08T10:15:36.37-0400 [STG/0] OUT            To install scikit-fuzzy from source, you will need numpy.
   2019-02-08T10:15:36.37-0400 [STG/0] OUT            Install numpy with pip:
   2019-02-08T10:15:36.37-0400 [STG/0] OUT            pip install numpy
   2019-02-08T10:15:36.37-0400 [STG/0] OUT            Or use your operating system package manager.
   2019-02-08T10:15:36.37-0400 [STG/0] OUT            
   2019-02-08T10:15:36.37-0400 [STG/0] OUT            ----------------------------------------
   2019-02-08T10:15:36.41-0400 [STG/0] ERR        Command "python egg_info" failed with error code 1 in /tmp/pip-install-fzpbncb3/scikit-fuzzy/
   2019-02-08T10:15:36.47-0400 [STG/0] ERR        You are using pip version 18.1, however version 19.0.1 is available.
   2019-02-08T10:15:36.47-0400 [STG/0] ERR        You should consider upgrading via the 'pip install --upgrade pip' command.
   2019-02-08T10:15:36.51-0400 [STG/0] OUT        **ERROR** Could not install pip packages: could not run pip: exit status 1
   2019-02-08T10:15:36.86-0400 [STG/0] ERR Failed to compile droplet: Failed to run all supply scripts: exit status 14
   2019-02-08T10:15:36.87-0400 [STG/0] OUT Exit status 223
   2019-02-08T10:15:37.26-0400 [STG/0] OUT Cell bd568339-1521-47aa-b578-839e02352a93 stopping instance 856d14a4-ece8-4564-a37d-c66bb3edf612
   2019-02-08T10:15:37.26-0400 [STG/0] OUT Cell bd568339-1521-47aa-b578-839e02352a93 destroying container for instance 856d14a4-ece8-4564-a37d-c66bb3edf612
   2019-02-08T10:15:41.03-0400 [STG/0] OUT Cell bd568339-1521-47aa-b578-839e02352a93 successfully destroyed container for instance 856d14a4-ece8-4564-a37d-c66bb3edf612

I would appreciate your help, I don't know what else to do.

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    Posted on Feb 13, 2019 at 06:10 PM

    Hi Luis,

    I believe the best solution to this issue is to deploy your application using miniconda with the standard buildpack. I've tested it on the same application I shared above and it works. Here is how you do it:

    - Remote the files: requirements.txt & runtime.txt from your project folder

    - Create a file named: environment.yml with the following contents:

    name: flask-skfuzzy
    - conda-forge
    - python=3.6
    - pip
    - pytest
    - icu == 56.*
    - flask
    - numpy
    - nomkl
    - scipy
    - matplotlib
    - scikit-fuzzy

    This approach use miniconda to install the dependencies. This has a caveat: the package numpy via miniconda requires a lot of disk space. Therefore, you would also need to change your manifest.yml to allow for a larger disk quota:

    - name: flask-skfuzzy
      memory: 512MB
      disk_quota: 2G
      buildpack: python_buildpack
      stack: cflinuxfs3

    NOTE: I didn't figure out the optimal disk size for my project - thus 2G my be larger than what's really required.

    I'm updating the git repository with such files for your convenience.


    Best regards,

    Add a comment
    10|10000 characters needed characters exceeded

    • Hello, Ivan,

      I did everything you suggested and it worked perfectly. Everything was installed without any problem. Finally my configuration files stayed this way.


      - name: fuzzy-test
        memory: 64MB
        disk_quota: 1.5GB
        path: .
        command: python
        stack: cflinuxfs3




      name: fuzzy-alarm
      - conda-forge
      - pip==19.0.1
      - Flask==1.0.2
      - numpy==1.16.1
      - scikit-fuzzy==0.4.0

      I appreciate all your help, thank you very much. Best regards,


  • Posted on Feb 12, 2019 at 02:19 PM

    Hi Luis,

    Apparently the buildpack is not being able to install both numpy and skfuzzy at the same time - because of inter dependencies.

    The current python buildpack from CF is not able to do it and I am not sure why this is happening. It sounds like the culprit is either pip or setuptools - as both are really old on this particular buildpack. I've read at Pivotal bug track system that newer pip version have some private methods that are incompatible with the way the parse the requirements.txt file.

    However, not all hope is lost. I've fund another buildpack based on heroku's that allows you to have numpy and scipy. But there is a caveat on how to install skfuzzy on to it.

    First you need to change the change the stack to cflinuxfs2 and then supply the buildpack within the manifest.yml. Next comment (with a '#' char) skfuzzy requirement and push it to CF. This will install numpy on your application's filesystem. I am not sure why, but this particular buildpack takes the previously deployed app and avoids reinstalling python packages that were previously installed. Once this is done, your application will fail because skfuzzy is not there yet. Don't worry, add it to the requirement.txt and deploy your app once more.

    This procedure should solve your problem and it is a one-time thing. Once your app gets deployed with all dependencies it will accept further changes to py files without reinstalling the requirements that were already deployed into your app filesystem.

    I've shared my fuzzy project on git with my PoC containing a program that implements Flask + NumPy + SciPy + MatPlotLib + SciKit-Fuzzy - with the example from skfuzzy. (remember to comment skfuzzy the first time you deploy it).

    Best regards,

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Luis Leon,

      I am trying to figure out how to deploy numpy and other pre requisites on a standard buildpack from Cloud Foundry. I have managed to fork the standard Python BuildPack and incremented the startup procedure with the required pip commands to install numpy before it tries to install the other dependencies from the "requirements.txt". It works!

      However, it is very rudimentary and it is installing numpy, matplotlib and scipy without specifying their versions.

      I wanted to figure out how to deploy them via a "pre_requirements.txt" file - just like it is done on other buildpacks out there.

      If you are interested, you could use my fork on your other tests.


      The "#numpy" suffix is a branch on my fork that contains the modifications I've done to this particular buildpack.

      If I make any further changes on this fork I'll do it on another branch so it doesn't mess with anything while other may be testing this forked buildpack.

      Best regards,

  • Posted on Feb 11, 2019 at 12:15 PM

    Hi Luis,

    this is definitely I tough one �� I spent some time to reproduce your issue.

    You're doing everything right, the problem seems to be the scikit-fuzzy package.

    I'm not able to install it on my local machine either, so I guess the package is correcupted.

    Were you able to install it locally?



    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.