flamapy / flamapy_fw

This repository hosts the main components of flamapy
4 stars 5 forks source link

User installation doc fix suggestions and errors afterwards #29

Closed pabpazjim closed 2 years ago

pabpazjim commented 3 years ago

With the 3.9 version now being required for core to work, some changes have to be introduced in the documentation regarding user installation and usage. The following sequence of commands should result in a successful install:

First we clone the core:

git clone https://github.com/diverso-lab/core

Create and activate a python3.9 (not yet documented) venv:

python3.9 -m venv env
source  env/bin/activate

Install core from source:

cd core
python3.9 setup.py install

Install famapy-fm:

pip3.9 install famapy-fm

Then install famapy-sat, first we have to install some dependencies in our system

sudo apt-get install build-essential
sudo apt-get install python3.9-dev

and our venv:

pip3.9 install wheel

Finally we can install famapy-sat:

pip3.9 install famapy-sat

NOTE: With the venv we are working in being on a 3.9 version, I don't know if specifying the version in the pip command makes an actual difference.

This should result in a successful installation with no apparent errors. However, some errors come when using hug to call framework instructions. After installing hug:

pip3.9 install hug

And running the following command as the documentation example suggests:

hug -f famapy/endpoint/diverso-lab.py -c help

We get this error:

ModuleNotFoundError famapy.metamodels
Traceback (most recent call last):
  File "/home/pabpazjim/diverso/core/famapy/core/discover.py", line 26, in filter_modules_from_plugin_paths
    module: ModuleType = import_module(path)
  File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'famapy.metamodels'
famapy/endpoint/diverso-lab

Available Commands:

 - get_plugins:  Get availables plugins 
 - get_operations_by_plugin:  Get availables operations gave a plugin name 
 - use_operation:      Execute an operation gave a plugin, an operation and o...
 - use_operation_from_fm_file:      Execute an operation gave a plugin, an op...

Which ends with the result popping up, but seeming to be unable to access or find the metamodels.

If we call the get_plugins instructions:

hug -f famapy/endpoint/diverso-lab.py -c get_plugins

We get this output:

ModuleNotFoundError famapy.metamodels
Traceback (most recent call last):
  File "/home/pabpazjim/diverso/core/famapy/core/discover.py", line 26, in filter_modules_from_plugin_paths
    module: ModuleType = import_module(path)
  File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'famapy.metamodels'
{'plugins': []}

Which is the same error and still the result, but with the result being an empty list of plugins. If I'm not wrong, both installed plugins famapy-fm and famapy-sat should show up if everything worked correctly.