Oct-17-2020, 01:56 PM
(Oct-16-2020, 07:38 PM)bowlofred Wrote: It is unclear what exactly you are running after doing the install. You should not be trying to run those files directly, but should be importing pyGPs into your script.
As an example, this file should run without error.
import pyGPs print("import successful")If that works okay, you should be able to call the pyGPs functions from within your script.
Output:$ python test.py import successful
I try to do what you said, and I found some strange things:
import pyGPs print("import successful")and it shows
Error:Traceback (most recent call last):
File "C:\Users\elatm\.spyder-py3\temp.py", line 9, in <module>
import pyGPs
File "C:\Users\elatm\anaconda3\lib\site-packages\pyGPs\__init__.py", line 2, in <module>
import Optimization
ModuleNotFoundError: No module named 'Optimization'
So I check the place where it is wrong:from __future__ import absolute_import import Optimization import Validation import GraphExtensions from Core import * from Core.gp import * __all__ = ['Optimization', 'Validation', 'GraphExtensions', 'Core']and the error is
Error:Traceback (most recent call last):
File "C:\Users\elatm\anaconda3\lib\site-packages\pyGPs\__init__.py", line 2, in <module>
import Optimization
File "C:\Users\elatm\anaconda3\lib\site-packages\pyGPs\Optimization\__init__.py", line 2, in <module>
import scg
ModuleNotFoundError: No module named 'scg'
I go check the error placefrom __future__ import absolute_import import scg import minimize import confbut it turns out that the script above is correct(no error)
When I go back to the first script, same error occur again, and the error occur in the second script changes
the second script:
from __future__ import absolute_import import Optimization import Validation import GraphExtensions from Core import * from Core.gp import * __all__ = ['Optimization', 'Validation', 'GraphExtensions', 'Core']the error changes to
Error:Traceback (most recent call last):
File "C:\Users\elatm\anaconda3\lib\site-packages\pyGPs\__init__.py", line 3, in <module>
import Validation
File "C:\Users\elatm\anaconda3\lib\site-packages\pyGPs\Validation\__init__.py", line 2, in <module>
import valid
ModuleNotFoundError: No module named 'valid'
Then I run the script 'valid':from __future__ import absolute_import import validthe script is correct, and all of these become an error cycle: go back to first script, encounter error in first script, check second script(another error occur), run file(the file runs without error),go back to first script again...
It will finally output successfully
Output:import successful
but it requires lots of 'fixing', and can't run with the only script open:import pyGPs print("import successful")I can't import pyGPs without having to open all the other files, is this a normal situation? If not, does the version matters or the installation isn't correct?