Jan-10-2019, 08:31 AM
Hi!
I am trying to incorporate Python in my Lazarus (IDE using Free Pascal) application using python4delphi (PythonForDelphi) components. They support both Delphi and Lazarus. I can execute both standard commands and commands from standard imports (math, random, itertools). But I can't use numpy or matplotlib.
I have an error "AttributeError: module 'numpy' has no attribute 'array'' for numpy when I am trying to use a numpy.array and an error "ImportError: cannot import name 'rcParams'" when I am using "import matplotlib.pyplot as plt".
Both libraries are working fine when used from installed Python. When I print sys.path from Lazarus it shows ['PythonPath\\python36.zip', 'PythonPath\\DLLs', 'PythonPath\\lib', 'ProgramPath', 'C:\\Users\\MyUser\\AppData\\Roaming\\Python\\Python36\\site-packages', 'PythonPath', 'PythonPath\\lib\\site-packages']. PythonPath is location where Python is installed, ProgramPath is location where Lazarus program is located.
Thanks in advance for your response.
I am trying to incorporate Python in my Lazarus (IDE using Free Pascal) application using python4delphi (PythonForDelphi) components. They support both Delphi and Lazarus. I can execute both standard commands and commands from standard imports (math, random, itertools). But I can't use numpy or matplotlib.
I have an error "AttributeError: module 'numpy' has no attribute 'array'' for numpy when I am trying to use a numpy.array and an error "ImportError: cannot import name 'rcParams'" when I am using "import matplotlib.pyplot as plt".
Both libraries are working fine when used from installed Python. When I print sys.path from Lazarus it shows ['PythonPath\\python36.zip', 'PythonPath\\DLLs', 'PythonPath\\lib', 'ProgramPath', 'C:\\Users\\MyUser\\AppData\\Roaming\\Python\\Python36\\site-packages', 'PythonPath', 'PythonPath\\lib\\site-packages']. PythonPath is location where Python is installed, ProgramPath is location where Lazarus program is located.
Thanks in advance for your response.