help me with this libraries - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: Data Science (https://python-forum.io/forum-44.html) +--- Thread: help me with this libraries (/thread-7339.html) |
help me with this libraries - Kiasheen - Jan-04-2018 hello I have a code starting with "from Classes import LoadAtom , Atom" and I cant get them installed on my python pakages like numpy and scipy are installed but not this one code also contains: ----------------------------code----------------------------------- from Classes import LoadAtom , Atom ? from numpy import dot , transpose , conj , divide , sqrt , add , zeros , multiply ,\ round , sum , copy , argmax from scipy . linalg . decomp import eigh from numpy . linalg . linalg import solve from numpy . core . umath import subtract from MatrixFunctions_Atoms import BuildTotalMatrices ? from Petersson_Hellsing import BuildAtomicMatrices ? ... -------------------------------------------------------------------- Ive put a question mark at the end of lines I have problem with. Please answer! this is a student project thank you for helping RE: help me with this libraries - nilamo - Jan-04-2018 Are you sure they need to be installed? Everything else is a common package in python, those might just be files provided to you from the class. RE: help me with this libraries - snippsat - Jan-04-2018 It work for me λ ptpython >>> from Classes import LoadAtom >>> obj = LoadAtom() >>> obj.foo 'hello'I have of course cheated to get this to work. It will be somewhat similar for you. Example i have a file Classes.py in that file there can be 2 classes LoadAtom and Atom.So this is local code that get imported and can work together with the other module you import. My setup to get code over to work: C:\Python36\Classes.py In Classes.py: class LoadAtom: foo = 'hello' RE: help me with this libraries - buran - Jan-04-2018 Obviously OP has the code from http://www.aau.dk/digitalAssets/281/281541_speciale---applied-hartree-fock-methods.pdf see Annex 3 RE: help me with this libraries - snippsat - Jan-04-2018 (Jan-04-2018, 09:57 PM)buran Wrote: Obviously OP has the code from http://www.aau.dk/digitalAssets/281/281541_speciale---applied-hartree-fock-methods.pdfIf it obvious can be discussed Think i have to read my mathematics learning book again, but i guess it to basic for this RE: help me with this libraries - Gribouillis - Jan-04-2018 The best thing to do is to obtain the code by emailing the article's authors. RE: help me with this libraries - Kiasheen - Jan-06-2018 (Jan-04-2018, 09:53 PM)nilamo Wrote: Are you sure they need to be installed? Everything else is a common package in python, those might just be files provided to you from the class. Im not really sure about anything! but without installing them , an error occurs while runnig the code. (Jan-04-2018, 09:54 PM)snippsat Wrote: It work for me Could you plz. be more specific, Im not good at python coding! RE: help me with this libraries - snippsat - Jan-06-2018 (Jan-06-2018, 08:21 PM)Kiasheen Wrote: Could you plz. be more specific, Im not good at python coding!You need to talk with your teacher to get the file that used for this import. I have look in the PDF posted,no code for LoadAtom and Atom. What you missing is a file called Classes.py that i guess contain two classes LoadAtom and Atom. Same with this import. from Petersson_Hellsing import BuildAtomicMatriceSo this is a file from T Petersson and B Hellsing,which you probably know who is when study in this field. |