# Building Ray from Source - update AxSearch

**URL:** <https://discuss.ray.io/t/building-ray-from-source-update-axsearch/21978>\
**Category:** Ray Tune\
**Created:** [March 6, 2025, 4:07pm UTC](https://discuss.ray.io/t/building-ray-from-source-update-axsearch/21978 "2025-03-06T16:07:13Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![VMLC-PV](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/vmlc-pv/32/7748_2.png) [@VMLC-PV](https://discuss.ray.io/u/VMLC-PV)\
**Post date:** [March 6, 2025, 4:07pm UTC](https://discuss.ray.io/t/building-ray-from-source-update-axsearch/21978/1 "2025-03-06T16:07:13Z")

</div>

**How severe does this issue affect your experience of using Ray?**

- Low: It annoys or frustrates me for a moment.

I was trying to update ax\_search.py to make it work with newer versions of ax and I wanted to run the test to make sure that what I did works.

While doing so I forked the ray repo and tried to build from the source using the instructions from this [page](https://docs.ray.io/en/latest/ray-contribute/development.html#python-develop) but I keep getting the same error when I try to run:  
`python -m pytest -v -s python/ray/tune/tests/test_api.py`

error:

```ImportError
python/ray/ __init__.py:85: in <module>
    import ray._raylet # noqa: E402
E ModuleNotFoundError: No module named 'ray._raylet'

```

I looked around but could not find a solution. Any ideas?

---

<div class="post-metadata">

**Author:** ![christina](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/christina/32/7542_2.png) [@christina](https://discuss.ray.io/u/christina)\
**Post date:** [March 6, 2025, 9:03pm UTC](https://discuss.ray.io/t/building-ray-from-source-update-axsearch/21978/2 "2025-03-06T21:03:28Z")

</div>

Hi, what version of ax did you upgrade to and what version of Ray are you using?

---

<div class="post-metadata">

**Author:** ![VMLC-PV](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/vmlc-pv/32/7748_2.png) [@VMLC-PV](https://discuss.ray.io/u/VMLC-PV)\
**Post date:** [March 7, 2025, 8:42am UTC](https://discuss.ray.io/t/building-ray-from-source-update-axsearch/21978/3 "2025-03-07T08:42:15Z")

</div>

Well, I took the last one from the [master branch](https://github.com/VMLC-PV/ray) yesterday. And the latest version of Ax (0.5.0).  
If I just pip install ray and overwrite the ax\_search.py script following some of the suggestions steaming from this [PR](https://github.com/ray-project/ray/pull/45902) I actually can run ray with the last ax version just fine.  
When I realized this and considering the fact that the PR was inactive for a while I thought I would try to make one myself to solve the issue but I failed miserably 😅

---

<div class="post-metadata">

**Author:** ![christina](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/christina/32/7542_2.png) [@christina](https://discuss.ray.io/u/christina)\
**Post date:** [March 7, 2025, 3:31pm UTC](https://discuss.ray.io/t/building-ray-from-source-update-axsearch/21978/4 "2025-03-07T15:31:33Z")

</div>

I’m glad you figured it out!! 🙂 Thank you for sharing

---

<div class="post-metadata">

**Author:** ![rliaw](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/rliaw/32/24_2.png) [@rliaw](https://discuss.ray.io/u/rliaw)\
**Post date:** [March 7, 2025, 8:34pm UTC](https://discuss.ray.io/t/building-ray-from-source-update-axsearch/21978/5 "2025-03-07T20:34:53Z")

</div>

BTW, for your original thing - you may want to try `pytest TEST_FILE.py` or `pytest --import-mode=importlib TEST_FILE.py`

---

<div class="post-metadata">

**Author:** ![VMLC-PV](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/vmlc-pv/32/7748_2.png) [@VMLC-PV](https://discuss.ray.io/u/VMLC-PV)\
**Post date:** [March 8, 2025, 12:57pm UTC](https://discuss.ray.io/t/building-ray-from-source-update-axsearch/21978/6 "2025-03-08T12:57:59Z")

</div>

I get the same thing…

```auto
ImportError while loading conftest '/home/user/Desktop/ray/python/ray/tune/tests/conftest.py'.
../../ __init__.py:85: in <module>
    import ray._raylet # noqa: E402
E ModuleNotFoundError: No module named 'ray._raylet'

```

---

<div class="post-metadata">

**Author:** ![seiji](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/seiji/32/7976_2.png) [@seiji](https://discuss.ray.io/u/seiji)\
**Post date:** [May 28, 2025, 4:03am UTC](https://discuss.ray.io/t/building-ray-from-source-update-axsearch/21978/7 "2025-05-28T04:03:27Z")

</div>

Hi @VMLC-PV, thanks for being part of the Ray community!

I just ran into the same problem myself. The following prodedure worked for me:

1. Install bazel: `ray/ci/env/install-bazel.sh`
2. Build `ray._raylet` from source: `bazel build //:ray_pkg`
3. Run test `pytest -vs test_application_state.py`
