tokenika / eosfactory

Python-based EOS smart-contract development & testing framework
http://eosfactory.io/
Other
243 stars 62 forks source link

Unable to install on master #152

Closed ryanleecode closed 5 years ago

ryanleecode commented 5 years ago

Trying to install the latest master branch on Linux, having issues, see below.

###############################################################################
#   This script installs EOSFactory. It needs to be executed from within
#   the 'eosfactory' folder.
#   This file was downloaded from https://github.com/tokenika/eosfactory
###############################################################################

Installing 'eosfactory' package locally with the Python pip system...
Obtaining file:///home/drd/Documents/Repositories/eosfactory
Requirement already satisfied: termcolor in /home/drd/.local/share/virtualenvs/eosfactory-BN50FZnk/lib/python3.7/site-packages (from eosfactory-tokenika==3.0.3) (1.1.0)
Installing collected packages: eosfactory-tokenika
  Found existing installation: eosfactory-tokenika 3.0.3
    Uninstalling eosfactory-tokenika-3.0.3:
      Successfully uninstalled eosfactory-tokenika-3.0.3
  Running setup.py develop for eosfactory-tokenika
Successfully installed eosfactory-tokenika

Configuring the eosfactory installation...

ERROR /home/drd/Documents/Repositories/eosfactory/eosfactory/core/config.py 90:
Cannot determine the directory of application data. Tried:
/usr/local/eosfactory/
/home/drd/.local/eosfactory/
/home/drd/Documents/Repositories/eosfactory
ERROR!
Cannot determine the version of the installed 'eosio' package.
The error message:
ERROR /home/drd/Documents/Repositories/eosfactory/eosfactory/core/config.py 90:
Cannot determine the directory of application data. Tried:
/usr/local/eosfactory/
/home/drd/.local/eosfactory/
/home/drd/Documents/Repositories/eosfactory

ERROR!
Cannot determine the version of the installed 'eosio.cpp' package.
The error message:
ERROR /home/drd/Documents/Repositories/eosfactory/eosfactory/core/config.py 90:
Cannot determine the directory of application data. Tried:
/usr/local/eosfactory/
/home/drd/.local/eosfactory/
/home/drd/Documents/Repositories/eosfactory

         ______ ____   _____  ______      _____ _______ ____  _______     __
        |  ____/ __ \ / ____||  ____/\   / ____|__   __/ __ \|  __ \ \   / /
        | |__ | |  | | (___  | |__ /  \ | |       | | | |  | | |__) \ \_/ /
        |  __|| |  | |\___ \ |  __/ /\ \| |       | | | |  | |  _  / \   /
        | |___| |__| |____) || | / ____ \ |____   | | | |__| | | \ \  | |
        |______\____/|_____/ |_|/_/    \_\_____|  |_|  \____/|_|  \_\ |_|

To verify EOSFactory installation navigate to the 'eosfactory' folder and run
these tests:

    $ python3 tests/hello_world.py
    $ python3 tests/eosio_token.py
    $ python3 tests/tic_tac_toe.py
stefanzarembinski commented 5 years ago

It is the same strange condition as reported in the issue #148 I am fighting it for weeks now.

Will you, please, replace the function definition 'def get_app_data_dir()` in the file 'eosfactory/core/config.py' with the following version involving debugging information:

def get_app_data_dir():
    if APP_DATA_DIR_SUDO[1] in __file__:
        app_data_dir = APP_DATA_DIR_SUDO[0]
    elif  APP_DATA_DIR_USER[1] in __file__:
        app_data_dir = APP_DATA_DIR_USER[0]
    else:
        app_data_dir = eosf_dir() + "/"

    if app_data_dir and os.path.exists(app_data_dir):
        return app_data_dir

    msg = '''
    __file__: {}
    APP_DATA_DIR_SUDO[0]: {}
    APP_DATA_DIR_SUDO[1]: {}
    APP_DATA_DIR_USER[0]: {}
    APP_DATA_DIR_USER[1]: {}
    eosf_dir(): {}
    '''.format(
            __file__, 
            APP_DATA_DIR_SUDO[0], APP_DATA_DIR_SUDO[1], 
            APP_DATA_DIR_USER[0], APP_DATA_DIR_USER[1], 
            eosf_dir())

    raise errors.Error( msg + '''
    Cannot determine the directory of application data. Tried:
        '{}',
        '{}',
        '{}'.
    The chosen path is
        '{}',
    but it does not exist, seemingly.
    '''.format(
            APP_DATA_DIR_SUDO[0], APP_DATA_DIR_USER[0], eosf_dir() + "/",
            app_data_dir),
            translate=False)

Run python3 -m eosfactory.config.

stefanzarembinski commented 5 years ago

The new edition v.3.1.0 fixes the issue, hopefully.