Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sanic instalation on Windows #855

Closed
lucasvfventura opened this issue Jul 16, 2017 · 3 comments
Closed

Sanic instalation on Windows #855

lucasvfventura opened this issue Jul 16, 2017 · 3 comments

Comments

@lucasvfventura
Copy link

lucasvfventura commented Jul 16, 2017

Hi,

In order to install Sanic on Windows I went over the instructions to install it without uvloop and ujson, commands:
set SANIC_NO_UVLOOP=true
set SANIC_NO_UJSON=true
pip install sanic

I got the follow output, with the exception of {User} was my user:
Collecting sanic
Downloading sanic-0.5.4-py3-none-any.whl (43kB)
100% |████████████████████████████████| 51kB 290kB/s
Collecting websockets>=3.2 (from sanic)
Downloading websockets-3.3-py33.py34.py35.py36-none-any.whl
Collecting aiofiles>=0.3.0 (from sanic)
Downloading aiofiles-0.3.1-py3-none-any.whl
Collecting ujson>=1.35 (from sanic)
Downloading ujson-1.35.tar.gz (192kB)
100% |████████████████████████████████| 194kB 3.1MB/s
Collecting uvloop>=0.5.3 (from sanic)
Downloading uvloop-0.8.0.tar.gz (1.7MB)
100% |████████████████████████████████| 1.7MB 3.4MB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "C:\Users{User}\AppData\Local\Temp\pip-build-rnj1hcy_\uvloop\setup.py", line 11, in
raise RuntimeError('uvloop does not support Windows at the moment')
RuntimeError: uvloop does not support Windows at the moment

Although when I clone the project and do the following commands, it is successfully installed:
set SANIC_NO_UVLOOP=true
set SANIC_NO_UJSON=true
pip install .

@jamesstidard
Copy link
Contributor

It might make it a little more friendly to use sanic to tweak the setup.py to check the system it's installing on:

# setup.py
...
is_windows = sys.platform.startswith("win")
if strtobool(os.environ.get("SANIC_NO_UJSON", "no")) or is_windows:
    print("Installing without uJSON")
    requirements.remove(ujson)

# 'nt' means windows OS
if strtobool(os.environ.get("SANIC_NO_UVLOOP", "no")) or is_windows:
    print("Installing without uvLoop")
    requirements.remove(uvloop)
...

Or along the lines of #916 maybe make ujson and uvloop extras_require so you opt-in on pip install with pipenv install sanic[ujson,uvloop].

@abuckenheimer
Copy link
Contributor

@jamesstidard we merged #1117 in feb which should cover this, sanic just hasn't cut a pypi release in a while

@sjsadowski
Copy link
Contributor

With the 0.8.x release, this should be resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants