diff --git a/.github/workflows/py.yml b/.github/workflows/py.yml index 95839d51e..a94de2947 100644 --- a/.github/workflows/py.yml +++ b/.github/workflows/py.yml @@ -23,7 +23,7 @@ jobs: - name: Set up Python 3.6 uses: actions/setup-python@v2 with: - python-version: 3.6 + python-version: '3.6' - name: Install dependencies # flake8-bugbear flake8-comprehensions are useful but not available internally @@ -52,18 +52,13 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up Python 3.9 - uses: actions/setup-python@v2 - with: - python-version: 3.9 - - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install --pre oneflow -f https://staging.oneflow.info/branch/master/cpu + python -m pip install --pre oneflow -f https://oneflow-staging.oss-cn-beijing.aliyuncs.com/branch/master/cpu python -m pip install pybind11 python -m pip install torch torchvision torchaudio - + - name: Build and install run: | python -m pip install -e . diff --git a/setup.py b/setup.py index 5874efab7..7d4a8f7d0 100644 --- a/setup.py +++ b/setup.py @@ -46,8 +46,12 @@ def write_version_file(): def get_pybind11(): - import pybind11 as pb - + try: + import pybind11 as pb + except ImportError: + print("pybind11 not found, installing...") + os.system(f"{sys.executable} -m pip install pybind11") + import pybind11 as pb return pb