Robyn icon indicating copy to clipboard operation
Robyn copied to clipboard

not working on mac/windows

Open byteface opened this issue 3 years ago • 9 comments

i tried on all 3 platforms with/without venv. only seems to work on linux.

mac error: ...robyntest/venv/lib/python3.10/site-packages/robyn/init.py", line 9, in from .robyn import Server, SocketHeld ModuleNotFoundError: No module named 'robyn.robyn'

one difference i noticed is the linux one has a .so file where the mac does not. neither does the windows but that error is

File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2544.0_x64__qbz5n2kfra8p0\lib\pickle.py", line 578, in save rv = reduce(self.proto) TypeError: cannot pickle 'builtins.SocketHeld' object

.........testrobyn>Traceback (most recent call last): File "", line 1, in ......\venv\lib\site-packages\multiprocess\spawn.py", line 102, in spawn_main source_process = _winapi.OpenProcess( OSError: [WinError 87] The parameter is incorrect

byteface avatar Dec 21 '21 23:12 byteface

Hi @byteface ,

Thank you for reporting the errors and apologies for the late response. Windows error is evident and I will fix try to fix this in the latest release.

However, it is installing fine on my mac.

Can you list your python version, pip version and osx version?

sansyrox avatar Dec 22 '21 17:12 sansyrox

Sure, python 3.10 with latest pip. (Just tried with upgraded pip. still no luck)

tbf it's a 18mnth old mac on catalina.(2 versions back) but that OS is still under 13 months since it was officially replaced.

byteface avatar Dec 22 '21 20:12 byteface

@byteface , is your mac an intel mac or an apple silicon mac?

sansyrox avatar Dec 23 '21 07:12 sansyrox

@byteface , I was able to replicate your issue. You can fix the mac issue by upgrading your pip in your venv.

sansyrox avatar Dec 26 '21 21:12 sansyrox

I think the wheel file it's downloading on mac doesn't have the prebuild rust binaries it should.

myers avatar Jan 18 '22 03:01 myers

@myers , I think I've made a change in the latest versions(not released yet.)

Can you please try pip install setuptools wheel and then do pip install robyn ?

I just want to check if it works that way.

sansyrox avatar Jan 18 '22 21:01 sansyrox

pip was already latest.

installing latest robyn still missing the binaries even with setuptools/wheel.

byteface avatar Jan 18 '22 21:01 byteface

❯ pip install -U setuptools wheel
Requirement already satisfied: setuptools in /Users/myers/.pyenv/versions/3.10.1/lib/python3.10/site-packages (58.1.0)
Collecting setuptools
  Downloading setuptools-60.5.0-py3-none-any.whl (958 kB)
     |████████████████████████████████| 958 kB 2.5 MB/s
Requirement already satisfied: wheel in /Users/myers/.pyenv/versions/3.10.1/lib/python3.10/site-packages (0.37.1)
Installing collected packages: setuptools
  Attempting uninstall: setuptools
    Found existing installation: setuptools 58.1.0
    Uninstalling setuptools-58.1.0:
      Successfully uninstalled setuptools-58.1.0
Successfully installed setuptools-60.5.0

❯ pip uninstall robyn
Found existing installation: robyn 0.11.1
Uninstalling robyn-0.11.1:
  Would remove:
    /Users/myers/.pyenv/versions/3.10.1/lib/python3.10/site-packages/robyn-0.11.1.dist-info/*
    /Users/myers/.pyenv/versions/3.10.1/lib/python3.10/site-packages/robyn/*
Proceed (Y/n)? y
  Successfully uninstalled robyn-0.11.1

then I tried to install robyn but same thing and it said it was using a cached wheel. I found that *whl file and deleted and did this:

❯ pip install -U robyn
Collecting robyn
  Downloading robyn-0.11.1-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (3.7 MB)
     |████████████████████████████████| 3.7 MB 1.8 MB/s
Collecting uvloop==0.16.0
  Downloading uvloop-0.16.0-cp39-cp39-macosx_10_9_x86_64.whl (1.5 MB)
     |████████████████████████████████| 1.5 MB 3.1 MB/s
Collecting multiprocess==0.70.12.2
  Downloading multiprocess-0.70.12.2-py39-none-any.whl (128 kB)
     |████████████████████████████████| 128 kB 3.5 MB/s
Collecting watchdog==2.1.3
  Downloading watchdog-2.1.3-cp39-cp39-macosx_10_9_x86_64.whl (84 kB)
     |████████████████████████████████| 84 kB 3.4 MB/s
Collecting dill>=0.3.4
  Downloading dill-0.3.4-py2.py3-none-any.whl (86 kB)
     |████████████████████████████████| 86 kB 3.9 MB/s
Installing collected packages: dill, watchdog, uvloop, multiprocess, robyn
Successfully installed dill-0.3.4 multiprocess-0.70.12.2 robyn-0.11.1 uvloop-0.16.0 watchdog-2.1.3
WARNING: You are using pip version 21.0.1; however, version 21.3.1 is available.
You should consider upgrading via the '/Users/myers/.pyenv/versions/3.9.2/bin/python3.9 -m pip install --upgrade pip' command.

I tried to run a simple server, no luck

❯ python3 server.py
Traceback (most recent call last):
  File "/Users/myers/p/exp/robyn_test/server.py", line 1, in <module>
    from robyn import Robyn
  File "/Users/myers/.pyenv/versions/3.10.1/lib/python3.10/site-packages/robyn/__init__.py", line 8, in <module>
    from .robyn import Server, SocketHeld
ModuleNotFoundError: No module named 'robyn.robyn'

Upgraded pip as it suggested and then reinstalled robyn

❯ pip install -U robyn
Collecting robyn
  Using cached robyn-0.11.1.tar.gz (72 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: watchdog<3.0.0,>=2.1.3 in /Users/myers/.pyenv/versions/3.10.1/lib/python3.10/site-packages (from robyn) (2.1.6)
Building wheels for collected packages: robyn
  Building wheel for robyn (pyproject.toml) ... done
  Created wheel for robyn: filename=robyn-0.11.1-py3-none-any.whl size=7414 sha256=99a82c0490ba5311eb6c54b090f76adf7643a050bbfa62f1ed59ce8ee9d95278
  Stored in directory: /Users/myers/Library/Caches/pip/wheels/32/06/fd/f86202b0831e3b21fcfa3f7799f6e389eb029eec537c7c8797
Successfully built robyn
Installing collected packages: robyn
Successfully installed robyn-0.11.1

different but still same error if I try and run example (same error as above)

myers avatar Jan 18 '22 21:01 myers

@myers @byteface , this is very strange. I will be releasing v0.12.0 in a day or two and this should be hopefully fixed then. I have changed the build backend for the latest version.

sansyrox avatar Jan 18 '22 22:01 sansyrox

@myers @byteface , this issue is fixed in (v0.17.3)

https://github.com/sansyrox/robyn/pull/261

sansyrox avatar Aug 22 '22 13:08 sansyrox