1. Error occured while installing fabric python API

Error occured while installing fabric python API

Home Forums FABRIC General Questions and Discussion Error occured while installing fabric python API

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #2900
    Manas Das
    Participant

      Hello, I am trying to install python API from this tutorial https://learn.fabric-testbed.net/knowledge-base/install-the-python-api/ . While doing it, I encountered the following error.

      Building wheel for typed-ast (setup.py) ... error
      error: subprocess-exited-with-error
      
      python setup.py bdist_wheel did not run successfully.
      
       running install
            /users/manasdas/anaconda3/envs/my_env/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
              warnings.warn(
            running build
            running build_py
            creating build
            creating build/lib.linux-x86_64-cpython-310
            creating build/lib.linux-x86_64-cpython-310/typed_ast
            copying typed_ast/__init__.py -> build/lib.linux-x86_64-cpython-310/typed_ast
            copying typed_ast/ast3.py -> build/lib.linux-x86_64-cpython-310/typed_ast
            copying typed_ast/ast27.py -> build/lib.linux-x86_64-cpython-310/typed_ast
            copying typed_ast/conversions.py -> build/lib.linux-x86_64-cpython-310/typed_ast
            creating build/lib.linux-x86_64-cpython-310/typed_ast/tests
            copying ast3/tests/test_basics.py -> build/lib.linux-x86_64-cpython-310/typed_ast/tests
            running build_ext
            building '_ast27' extension
            creating build/temp.linux-x86_64-cpython-310
            creating build/temp.linux-x86_64-cpython-310/ast27
            creating build/temp.linux-x86_64-cpython-310/ast27/Custom
            creating build/temp.linux-x86_64-cpython-310/ast27/Parser
            creating build/temp.linux-x86_64-cpython-310/ast27/Python
      gcc -pthread -B /users/manasdas/anaconda3/envs/my_env/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -fPIC -O2 -isystem /users/manasdas/anaconda3/envs/my_env/include -fPIC -O2 -isystem /users/manasdas/anaconda3/envs/my_env/include -fPIC -Iast27/Include -I/users/manasdas/anaconda3/envs/my_env/include/python3.10 -c ast27/Custom/typed_ast.c -o build/temp.linux-x86_64-cpython-310/ast27/Custom/typed_ast.o
      ......
      .....
      error: command '/usr/bin/gcc' failed with exit code 1
            [end of output]
        
        note: This error originates from a subprocess, and is likely not a problem with pip.
      error: legacy-install-failure
      
      × Encountered error while trying to install package.
      ╰─> typed-ast
      
      

      I tried both conda environment and virtualenv, I am getting the same error.

      Anyone know how to solve it? Please let me know.

      Thank you

      • This topic was modified 2 years, 2 months ago by Manas Das.
      #2902
      ADAM GRIFFITH
      Participant

        If you are looking to interact with Fabric via Python I have had a lot of success with the FABLib API.

        Here is our Conda environment.yml file:

        # conda env create --file environment.yml
        name: uofu-fabrictestbed
        channels:
          - defaults
        dependencies:
          - pip=21.2.4
          - python=3.9.12
          - pip:
              - fabrictestbed-extensions==1.3.0
        
        #2903
        Manas Das
        Participant

          @Adam Thank you for your reply, I am working with a headless machine so notebooks are of no use to me. So please let me know how to install fabric-testbed on a headless machine. I am trying to install it for many hours now, but still getting the same above mentioned error.

          #2904
          Manas Das
          Participant

            @ Adam I will use the configuration file and try to create a slice. If you know how to do it in a headless machine it will be great, Thanks.

            • This reply was modified 2 years, 2 months ago by Manas Das.
            #2906
            ADAM GRIFFITH
            Participant

              My advice would be to start with copying the FABLib commands documented on the start_here.ipynb --> create_slice.ipynb Jupyter Lab notebook to your local Python script file.

              If you would like, feel free to cannibalize my very rough Python code on GitHub.

              #2907
              Paul Ruth
              Keymaster

                @Manas I would strongly encourage you to avoid the native API and, instead, use FABlib.  FABlib does not require Jupyter Notebooks and can be used on its own.

                You should be able to install it with pip using the following command:

                python3 -m pip install fabrictestbed-extensions

                You will need Python 3.9.

                Adam’s config for Anaconda likely works too.

                • This reply was modified 2 years, 2 months ago by Paul Ruth.
                #2916
                Manas Das
                Participant

                  @Adam thank you for your help. I will keep in mind your advice.

                  @Paul, you are correct, I will use fabrictestbed-extensions and hope everything works out.

                  #2938
                  Xusheng Ai
                  Participant

                    @Adam, I’m also working on build Fablib API on my University Cluster. It doesn’t support a browse, so I have to do it with python scripts. I followed the steps on the github you sent. However, I met an error that AttributeError: module 'cluster' has no attribute 'logger'. I was wondering if it was because of the version of cluster.

                    #2941
                    ADAM GRIFFITH
                    Participant

                      @Xusheng, the rough Python code is tailored to work with my IntelliJ IDE. However it does contain good examples of what environmental variables FABLib expects, how to call functions in FABLib, etc.. In short, I would write your own Python by grabbing the useful bits from mine.

                    Viewing 9 posts - 1 through 9 (of 9 total)
                    • You must be logged in to reply to this topic.