Skip to content

Conversation

guoyuhong
Copy link
Contributor

@guoyuhong guoyuhong commented May 3, 2023

Description

Described by #5194

Motivation and Context

Since python setup.py build works fine, I compared the os.environ and found that pip install -e . add a strange PYTHONPATH to os.environ. Deleting it make the installation working fine.

@guoyuhong guoyuhong requested a review from a team as a code owner May 3, 2023 10:09
Signed-off-by: Yuhong Guo <yuhong.gyh@antgroup.com>
@guoyuhong guoyuhong force-pushed the fix_pip_editable branch from f6f04da to c1658d4 Compare May 3, 2023 10:11
guoyuhong added 3 commits May 3, 2023 19:13
Signed-off-by: Yuhong Guo <yuhong.gyh@antgroup.com>
Signed-off-by: Yuhong Guo <yuhong.gyh@antgroup.com>
Signed-off-by: Yuhong Guo <yuhong.gyh@antgroup.com>
@jcwchen jcwchen added the topic: build Issues related to ONNX builds and packages label May 4, 2023
@jcwchen jcwchen linked an issue May 4, 2023 that may be closed by this pull request
@justinchuby
Copy link
Member

Is this tested in all different environments: venv, conda and w/o venv?

@guoyuhong
Copy link
Contributor Author

@justinchuby I have tested this change in following envs:

  1. conda env in Linux, MacOS, Windows
  2. virtualenv in Linux and MacOS
  3. w/o venv(python installed in system) in Linux and MacOS

@jcwchen jcwchen added the run release CIs Use this label to trigger release tests in CI label May 4, 2023
@jcwchen jcwchen merged commit 8af2a3d into onnx:main May 11, 2023
@guoyuhong guoyuhong deleted the fix_pip_editable branch May 11, 2023 05:08
adityagoel4512 pushed a commit to adityagoel4512/onnx that referenced this pull request Jul 28, 2023
Signed-off-by: Yuhong Guo <yuhong.gyh@antgroup.com>
Co-authored-by: Yuhong Guo <yuhong.gyh@antgroup.com>
Co-authored-by: Chun-Wei Chen <jacky82226@gmail.com>
Signed-off-by: Aditya Goel <agoel4512@gmail.com>
cjvolzka added a commit that referenced this pull request Mar 1, 2024
### Description
* Fix source and pip tar.gz builds on s390x systems
* Revert (#5195) and replace with fix from [this comment](#5194 (comment)) from the original issue (#5194)

### Motivation and Context
* Building on s390x (and other environments depending on python setup) fails
    * The issue also can also appear when installing from pypi for environments where we don't have pre-built wheels
    * Failures include not being able to find pacakges dispite them being installed
        ```
              pip3 install -e .
              ...
              -- Could NOT find pybind11 (missing: pybind11_DIR)
              ...
              Traceback (most recent call last):
                File "/onnx/.setuptools-cmake-build/tools/protoc-gen-mypy.py", line 28, in <module>
                  import google.protobuf.descriptor_pb2 as d_typed
        ```
* The issue is cased by (#5195) which was to fix (#5194)
     * The original fix bypasses the pip venv PYTHONPATH and attempts to rely on sys.path. However without the pip venv PYTHONPATH, some modules may not be found even if they are installed.
         * For reference, the pip venv PYTHONPATH is set to  `/tmp/pip-build-env-bn_o_cjc/site` which contains `sitecustomize.py` which comes from https://github.com/pypa/pip/blob/main/tests/lib/venv.py#L171-L189
     * Instead of bypassing the pip venv PYTHONPATH, [this comment](#5194 (comment)) from the original issue shows how to address the issue using pyproject.toml's `[build-system]`
     * I replicated the origial issue and confirmed this fix resolves it.
     * I confirmed the builds work on s390x with this fix
cjvolzka added a commit that referenced this pull request Mar 1, 2024
* Fix builds from source and pip tar.gz on s390x systems
* Revert (#5195) and replace with fix from [this comment](#5194 (comment)) from the original issue (#5194)

### Motivation and Context
* Building on s390x (and other environments depending on python setup) fails
    * The issue also can also appear when installing `1.16.0rc1` from TestPyPI for environments where we don't have pre-built wheels
    * Failures include not being able to find pacakges despite them being installed
        ```
        pip3 install -e . ...
        -- Could NOT find pybind11 (missing: pybind11_DIR)
        ...
        Traceback (most recent call last): File "/onnx/.setuptools-cmake-build/tools/protoc-gen-mypy.py", line 28, in <module>
        import google.protobuf.descriptor_pb2 as d_typed
        ```
* The issue is cased by (#5195) which was to fix (#5194)
    * The original fix bypasses the pip venv PYTHONPATH and attempts to rely on sys.path. However without the pip venv PYTHONPATH, some modules may not be found even if they are installed.
        * For reference, the pip venv PYTHONPATH gets set to  `/tmp/pip-build-env-bn_o_cjc/site` which contains `sitecustomize.py` which comes from https://github.com/pypa/pip/blob/main/tests/lib/venv.py#L171-L189
    *  Instead of bypassing the pip venv PYTHONPATH, [this comment](#5194 (comment)) from the original issue shows how to address the issue using pyproject.toml's `[build-system]`
 * I replicated the origial issue and confirmed this fix resolves it.
 * I confirmed the builds work on s390x with this fix

Signed-off-by: Charles Volzka <cjvolzka@us.ibm.com>
github-merge-queue bot pushed a commit that referenced this pull request Mar 2, 2024
### Description
* Fix builds from source and pip tar.gz on s390x systems
* Revert (#5195) and replace with fix from [this
comment](#5194 (comment))
from the original issue (#5194)

### Motivation and Context
* Building on s390x (and other environments depending on python setup)
fails
* The issue also can also appear when installing `1.16.0rc1` from
TestPyPI for environments where we don't have pre-built wheels
* Failures include not being able to find pacakges despite them being
installed
        ``` 
        pip3 install -e . ... 
        -- Could NOT find pybind11 (missing: pybind11_DIR)
        ... 
Traceback (most recent call last): File
"/onnx/.setuptools-cmake-build/tools/protoc-gen-mypy.py", line 28, in
<module>
        import google.protobuf.descriptor_pb2 as d_typed 
        ```
* The issue is cased by (#5195) which was to fix (#5194) 
* The original fix bypasses the pip venv PYTHONPATH and attempts to rely
on sys.path. However without the pip venv PYTHONPATH, some modules may
not be found even if they are installed.
* For reference, the pip venv PYTHONPATH gets set to
`/tmp/pip-build-env-bn_o_cjc/site` which contains `sitecustomize.py`
which comes from
https://github.com/pypa/pip/blob/main/tests/lib/venv.py#L171-L189
* Instead of bypassing the pip venv PYTHONPATH, [this
comment](#5194 (comment))
from the original issue shows how to address the issue using
pyproject.toml's `[build-system]`
 * I replicated the origial issue and confirmed this fix resolves it.
 * I confirmed the builds work on s390x with this fix

Signed-off-by: Charles Volzka <cjvolzka@us.ibm.com>
cjvolzka added a commit that referenced this pull request Mar 2, 2024
### Description
* Cherry-pick (#5984) - Fix builds from source and pip tar.gz on s390x systems
* Revert (#5195) and replace with fix from [this comment](#5194 (comment)) from the original issue (#5194)

### Motivation and Context
* Building on s390x (and other environments depending on python setup) fails
    * The issue also can also appear when installing `1.16.0rc1` from TestPyPI for environments where we don't have pre-built wheels
    * Failures include not being able to find pacakges despite them being installed
        ```
        pip3 install -e . ...
        -- Could NOT find pybind11 (missing: pybind11_DIR)
        ...
        Traceback (most recent call last): File "/onnx/.setuptools-cmake-build/tools/protoc-gen-mypy.py", line 28, in <module>
        import google.protobuf.descriptor_pb2 as d_typed
        ```
* The issue is cased by (#5195) which was to fix (#5194)
    * The original fix bypasses the pip venv PYTHONPATH and attempts to rely on sys.path. However without the pip venv PYTHONPATH, some modules may not be found even if they are installed.
        * For reference, the pip venv PYTHONPATH gets set to  `/tmp/pip-build-env-bn_o_cjc/site` which contains `sitecustomize.py` which comes from https://github.com/pypa/pip/blob/main/tests/lib/venv.py#L171-L189
    *  Instead of bypassing the pip venv PYTHONPATH, [this comment](#5194 (comment)) from the original issue shows how to address the issue using pyproject.toml's `[build-system]`
 * I replicated the origial issue and confirmed this fix resolves it.
 * I confirmed the builds work on s390x with this fix

Signed-off-by: Charles Volzka <cjvolzka@us.ibm.com>
cjvolzka added a commit that referenced this pull request Mar 5, 2024
…5986)

### Description
* Cherry-pick (#5984) - Fix builds from source and pip tar.gz on s390x
systems
* Revert (#5195) and replace with fix from [this
comment](#5194 (comment))
from the original issue (#5194)

### Motivation and Context
* Building on s390x (and other environments depending on python setup)
fails * The issue also can also appear when installing `1.16.0rc1` from
TestPyPI for environments where we don't have pre-built wheels *
Failures include not being able to find pacakges despite them being
installed ``` pip3 install -e . ... -- Could NOT find pybind11 (missing:
pybind11_DIR) ...
Traceback (most recent call last): File
"/onnx/.setuptools-cmake-build/tools/protoc-gen-mypy.py", line 28, in
<module>
        import google.protobuf.descriptor_pb2 as d_typed
        ```
* The issue is cased by (#5195) which was to fix (#5194) * The original
fix bypasses the pip venv PYTHONPATH and attempts to rely on sys.path.
However without the pip venv PYTHONPATH, some modules may not be found
even if they are installed. * For reference, the pip venv PYTHONPATH
gets set to `/tmp/pip-build-env-bn_o_cjc/site` which contains
`sitecustomize.py` which comes from
https://github.com/pypa/pip/blob/main/tests/lib/venv.py#L171-L189 *
Instead of bypassing the pip venv PYTHONPATH, [this
comment](#5194 (comment))
from the original issue shows how to address the issue using
pyproject.toml's `[build-system]`
 * I replicated the origial issue and confirmed this fix resolves it.
 * I confirmed the builds work on s390x with this fix

Signed-off-by: Charles Volzka <cjvolzka@us.ibm.com>
isdanni pushed a commit to isdanni/onnx that referenced this pull request Mar 18, 2024
### Description
* Fix builds from source and pip tar.gz on s390x systems
* Revert (onnx#5195) and replace with fix from [this
comment](onnx#5194 (comment))
from the original issue (onnx#5194)

### Motivation and Context
* Building on s390x (and other environments depending on python setup)
fails
* The issue also can also appear when installing `1.16.0rc1` from
TestPyPI for environments where we don't have pre-built wheels
* Failures include not being able to find pacakges despite them being
installed
        ```
        pip3 install -e . ...
        -- Could NOT find pybind11 (missing: pybind11_DIR)
        ...
Traceback (most recent call last): File
"/onnx/.setuptools-cmake-build/tools/protoc-gen-mypy.py", line 28, in
<module>
        import google.protobuf.descriptor_pb2 as d_typed
        ```
* The issue is cased by (onnx#5195) which was to fix (onnx#5194)
* The original fix bypasses the pip venv PYTHONPATH and attempts to rely
on sys.path. However without the pip venv PYTHONPATH, some modules may
not be found even if they are installed.
* For reference, the pip venv PYTHONPATH gets set to
`/tmp/pip-build-env-bn_o_cjc/site` which contains `sitecustomize.py`
which comes from
https://github.com/pypa/pip/blob/main/tests/lib/venv.py#L171-L189
* Instead of bypassing the pip venv PYTHONPATH, [this
comment](onnx#5194 (comment))
from the original issue shows how to address the issue using
pyproject.toml's `[build-system]`
 * I replicated the origial issue and confirmed this fix resolves it.
 * I confirmed the builds work on s390x with this fix

Signed-off-by: Charles Volzka <cjvolzka@us.ibm.com>
Signed-off-by: isdanni <leedanni@gmail.com>
linshokaku pushed a commit to linshokaku/onnx that referenced this pull request Oct 2, 2024
### Description
* Fix builds from source and pip tar.gz on s390x systems
* Revert (onnx#5195) and replace with fix from [this
comment](onnx#5194 (comment))
from the original issue (onnx#5194)

### Motivation and Context
* Building on s390x (and other environments depending on python setup)
fails
* The issue also can also appear when installing `1.16.0rc1` from
TestPyPI for environments where we don't have pre-built wheels
* Failures include not being able to find pacakges despite them being
installed
        ```
        pip3 install -e . ...
        -- Could NOT find pybind11 (missing: pybind11_DIR)
        ...
Traceback (most recent call last): File
"/onnx/.setuptools-cmake-build/tools/protoc-gen-mypy.py", line 28, in
<module>
        import google.protobuf.descriptor_pb2 as d_typed
        ```
* The issue is cased by (onnx#5195) which was to fix (onnx#5194)
* The original fix bypasses the pip venv PYTHONPATH and attempts to rely
on sys.path. However without the pip venv PYTHONPATH, some modules may
not be found even if they are installed.
* For reference, the pip venv PYTHONPATH gets set to
`/tmp/pip-build-env-bn_o_cjc/site` which contains `sitecustomize.py`
which comes from
https://github.com/pypa/pip/blob/main/tests/lib/venv.py#L171-L189
* Instead of bypassing the pip venv PYTHONPATH, [this
comment](onnx#5194 (comment))
from the original issue shows how to address the issue using
pyproject.toml's `[build-system]`
 * I replicated the origial issue and confirmed this fix resolves it.
 * I confirmed the builds work on s390x with this fix

Signed-off-by: Charles Volzka <cjvolzka@us.ibm.com>
Signed-off-by: Linsho Kaku <linsho@preferred.jp>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
run release CIs Use this label to trigger release tests in CI topic: build Issues related to ONNX builds and packages
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

ModuleNotFoundError: No module named 'cmake' during pip install -e .
4 participants