Attributeerror about plot.py in fullrmc examples

40 views
Skip to first unread message

Akiko S

unread,
Aug 4, 2020, 10:50:02 PM8/4/20
to fullrmc
Hello everyone,

I am quite new to fullrmc.

I have installed numpy, cython, and fullrmc to Windows 10 PC by using pip,
and just tried to run the run.py script in fullrmc examples (e.g. atomicNiTi, SOxnanosphere).

run.py seems to work, but I got the following error message about plot.py.
(Command prompt screenshot is attached.)
-----------------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\work\RMCtest\python\atomicNiTi\plot.py", line 16, in <module>
    ENGINE = ENGINE.load(engineFilePath)
  File "C:\Users\sugah\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\fullrmc\Engine.py", line 1353, in load
    engine._set_repository(REP)
AttributeError: 'tuple' object has no attribute '_set_repository'
-----------------------------------------------------------------------------  

Does anyone know how to fix this error?

Thank you in advance.


Settings are below.
-----------------------------------------------------------------------------
*OS: Windows 10
*pip package versions
cycler          0.10.0
Cython          0.29.21
fullrmc         4.1.0
kiwisolver      1.2.0
matplotlib      3.3.0
numpy           1.19.1
pdbparser       0.1.8
Pillow          7.2.0
pip             20.2
pylocker        3.0.0
pyparsing       2.4.7
pypref          3.1.0
pyrep           3.2.0
pysimplelog     4.0.0
python-dateutil 2.8.1
six             1.15.0
wheel           0.34.2


Message has been deleted

Akiko S

unread,
Aug 4, 2020, 10:53:45 PM8/4/20
to fullrmc
I am sorry for forgetting to attach the screenshoterrormessage.png

2020年8月5日水曜日 11:50:02 UTC+9 Akiko S:

Bachir Aoun

unread,
Aug 5, 2020, 9:44:39 AM8/5/20
to fullrmc
Hi Akiko,

how did you install fullrmc. have you done that from pypi using pip install command or directly from github ?

that will help me debug what's happening on your machine.

thanks 

Akiko S

unread,
Aug 5, 2020, 8:25:07 PM8/5/20
to fullrmc
Hello Bachir,

thank you for your reply.

I used pip install command to install fullrmc.
After deleting all python related packages and Anaconda in my PC,
I installed pip (20.2.1) .
And I used just the following commands to install fullrmc.
pip install numpy
pip install cython
pip install fullrmc
2020年8月5日水曜日 22:44:39 UTC+9 Bachir Aoun:

Bachir Aoun

unread,
Aug 5, 2020, 8:42:17 PM8/5/20
to fullrmc
Hello Akiko,

can you confirm that your plot.py file looks something like this 

# standard libraries imports
from __future__ import print_function
import os

# fullrmc library imports
from fullrmc import Engine

# dirname
try:
    DIR_PATH = os.path.dirname( os.path.realpath(__file__) )
except:
    DIR_PATH = ''
engineFilePath = os.path.join(DIR_PATH, "engine.stc")

# load
ENGINE = Engine(path=None)
result, mes = ENGINE.is_engine(engineFilePath, mes=True)
if result:
    ENGINE = ENGINE.load(engineFilePath)
    GR, SQ, CN, MD = ENGINE.constraints
    CN.compute_data()
    GR.plot(intra=False,show=False)
    SQ.plot(intra=False,show=False)
    CN.plot(show=False)
    MD.plot(show=True)
else:
    print(mes)


thanks 

Akiko S

unread,
Aug 6, 2020, 1:25:46 AM8/6/20
to fullrmc
Hello Bachir,

My plot.py is almost same.
(dirname part is just two sentences below. But it was not problem.)
# dirname
DIR_PATH = os.path.dirname( os.path.realpath(__file__) )
engineFilePath = os.path.join(DIR_PATH, "engine.rmc")

I tried some things and found the following. 
plot.py seems to work when running it by itself.

It also works when typing commands directly in command prompt according to run.py procedure.

But executing plot.py from run.py fails, even if DIR_PATH and engineFilePath are correct.

Maybe it's a problem with my computer...

For now, it's ok because the programs runs separately.

Thank you for your support

2020年8月6日木曜日 9:42:17 UTC+9 Bachir Aoun:
Reply all
Reply to author
Forward
0 new messages