Menu

Error on windows 7 64bits

C.Renaudo
2014-04-07
2014-04-17
  • C.Renaudo

    C.Renaudo - 2014-04-07

    First, is nice to see this kind of software being developed on Python, i think is a great language to do the job.
    I have all the necesary dependencies installed, just missing one optional because i couldnt find the webpage to download (the periodic table)

    Now to the bug:
    When i try to run the software i get:

    C:\Users\Usuario\Downloads\pychemqt>python pychemqt.py
    Traceback (most recent call last):
      File "pychemqt.py", line 12, in <module>
        conf_dir = os.environ["HOME"] + "/.pychemqt/"
      File "C:\Python27\lib\os.py", line 423, in __getitem__
        return self.data[key.upper()]
    KeyError: 'HOME'
    

    The issue comes from the use of:

    conf_dir = os.environ["HOME"] + "/.pychemqt/"
    

    Windows dont have the HOME variable, the one it have is USERPROFILE, checking a way to fix this i found the next link:

    http://stackoverflow.com/questions/14742064/python-os-environhome-works-on-idle-but-not-in-a-script

    This command is used on the files pychemqt.py and lib/config.py

    Another issue is the next line on the file lib/config.py

    os.environ["pychemqt"]="/home/jjgomera/Programacion/pychemqt/"
    

    I will try to make it run under windows in this week, sadly i am learning python at the moment so i can make a lot of mistakes.

    If my english is to bad, i can write in spanish, is my main language.

     
    • jjgomera

      jjgomera - 2014-04-13

      Hi,

      excuse me i didn't answer soon, sourceforge don't alert me this comment.

      The issue comes from the use of:
      conf_dir = os.environ["HOME"] + "/.pychemqt/"
      

      Thanks, i was running pychemqt in idle so i thought os.environ had that property

      Another issue is the next line on the file lib/config.py
      

      That was my fault in svn upload, these are debug line i must comment before upload. Solved in 73 svn commit

      On the config dir when i try to run the script i get the issue that is missing CostIndex.dat, i just copy that file from the svn to fix that.
      

      That CostIndex.dat file has not the correct format, is a "history" CostIndex file, the CostIndex file in config directory must be created in first run, extract the last line in that dat/CostIndex.dat file. Try to delete .pychemqt config dir and run pychemqt again.

      Use last svn commit from today with some bug resolved

      Thanks for feedback

       
      • C.Renaudo

        C.Renaudo - 2014-04-15

        thanks for the answer, yea this forum don't alert when someone write, idk why.

        After rev 74 it can run on windows on the first try (i just did a simple run) if you have most of the dependency installed. It load all, but i had issues using the units. (I can't input data to do the simulation). The terminal is a feature that will work only on GNU/Linux system. (to do the same on windows, there is a need to make a emulator, totally not worth)

        If you want i can take some pics to show how it run on Win 7 64bits.

        Best regards

         
        • jjgomera

          jjgomera - 2014-04-16

          Hi,

          did you try to load files in samples dir? I'm trying in a windows xp virtual machine and load fine, for example pump and pipe, and there, as the console say i don't have any optional dependences, only the mandatory.

          Start a new project in windows is no problem for me, except add stream, because a have installed a old pyqt version.

          I would like to know the error your program raise, and how long do pychemqt take start? In my VM with windows xp is terribly slow

          About console, I don't know now how to do that in windows, if anyone don't know the code of pychemqt could be a weird tool, but for me are fairly useful

          Cheers!

           

          Last edit: jjgomera 2014-04-16
          • C.Renaudo

            C.Renaudo - 2014-04-16

            Ok, lets start with the load time:
            The first time i load pychemqt it take a lot to load, more if i have been using windows in other stuff (for example, my pc was on for 9 hours, using web browser, some games, octave and LibreOffice Writer) and the load time is 19 secs (Yes, a lot). But if i close it, do other stuff, and then i open pychemqt again (without a reboot) the load time on the second run is 1 to 2 secs.

            Probably the issue is more a Windows Memory management issue than your code.

            About the samples I can open only the next samples:
            flujo
            Heatexchanger
            pipe
            pump
            turbine

            What i cant do is to add stream to conect the in or outs to the units.
            About the terminal, if you only need a shell to write python code, it could be useful to look at the shell of Ninja-IDE.

            My system:
            Win 7 64bits
            I dont have Microsoft Office installed.
            These are the packages i have installed on Python 2.7:
            CoolProp (4.1.2)
            Cython (0.20.1)
            ezodf (0.2.5)
            lxml (3.3.4)
            matplotlib (1.3.1)
            numpy (1.8.1)
            oasa (0.13.1)
            openpyxl (1.8.5)
            pip (1.5.4)
            pyparsing (2.0.1)
            python-dateutil (2.2)
            python-graph-core (1.8.2)
            pytz (2014.2)
            pywin32 (218.5)
            reportlab (3.0)
            scipy (0.14.0c1)
            setuptools (3.4.4)
            six (1.6.1)
            PyQT (4.10)

             
            • jjgomera

              jjgomera - 2014-04-17

              The first time i load pychemqt it take a lot to load, more if i have been using windows in other stuff (for example, my pc was on for 9 hours, using web browser, some games, octave and LibreOffice Writer) and the load time is 19 secs (Yes, a lot). But if i close it, do other stuff, and then i open pychemqt again (without a reboot) the load time on the second run is 1 to 2 secs.

              That's normal, when python runs first time compile libraries, create the pyc files, in second and successive runs that compile are not necessary, so a 1-2 seconds i think it's a good normal load time.

              About the samples I can open only the next samples:
              flujo
              Heatexchanger
              pipe
              pump
              turbine

              Yes, I broke the meos library in last svn, so projects with that option can't load, i will solve in next svn. If you have coolprop installed, with its python binding you can load solid separator equipment (ciclon, baghouse, ...), only change line #218 in file lib/project.py to use that thermal option:

               config.set("Thermo", "coolprop", "True")
              

              What i cant do is to add stream to conect the in or outs to the units.

              These was a nonsense, update in today svn commit

              Cheers!

               

              Last edit: jjgomera 2014-04-17
  • C.Renaudo

    C.Renaudo - 2014-04-08

    Well, after a few test i got the program to show the splash screen. I had to modify 3 files to get to this stage

    /pychemqt.py
    /lib/config.py
    /lib/sql.py
    

    In the 3 files i had to modify how the variable conf_dir is defined. The way to make it work was:

    conf_dir = os.path.expanduser('~')+ os.sep+".pychemqt"+os.sep
    

    On the config dir when i try to run the script i get the issue that is missing CostIndex.dat, i just copy that file from the svn to fix that.

    After all of that the program start to load and i get the next issue:

    from tools.costIndex import indiceBase, indiceActual
      File "C:\Users\Usuario\My Documents\LiClipse Workspace\pychemqt\tools\costIndex.py", line 20, in <module>
        indiceActual.append(float(archivo.readline()))
    ValueError: could not convert string to float: Feb-2001 393.6 437.0 365.6 441.1 544.1 365.8 670 3 340.8 414.2 300.0 385.6 341.1
    

    Checking the file, the issue is the first 8 chars (the date) because it isnt a value that can be converted to float. (letters) I dont know a way to make this work so i will stop for today. I hope that my test are usefull for something.

     

    Last edit: C.Renaudo 2014-04-08

Log in to post a comment.