# Error in import HyperOptSearch

**URL:** <https://discuss.ray.io/t/error-in-import-hyperoptsearch/6681>\
**Category:** Ray Tune\
**Created:** [July 1, 2022, 2:33am UTC](https://discuss.ray.io/t/error-in-import-hyperoptsearch/6681 "2022-07-01T02:33:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hermmanhender](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/hermmanhender/32/5691_2.png) [@hermmanhender](https://discuss.ray.io/u/hermmanhender)\
**Post date:** [July 1, 2022, 2:33am UTC](https://discuss.ray.io/t/error-in-import-hyperoptsearch/6681/1 "2022-07-01T02:33:45Z")

</div>

Hi!  
I would try to use HyperOptSearch to tune my experiment, but VSCode don’t find the class when I write `from ray.tune.search.hyperopt import HyperOptSearch` in my python programm.

Any suggestion how to fix it?

 ![image](https://us1.discourse-cdn.com/flex020/uploads/ray/original/2X/f/fa74915c1663eccbe316c7c38149634a568759e8.png)

Best!

---

<div class="post-metadata">

**Author:** ![xwjiang2010](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/xwjiang2010/32/1476_2.png) [@xwjiang2010](https://discuss.ray.io/u/xwjiang2010)\
**Post date:** [July 1, 2022, 6:06pm UTC](https://discuss.ray.io/t/error-in-import-hyperoptsearch/6681/2 "2022-07-01T18:06:52Z")

</div>

@hermmanhender  
There has been some recent refactoring [[PR](https://github.com/ray-project/ray/pull/26074)], that I suspect is related to what you are experiencing?  
May I ask which version of Ray are you using?  
Could that be your VSCode needs to re-index the files?

---

<div class="post-metadata">

**Author:** ![hermmanhender](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/hermmanhender/32/5691_2.png) [@hermmanhender](https://discuss.ray.io/u/hermmanhender)\
**Post date:** [July 1, 2022, 6:40pm UTC](https://discuss.ray.io/t/error-in-import-hyperoptsearch/6681/3 "2022-07-01T18:40:28Z")

</div>

Thanks for your response @xwjiang2010 . Yes, I think that must be the problem. I’m using Ray 1.13 and I checked the files and I have the “suggest” folder instead of “search”. How should I do to update the directory? I reinstalled Ray, but it didn’t fix it. Thank you!

---

<div class="post-metadata">

**Author:** ![xwjiang2010](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/xwjiang2010/32/1476_2.png) [@xwjiang2010](https://discuss.ray.io/u/xwjiang2010)\
**Post date:** [July 1, 2022, 9:12pm UTC](https://discuss.ray.io/t/error-in-import-hyperoptsearch/6681/4 "2022-07-01T21:12:17Z")

</div>

Got it.  
Since you are still using 1.13, it is expected - the change was not in 1.13 and is only on master.  
You can either

1. use 1.13 and import suggest.xxx, or
2. install nightly ray instead and use search.xxx.

See instructions on installing nightly ray: [Installing Ray — Ray 1.13.0](https://docs.ray.io/en/latest/ray-overview/installation.html#daily-releases-nightlies)

---

<div class="post-metadata">

**Author:** ![Antonio\_Nicolae](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/antonio_nicolae/32/5587_2.png) [@Antonio\_Nicolae](https://discuss.ray.io/u/Antonio_Nicolae)\
**Post date:** [January 8, 2024, 10:57pm UTC](https://discuss.ray.io/t/error-in-import-hyperoptsearch/6681/5 "2024-01-08T22:57:52Z")

</div>

This was the solution, the right solution, I had to update Ray, by doing this: pip install -U ray and after that I restarted VSCode and it was working. Thanks a lot for your help.
