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

matmodlab2 installation #11

Open
Qalkaseasbeh opened this issue Mar 17, 2017 · 21 comments
Open

matmodlab2 installation #11

Qalkaseasbeh opened this issue Mar 17, 2017 · 21 comments

Comments

@Qalkaseasbeh
Copy link

Hello,

I'm still new to this tool, so my question is very simple.

I downloaded matmodlab, and (prerequisites: python, numpy, and scipy), but I don't know how to install matmodlab itself, I cannot understand how it works. could you help please?

Thanks a lot.

@sswan
Copy link
Member

sswan commented Mar 17, 2017

It should be enough to download the zip file, unzip it, then set your working directory to the extracted folder. There is no need to install, so long as your working directory includes the matmodlab2 directory.

@Qalkaseasbeh
Copy link
Author

You mean Python directory (working directory), right?

@sswan
Copy link
Member

sswan commented Mar 17, 2017

Yes, the PYTHONPATH.

@Qalkaseasbeh
Copy link
Author

Would you mind telling how I can do that?

@sswan
Copy link
Member

sswan commented Mar 17, 2017

Without knowing your specific setup, your best best would be to follow the instructions at this website:

http://stackoverflow.com/questions/3701646/how-to-add-to-the-pythonpath-in-windows-7

However, if you are using an IDE (such as Canopy) there is an option to set the working directory (which is slightly different from the PYTHONPATH, but would do the same thing for you).

@Qalkaseasbeh
Copy link
Author

Thanks a lot for your help. Let me try with this.

@tjfulle
Copy link
Collaborator

tjfulle commented Mar 17, 2017

Thanks @Qalkaseasbeh for the questions/feedbacks!

At its heart, matmodlab2 is just a python package. So, "installation" can be as easy as cloning the repository to wherever you like and adding the directory to the PYTHONPATH environment variable. For example, suppose you clone (or download and unzip) matmodlab2 to /home/user/Documents/matmodlab2, then in your bash shell just do:

export PYTHONPATH=/home/user/Documents/matmodlab2

or in csh

setenv PYTHONPATH /home/user/Documents/matmodlab2

On windows, you have to go to

Computer > Properties > Advanced system settings > Environment Variables

and then edit or add the path to matmodlab2 to the PYTHONPATH. See How do I set or change the PATH system variable? for more details.

Note: Inside of the matmodlab2 directory that is cloned is another directory named matmodlab2 as well. The PYTHONPATH must be set to the first matmodlab2 directory as shown above and not /home/user/Documents/matmodlab2/matmodlab2.

I prefer to work in a terminal environment, but I believe that most python IDE's (like Spyder) allow you to set the working directory or PYTHONPATH directly in their settings.

To get a start with matmodlab2, I highly recommend (after setting the PYTHONPATH) looking at the notebooks in matmodlab2/notebooks. To look at the notebooks, you need to have Jupyter notebook installed. The notebooks are live tutorials of how to use matmodlab2 and there are many examples of material models. There is also a notebook on writing Abaqus UMATs. If you don't have Jupyter installed, I highly recommend installing Anaconda and using their python distribution. It's just not worth the pain of getting all of the Python dependencies and Jupyter and Spyder and ... installed. Let the Anaconda team do that for you. The Anaconda Launcher program can launch Jupyter notebooks and Spyder IDE sessions. If you don't have Jupyter, the notebooks can be viewed directly on github.

@tjfulle
Copy link
Collaborator

tjfulle commented Mar 17, 2017

@Qalkaseasbeh, I would also recommend cloning and not downloading - I push through changes often and by cloning you can easily pull down the changes.

@Qalkaseasbeh
Copy link
Author

Thanks a lot for your deep explanation.

I did add the path to matmodlab2 to the PYTHONPATH, but How can I check it's done perfectly?
In the second comment, you said " I would also recommend cloning and not downloading", and I wanna keep updated with changes you make, but how can I do that?

I did download ANACONDA. I'm totally new for all these stuff and I'll follow your recommendations to start.

Once again, Thank you.

@tjfulle
Copy link
Collaborator

tjfulle commented Mar 19, 2017

@Qalkaseasbeh said

I did add the path to matmodlab2 to the PYTHONPATH, but How can I check it's done perfectly?

I did download ANACONDA. I'm totally new for all these stuff and I'll follow your recommendations to start.

So, open the Anaconda Launcher application, launch the QT Console app and execute

import sys
print(sys.path)

If you don't see the Matmodlab2 path in the resultant list, you did not do it right.

In the second comment, you said " I would also recommend cloning and not downloading", and I wanna keep updated with changes you make, but how can I do that?

Google "how to set up git on windows". After getting it set up, launch the git bash console and

cd <path where you want matmodlab>
git clone https://www.github.com/matmodlab/matmodlab2 

Make sure this path is in your PYTHONPATH.

I'd then go through the Matmodlab2 tutorials with the Jupyter notebook app that is bundled with Anaconda.

@Qalkaseasbeh
Copy link
Author

I did what you recommended:

1- So, open the Anaconda Launcher application, launch the QT Console app and execute

import sys
print(sys.path)

Me: I see the path where I downloaded matmodlab2 ('C:\Users\qusay.alkaseasbeh\Documents') as attached in picture.

capture

2- Google "how to set up git on windows". After getting it set up, launch the git bash console and

cd
git clone https://www.github.com/matmodlab/matmodlab2
Make sure this path is in your PYTHONPATH.

Me: I did, but It didn't accept the path. see the attached please.
git

@tjfulle
Copy link
Collaborator

tjfulle commented Mar 19, 2017

The error is pretty clear - you already have a directory named matmodlab2 in that directory. You'll have to change its name or remove it before cloning

@Qalkaseasbeh
Copy link
Author

Yeah, there is unzip file in this folder ('C:\Users\qusay.alkaseasbeh\Documents'), but it doesn't accept any path doesn't have this unzip file.

Queation: since I got done with first method, could I start studying the examples?

Sorry for disturbing

@tjfulle
Copy link
Collaborator

tjfulle commented Mar 19, 2017

Yes, you can use that version. I have made updates to the notebooks in the last two days, so you may want to download a newer version

@Qalkaseasbeh
Copy link
Author

I think everything looks good now, right? Taylor (Technical support at UND) helped me to get this stage.

Thanks a lot tjfulle for the time you spent to help me yesterday.

capture
git

@Qalkaseasbeh
Copy link
Author

Hello,

I've started practicing some examples but I'm running into this issue (attached). Could you help please?
capture

@tjfulle
Copy link
Collaborator

tjfulle commented Mar 24, 2017

Your PYTHONPATH is probably incorrect. See our previous conversations.

@Qalkaseasbeh
Copy link
Author

I checked it with (import sys, print(sys.path) and it's supposed to be okay (I attached what I got 4 days ago).

@tjfulle
Copy link
Collaborator

tjfulle commented Mar 24, 2017

matmodlab2 is just a python package, so if your PYTHONPATH is correct, it will load. You can try launching the terminal session from the matmodlab2 directory. Or, see if you can set the PYTHONPATH from the QT console's preferences. I've never used the Jupyter console, but that's what I would do to start.

@Qalkaseasbeh
Copy link
Author

" You can try launching the terminal session from the matmodlab2 directory" How can I do it?

@tjfulle
Copy link
Collaborator

tjfulle commented Mar 24, 2017

I believe you make a shortcut to the app and then change the properties of the shortcut to launch where you want. I'm not a windows user, that's about all I know.

The best thing to do is figure out why Matmodlab2 is not being imported.

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

3 participants