Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem running CRM wing case #169

Closed
hknarahari opened this issue Sep 17, 2019 · 17 comments
Closed

Problem running CRM wing case #169

hknarahari opened this issue Sep 17, 2019 · 17 comments

Comments

@hknarahari
Copy link

I have been exploring the use of SMT package as a part of student curriculum here in our university, hence I have downloaded the package from github. I have tried out some of the examples without any issue but have run into a specific problem related to RMTB and RMTC methods. Either in the One_D_step or CRM_wing case I am getting a module not found error (screen shot attached). Any pointers to identify the error would be of great help.
SMT_CRM_Error

@relf
Copy link
Member

relf commented Sep 17, 2019

It looks like there is an installation problem. How did you install SMT?

@hknarahari
Copy link
Author

I downloaded the files and using Anaconda environment used pip install. If there anotherway PL let me know, I will un-install and re-install. However, some of the other cases worked .

@relf
Copy link
Member

relf commented Sep 17, 2019

If you have installed following the Readme here (pip install -e smt_dir) RMTB and RMTC are compiled on your machine during installation. Maybe something went wrong.

You can uninstall and then try to install from pypi directly with pip install smt.

@hknarahari
Copy link
Author

hknarahari commented Sep 18, 2019 via email

@relf
Copy link
Member

relf commented Sep 18, 2019

That was exactly what I suggested. As you use Windows you can get binary distribution with:
pip install smt
Downloading the code followed by pip install -e is for development mode i.e. when you want to develop within SMT library. If you just want to use SMT, direct install from Pypi with pip install smt is simpler (and does not require compilation on Windows).

@relf
Copy link
Member

relf commented Sep 18, 2019

See also documentation here

@hknarahari
Copy link
Author

Hi,
Did as instructed (uninstalled and installed again) and ran 'testflo'. While some tests ran OK some did not go through. As before I tried running CRM wing example and got a different error. I am attaching the testflo report as well as the screen shot of error message.

smt_rmtb_error
testflo_report.txt
Thanks for looking into my issues,
Narahari

@relf
Copy link
Member

relf commented Sep 23, 2019

First, two remarks:

  • Installation with pip install smt will work without compilation only with Python 3, but I noticed you are still using Python 2.7. In that case, it may work with a previous version of smt: pip install smt==0.2.2
  • I noticed you have an smt-master directory like you downloaded a zip then install from the zip file which will fail to compile RMTB or RMTC surrogates if you do not have the right C++ compiler.

So, please just try: pip install smt==0.2.2
If it installs smt 0.2.2 successfully then you can use the code from the smt zip file you downloaded to run the crm wing example.
python examples\rans_crm_wing\run_rans_crm_wing_rmtb.py
do not execute from smt-master\smt directory, it might mess with the smt code present in the directory and smt code installed on your system.

@hknarahari
Copy link
Author

Tried that but got this message
new_smt_error

@hknarahari
Copy link
Author

I was using Python 3.6 but had to change to 2.7 as a couple of other packages run only on that. Can I have both versions of python (on different drives) working in the same laptop ? if so I may do that

@relf
Copy link
Member

relf commented Sep 23, 2019

You can have several installations of Python. Then you just have to manage your paths consistently. The easier way to do that is to use Anaconda distribution with environments.

@relf
Copy link
Member

relf commented Sep 24, 2019

I realize that what I suggest depends on the hardware architecture as well and will only work with a windows amd_64 (which is the architecture of my machine with which I generate SMT binaries).
Otherwise you have to compile SMT successfully. Again for that, I would suggest to install Anaconda distribution.

@hknarahari
Copy link
Author

I have installed Anaconda with python 3.73 (have another environment for 2.7) , installed SMT using 'pip install smt' . Whn I run some of the cases in the tutorial (LS, QP, Krigging) it runs fine , but stops when I run the RMTB case. I am attaching the sc
latest_SMT_error
ree shot , as you can see .pyc files are there , but the error I get is 'smt.examples' module not found.

@relf
Copy link
Member

relf commented Sep 28, 2019

Examples are not meant to be installed (the smt.examples package is not found hence the error). It works when installing in development mode pip install -e smt_folder because the code is in the smt_folder.

If you want to make it work, copy rans_crm_wing.py and run_rans_crm_wing_rmtb.py in a directory, go in that directory, replace from smt.examples.rans_crm_wing.rans_crm_wing ... by from rans_crm_wing ... then just execute python run_rans_crm_wing_rmtb.py

@hknarahari
Copy link
Author

That is it ! working now. I guess I need to do the same for all the other cases in 'examples' directory. Btw, there are plot commands in the file but I did not see any plots, shoild I remove the 'agg' option in the Mathplotlib?

@relf
Copy link
Member

relf commented Sep 29, 2019

Indeed, comment out the matplotlib.use("Agg") line and you should see the plots.

@hknarahari
Copy link
Author

hknarahari commented Mar 24, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants