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

ImportError: No module named spearmint #66

Open
vatn opened this issue Jun 23, 2017 · 2 comments
Open

ImportError: No module named spearmint #66

vatn opened this issue Jun 23, 2017 · 2 comments

Comments

@vatn
Copy link

vatn commented Jun 23, 2017

Hi,
I use the anaconda2 in windows. I have installed all dependencies and succeed to install the package by executing :
python setup.py install

But when i tried to test the model by typing:
python main.py --driver=local --method=GPEIOptChooser --method-args=noiseless=1 ../examples/braninpy/config.pb

I met an error like :
setting up signal handler...
Using experiment configuration: ../examples/braninpy/config.pb
experiment dir: C:\Users\tianjinzi gao\Bayesian optimization\spearmint\spearmint\examples\braninpy
Traceback (most recent call last):
File "main.py", line 329, in
main()
File "main.py", line 164, in main
module = importlib.import_module('chooser.' + options.chooser_module)
File "C:\Anaconda2\lib\importlib_init_.py", line 37, in import_module
import(name)
File "C:\Users\tianjinzi gao\Bayesian optimization\spearmint\spearmint\spearmint\chooser\GPEIOptChooser.py", line 23, in
from spearmint import gp
ImportError: No module named spearmint

I tried to add the spearmint subdirectory in the PYTHONPATH by adding a .pth file containing the path of spearmint subdirectory in the $HOME/path/to/anaconda/lib/pythonX.X/site-packages .
However, there is always this error.

@leviboyles
Copy link

leviboyles commented Dec 6, 2017

I ran into the same issue (also anaconda on windows.) It seems the code is installed to site-packages directly, not in a folder called spearmint:

copying build\lib\chooser\cma.py -> C:\Anaconda3\envs\py27\Lib\site-packages\chooser
copying build\lib\chooser\CMAChooser.py -> C:\Anaconda3\envs\py27\Lib\site-packages\chooser
copying build\lib\chooser\GPConstrainedEIChooser.py -> C:\Anaconda3\envs\py27\Lib\site-packages\chooser
copying build\lib\chooser\GPEIChooser.py -> C:\Anaconda3\envs\py27\Lib\site-packages\chooser
copying build\lib\chooser\GPEIOptChooser.py -> C:\Anaconda3\envs\py27\Lib\site-packages\chooser
copying build\lib\chooser\GPEIperSecChooser.py -> C:\Anaconda3\envs\py27\Lib\site-packages\chooser
copying build\lib\chooser\RandomChooser.py -> C:\Anaconda3\envs\py27\Lib\site-packages\chooser
copying build\lib\chooser\RandomForestEIChooser.py -> C:\Anaconda3\envs\py27\Lib\site-packages\chooser
copying build\lib\chooser\SequentialChooser.py -> C:\Anaconda3\envs\py27\Lib\site-packages\chooser
copying build\lib\chooser_init_.py -> C:\Anaconda3\envs\py27\Lib\site-packages\chooser
creating C:\Anaconda3\envs\py27\Lib\site-packages\driver
copying build\lib\driver\dispatch.py -> C:\Anaconda3\envs\py27\Lib\site-packages\driver
copying build\lib\driver\local.py -> C:\Anaconda3\envs\py27\Lib\site-packages\driver
copying build\lib\driver\sge.py -> C:\Anaconda3\envs\py27\Lib\site-packages\driver
copying build\lib\driver_init_.py -> C:\Anaconda3\envs\py27\Lib\site-packages\driver
copying build\lib\ExperimentGrid.py -> C:\Anaconda3\envs\py27\Lib\site-packages
copying build\lib\gp.py -> C:\Anaconda3\envs\py27\Lib\site-packages
copying build\lib\helpers.py -> C:\Anaconda3\envs\py27\Lib\site-packages
copying build\lib\Locker.py -> C:\Anaconda3\envs\py27\Lib\site-packages
copying build\lib\runner.py -> C:\Anaconda3\envs\py27\Lib\site-packages
copying build\lib\sobol_lib.py -> C:\Anaconda3\envs\py27\Lib\site-packages
copying build\lib\spearmint_pb2.py -> C:\Anaconda3\envs\py27\Lib\site-packages
copying build\lib\util.py -> C:\Anaconda3\envs\py27\Lib\site-packages
byte-compiling C:\Anaconda3\envs\py27\Lib\site-packages\chooser\cma.py to cma.pyc
byte-compiling C:\Anaconda3\envs\py27\Lib\site-packages\chooser\CMAChooser.py to CMAChooser.pyc
byte-compiling C:\Anaconda3\envs\py27\Lib\site-packages\chooser\GPConstrainedEIChooser.py to GPConstrainedEIChooser.pyc
byte-compiling C:\Anaconda3\envs\py27\Lib\site-packages\chooser\GPEIChooser.py to GPEIChooser.pyc
byte-compiling C:\Anaconda3\envs\py27\Lib\site-packages\chooser\GPEIOptChooser.py to GPEIOptChooser.pyc
byte-compiling C:\Anaconda3\envs\py27\Lib\site-packages\chooser\GPEIperSecChooser.py to GPEIperSecChooser.pyc
byte-compiling C:\Anaconda3\envs\py27\Lib\site-packages\chooser\RandomChooser.py to RandomChooser.pyc
byte-compiling C:\Anaconda3\envs\py27\Lib\site-packages\chooser\RandomForestEIChooser.py to RandomForestEIChooser.pyc
byte-compiling C:\Anaconda3\envs\py27\Lib\site-packages\chooser\SequentialChooser.py to SequentialChooser.pyc
byte-compiling C:\Anaconda3\envs\py27\Lib\site-packages\chooser_init_.py to init.pyc
byte-compiling C:\Anaconda3\envs\py27\Lib\site-packages\driver\dispatch.py to dispatch.pyc
byte-compiling C:\Anaconda3\envs\py27\Lib\site-packages\driver\local.py to local.pyc
byte-compiling C:\Anaconda3\envs\py27\Lib\site-packages\driver\sge.py to sge.pyc
byte-compiling C:\Anaconda3\envs\py27\Lib\site-packages\driver_init_.py to init.pyc
byte-compiling C:\Anaconda3\envs\py27\Lib\site-packages\ExperimentGrid.py to ExperimentGrid.pyc
byte-compiling C:\Anaconda3\envs\py27\Lib\site-packages\gp.py to gp.pyc
byte-compiling C:\Anaconda3\envs\py27\Lib\site-packages\helpers.py to helpers.pyc
byte-compiling C:\Anaconda3\envs\py27\Lib\site-packages\Locker.py to Locker.pyc
byte-compiling C:\Anaconda3\envs\py27\Lib\site-packages\runner.py to runner.pyc
byte-compiling C:\Anaconda3\envs\py27\Lib\site-packages\sobol_lib.py to sobol_lib.pyc
byte-compiling C:\Anaconda3\envs\py27\Lib\site-packages\spearmint_pb2.py to spearmint_pb2.pyc
byte-compiling C:\Anaconda3\envs\py27\Lib\site-packages\util.py to util.pyc

As a workaround I created a "spearmint" directory in site-packages and moved all these files there, and created an empty init.py. It appears to solve the missing spearmint issue but now I'm running into issues with scipy.weave not being found (apparently weave is now separate from scipy, maybe this can be resolved with a downgrade.)

@mikecmpbll
Copy link

i seemed to fix this by moving the setup.py up a directory to ./spearmint, and editing the packages line in setup.py to:

packages=['spearmint', 'spearmint.driver', 'spearmint.chooser'],

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