# Weired question

**URL:** https://discuss.ray.io/t/weired-question/8785
**Category:** Ray Core
**Created:** [December 26, 2022, 12:56pm UTC](https://discuss.ray.io/t/weired-question/8785 "2022-12-26T12:56:09Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![more](https://avatars.discourse-cdn.com/v4/letter/m/2bfe46/32.png) [@more](https://discuss.ray.io/u/more)
#### Post date: [December 26, 2022, 12:56pm UTC](https://discuss.ray.io/t/weired-question/8785/1 "2022-12-26T12:56:09Z")

</div>

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

- High: It blocks me to complete my task.

import ray  
from selenium import webdriver  
ray.init()

@ray.remote  
class test:  
fg = False  
def **init** (self):  
if test.fg: return  
test.fg = True  
self.driver = webdriver.Chrome()

w = [test.remote() for \_ in range(4)]

This part of the code would have worked fine in pycharm (four chrome Windows would have popped up), but if the py test.py statement had not achieved the same result on the command line, nothing would have ended in a few seconds, and no chrome window would have popped up. My pycharm uses the system python interpreter native to my computer and does not use a virtual environment. The same problem applies to ubuntu. It has nothing to do with the python version, I’ve tried it all, and it has nothing to do with the computer system. Who knows what happened.

---

<div class="post-metadata">

### Author: ![more](https://avatars.discourse-cdn.com/v4/letter/m/2bfe46/32.png) [@more](https://discuss.ray.io/u/more)
#### Post date: [December 26, 2022, 12:58pm UTC](https://discuss.ray.io/t/weired-question/8785/2 "2022-12-26T12:58:52Z")

</div>

![IMG_20221226_205824](https://us1.discourse-cdn.com/flex020/uploads/ray/original/2X/2/26093e7b615fd425c7f7ec3be33929ee27b220fa.jpeg)

---

<div class="post-metadata">

### Author: ![more](https://avatars.discourse-cdn.com/v4/letter/m/2bfe46/32.png) [@more](https://discuss.ray.io/u/more)
#### Post date: [December 26, 2022, 1:31pm UTC](https://discuss.ray.io/t/weired-question/8785/3 "2022-12-26T13:31:09Z")

</div>

![IMG_20221226_212837](https://us1.discourse-cdn.com/flex020/uploads/ray/original/2X/d/d6391a965529c50fbe86298f1fb6a43f8d1a71ed.jpeg)  
If I uncheck this option in the pycharm run configuration, chrome won’t pop up either

---

<div class="post-metadata">

### Author: ![Chen\_Shen](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/chen_shen/32/1486_2.png) [@Chen\_Shen](https://discuss.ray.io/u/Chen_Shen)
#### Post date: [January 2, 2023, 10:16pm UTC](https://discuss.ray.io/t/weired-question/8785/4 "2023-01-02T22:16:57Z")

</div>

hmm, i wonder if it’s because the actors have been deallocated after you finished the script. What happens if you add a sleep after line 16?

---

<div class="post-metadata">

### Author: ![more](https://avatars.discourse-cdn.com/v4/letter/m/2bfe46/32.png) [@more](https://discuss.ray.io/u/more)
#### Post date: [January 3, 2023, 9:10pm UTC](https://discuss.ray.io/t/weired-question/8785/5 "2023-01-03T21:10:57Z")

</div>

**Thanks for your reply, I tried time.sleep(), after my continuous research I have now solved the problem, the reason I am sure is related to the root thread or process, if I introduce a new thread/process to the main code then I will not have such a strange problem.**

**The reason that checking python console in pycharm makes a difference is that pycharm python console has ipython built in, and if it is checked, it introduces new processes/threads which in turn have an effect, but the deeper reason for this I can’t say.**
