Python Forum
Help with pyGenealogical-Tools (Updated)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with pyGenealogical-Tools (Updated)
#1
Hey everyone!

I am a little bit of struggling with a project in Python

here is the link for the software: https://pypi.org/project/pyGenealogicalT...escription

I have been installed all of the programs in the description, but I can't handle to properly "Run" the programme.

This is my main programme as in the description - GeniTools.py:

--------------

from pyGeni import profile

from pyGeni.geniapi_common import geni_calls

from parser_input import reader_input

from analyzefamily.ancerstors_climb import climb

from messages.genitools_messages import *

import logging


def main():
    logging.basicConfig(filename='GeniToools.log', level=logging.INFO)

    logging.info('Starting GeniTools\n' + "=" * 20 + "\n")

    # Firstly the Input File is Read

    data = reader_input.reader_input("INPUT")

    base_call = geni_calls(data.genikey)

    if (data.continue_execution and base_call.check_valid_genikey()):

        # We only continue if inputs are correct!

        test_profile = profile.profile(data.profile, data.genikey)

        if (data.climbancestors or data.climbcousins):

            climber = climb(test_profile)

            if (data.climbcousins):
                ancestors, matrix_count, included_profiles = climber.get_cousins(data.generations)

                print(matrix_count)

            if (data.climbancestors):
                ancestors, affected_profiles = climber.get_ancestors(data.generations)

    else:

        logging.error(ERROR_MISSING_DATA)

    logging.info('Finishing GeniTools' + "=" * 20 + "\n")


if __name__ == '__main__':
    main()
------------------------------

Here is the reader_input file:

import logging
from messages.parser_messages import *

class reader_input:
    '''
    General class parsing the data input
    '''
    def __init__(self, file_path):
        self.file = open(file_path, "r")

        self.profile = ""
        self.genikey = ""
        self.read_file()

        self.file.close()

    def read_file(self):
        '''
        Internal function reading the input file line by line
        '''
        self.continue_execution = True
        self.profile_given = False
        self.generations_given = False
        self.genikey_given = False
        self.climbancestors = False
        self.climbcousins = False
        for line in self.file:
            divided = line.split()
            if (divided[0] == "PROFILE"):
                self.profile = str(divided[1])
                self.profile_given = True
            elif (divided[0] == "GENIKEY"):
                self.genikey = str(divided[1])
                self.genikey_given = True
            elif (divided[0] == "CLIMB_ANCESTORS"):
                self.climbancestors = True
            elif (divided[0] == "CLIMB_COUSINS"):
                self.climbcousins = True
            elif (divided[0] == "GENERATIONS"):
                self.generations = int(divided[1])
                self.generations_given = True
        if (not self.genikey_given):
            logging.warning(GENI_KEY_MISSING)
            self.continue_execution = False
        if (self.climbancestors or self.climbcousins):
            if (not self.profile_given):
                logging.warning(PROFILE_MISSING)
                self.continue_execution = False
            if (not self.generations_given):
                logging.warning(GENERATIONS_MISSING)
                self.continue_execution = False
------------------------------

Here is my line I am getting when I Run the main programme - GeniTools.py:

Error:
Traceback (most recent call last): File "C:/Users/97252/PycharmProjects/Girffe/matan.py", line 51, in <module> main() File "C:/Users/97252/PycharmProjects/Girffe/matan.py", line 21, in main data = reader_input.reader_input("INPUT") File "C:\Users\97252\PycharmProjects\Girffe\venv\lib\site-packages\parser_input\reader_input.py", line 9, in __init__ self.file = open(file_path, "r") FileNotFoundError: [Errno 2] No such file or directory: 'INPUT' Process finished with exit code 1
------------------------------------

Please help me know what I need to do in order to run this software without errors.

Thank you,

Matan.
Reply
#2
The error message tells all. It can't find a file named INPUT.
If the file exists, perhaps it's a path issue.
so:
  • Does the file exist?
  • is INPUT a declared constant? (if so, remove quotes around INPUT)
  • is the file located is the Current working directory?
Reply
#3
There is no such file named “INPUT”
Reply
#4
Then how can it be opened?
data = reader_input.reader_input("INPUT")
Reply
#5
From what I understand the reader_input file is referred as the INPUT file
Reply
#6
This is plain python.
It is looking for a file named 'INPUT' and not finding it.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Stuck on installing PyQt5-tools safety789 1 266 Apr-11-2024, 03:40 PM
Last Post: snippsat
  Mysql Workbench table not updated CatBall 2 1,123 Feb-13-2023, 05:37 PM
Last Post: CatBall
  Choosing animation / simulation tools J_Miller 0 1,042 Apr-18-2022, 07:03 PM
Last Post: J_Miller
  live updated json file Nyanpasu 2 2,241 Aug-22-2020, 04:41 PM
Last Post: Nyanpasu
  Multiple items of a matrix has been updated. Yoki91 4 2,327 May-19-2020, 06:29 PM
Last Post: Yoki91
  Verify if .docx table of contents is updated as per document sections or not vintysaw 0 3,892 Oct-24-2019, 12:01 PM
Last Post: vintysaw
  video processing tools sveto4ka 2 1,876 Oct-23-2019, 01:27 PM
Last Post: sveto4ka
  dictionary of dictionaries, to be updated Skaperen 2 2,384 Mar-03-2019, 07:15 AM
Last Post: Skaperen
  Updated security logger jameseroni 0 2,038 Oct-29-2018, 04:23 AM
Last Post: jameseroni
  Mouse click movements? [UPDATED] minnaadel 3 3,565 Mar-31-2018, 05:15 PM
Last Post: woooee

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020