Python Forum
[split] Help- converting file with pyton script
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[split] Help- converting file with pyton script
#1
Is it possible to get another help with this script https://github.com/ypomortsev/ccss2edr?
How to run it after installing default python environment
I’ve tried to run it in cmd when I’m in C:\ccss2edr-master\ccss2edr folder by: python ccss2edr.py but then get error:

Error:
Traceback (most recent call last): File "C:\ccss2edr\ccss2edr\ccss2edr.py", line 7, in <module> from .cgats import CGATS ImportError: attempted relative import with no known parent package
If I try to remove dots before cgatds and edr to loook like this:

from .cgats import CGATS   -> from cgats import CGATS
from .edr import (  ->  from edr import (
then got error:

Error:
Traceback (most recent call last): File "C:\ccss2edr\ccss2edr\ccss2edr.py", line 8, in <module> from edr import ( File "C:\ccss2edr\ccss2edr\edr.py", line 3, in <module> from record import recordtype File "C:\ccss2edr\ccss2edr\record.py", line 130 exec template in namespace ^ SyntaxError: Missing parentheses in call to 'exec'
If tried to modify it further with couple of next errors from:

try:
        exec template in namespace
        if verbose: print template
    except SyntaxError, e:
to:

try:
        exec (template, namespace)
        if verbose: print (template)
    except SyntaxError as e:
but got next error

Error:
Traceback (most recent call last): File "C:\ccss2edr\ccss2edr\ccss2edr.py", line 8, in <module> from edr import ( File "C:\ccss2edr\ccss2edr\edr.py", line 3, in <module> from record import recordtype File "C:\ccss2edr\ccss2edr\record.py", line 147 print TestResults(*doctest.testmod()) ^ SyntaxError: invalid syntax
I’ve tried to run it in another way in cmd when I’m in C:\ccss2edr-master\ by: python –m ccss2edr\ccss2edr but got another error:

Error:
Traceback (most recent call last): File "C:\Program Files\Python39\lib\runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Program Files\Python39\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "C:\ccss2edr\ccss2edr\ccss2edr.py", line 8, in <module> from .edr import ( File "C:\ccss2edr\ccss2edr\edr.py", line 3, in <module> from record import recordtype ModuleNotFoundError: No module named 'record'
I’ve tried another method too. I found Python 2.0.1 and installed on Clean Windows 7. No chances to install ccss2edr script. After execute in cmd: "python setup.py" I've got error: "error in setup script: invalid distribution option 'entry_points'"
Then I installed Python 2.7.9 and execute: "python setup.py install". After that run "python ccss2edr.py -h" and the same as errors as above:

Error:
Traceback (most recent call last): File "ccss2edr.py", line 7, in <module> from .cgats import CGATS ValueError: Attempted relative import in non-package
I’ve tried it on Ubuntu machine with Python2 too but got the same errors :(

Can someone help me? I’m fighting with it third day and no success. I don't know why it’s so hard to execute it?
buran write Jul-01-2021, 02:32 PM:
Please, use proper tags when post code, traceback, output, etc.
See BBcode help for more info.
Also don't hijack threads.
Reply


Messages In This Thread
[split] Help- converting file with pyton script - by eltomassito - Jul-01-2021, 01:29 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Converting .txt to .csv file SunWers 21 12,064 Jan-20-2024, 10:03 AM
Last Post: Larz60+
  How to "tee" (=split) output to screen and into file? pstein 6 1,367 Jun-24-2023, 08:00 AM
Last Post: Gribouillis
  Split pdf in pypdf based upon file regex standenman 1 2,074 Feb-03-2023, 12:01 PM
Last Post: SpongeB0B
  Converting a json file to a dataframe with rows and columns eyavuz21 13 4,398 Jan-29-2023, 03:59 PM
Last Post: eyavuz21
  How to split file by same values from column from imported CSV file? Paqqno 5 2,773 Mar-24-2022, 05:25 PM
Last Post: Paqqno
  [split] Results of this program in an excel file eisamabodian 1 1,574 Feb-11-2022, 03:18 PM
Last Post: snippsat
  split txt file data on the first column value shantanu97 2 2,432 Dec-29-2021, 05:03 PM
Last Post: DeaD_EyE
  Split Characters As Lines in File quest_ 3 2,507 Dec-28-2020, 09:31 AM
Last Post: quest_
  [split] How to convert the CSV text file into a txt file Pinto94 5 3,322 Dec-23-2020, 08:04 AM
Last Post: ndc85430
  Help- converting file with pyton script grinleon 3 2,479 Sep-23-2020, 11:48 AM
Last Post: grinleon

Forum Jump:

User Panel Messages

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