compas-dev / compas_cloud

COMPAS Remote Procedure Calls using websockets
MIT License
6 stars 3 forks source link

Within VS Code the wrong python is used. #5

Open tomvanmele opened 4 years ago

tomvanmele commented 4 years ago
(fofin) vanmelet@Tom-Van-Meles-MacBook-Pro compas-FormFinder % /Users/vanmelet/anaconda3/envs/fofin/bin/python /Users/vanmelet/Code/compas-FormFinder/scripts/02_fofin_fd_rhino.py
Starting new cloud server in background at 127.0.0.1:9000
Traceback (most recent call last):
  File "/Users/vanmelet/Code/compas_cloud/src/compas_cloud/proxy.py", line 214, in start_server
    client = Client(self.host, self.port)
  File "/Users/vanmelet/Code/compas_cloud/src/compas_cloud/client_websockets.py", line 28, in __init__
    asyncio.get_event_loop().run_until_complete(connect())
  File "/Users/vanmelet/anaconda3/envs/fofin/lib/python3.7/asyncio/base_events.py", line 583, in run_until_complete
    return future.result()
  File "/Users/vanmelet/Code/compas_cloud/src/compas_cloud/client_websockets.py", line 27, in connect
    self.websocket = await websockets.connect(uri, max_size=2**30)
  File "/Users/vanmelet/anaconda3/envs/fofin/lib/python3.7/site-packages/websockets/client.py", line 535, in __await_impl__
    transport, protocol = await self._create_connection()
  File "/Users/vanmelet/anaconda3/envs/fofin/lib/python3.7/asyncio/base_events.py", line 958, in create_connection
    raise exceptions[0]
  File "/Users/vanmelet/anaconda3/envs/fofin/lib/python3.7/asyncio/base_events.py", line 945, in create_connection
    await self.sock_connect(sock, address)
  File "/Users/vanmelet/anaconda3/envs/fofin/lib/python3.7/asyncio/selector_events.py", line 473, in sock_connect
    return await fut
  File "/Users/vanmelet/anaconda3/envs/fofin/lib/python3.7/asyncio/selector_events.py", line 503, in _sock_connect_cb
    raise OSError(err, f'Connect call failed {address}')
ConnectionRefusedError: [Errno 61] Connect call failed ('127.0.0.1', 9000)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/vanmelet/Code/compas-FormFinder/scripts/02_fofin_fd_rhino.py", line 34, in <module>
    proxy = Proxy()
  File "/Users/vanmelet/Code/compas_cloud/src/compas_cloud/proxy.py", line 90, in __init__
    self.client = self.start_server()
  File "/Users/vanmelet/Code/compas_cloud/src/compas_cloud/proxy.py", line 224, in start_server
    raise RuntimeError(err.decode())
RuntimeError: /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: No module named compas_cloud
tomvanmele commented 4 years ago

the last line is no good :)

RuntimeError: /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: No module named compas_cloud
Licini commented 4 years ago

@brgcode it uses compas._os.select_python() for getting the python executable. I think by calling the binary directly it somehow couldn't mount this part from compas_bootstrapper import PYTHON_DIRECTORY , let me see what to do to fix that..... https://github.com/BlockResearchGroup/compas_cloud/blob/064483c5ad5e128e585aaa1b5d390c43d055342f/src/compas_cloud/proxy.py#L84

Licini commented 4 years ago

@brgcode is this one still relevant?