Python Forum

Full Version: help me with this libraries
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
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.
It work for me Think
λ 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'
Obviously OP has the code from http://www.aau.dk/digitalAssets/281/2815...ethods.pdf
see Annex 3
(Jan-04-2018, 09:57 PM)buran Wrote: [ -> ]Obviously OP has the code from http://www.aau.dk/digitalAssets/281/2815...ethods.pdf
If it obvious can be discussed Confused
Think i have to read my mathematics learning book again,
but i guess it to basic for this Undecided
The best thing to do is to obtain the code by emailing the article's authors.
(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 Think
λ 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'

Could you plz. be more specific, Im not good at python coding!
(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 BuildAtomicMatrice
So this is a file from T Petersson and B Hellsing,which you probably know who is when study in this field.