Use distutils.sysconfig to detect python include#54292
Merged
copybara-service[bot] merged 1 commit intotensorflow:masterfrom Feb 9, 2022
Merged
Use distutils.sysconfig to detect python include#54292copybara-service[bot] merged 1 commit intotensorflow:masterfrom
copybara-service[bot] merged 1 commit intotensorflow:masterfrom
Conversation
On my latest mac sysconfig.get_path('include') fails to find the correct python include path.
This solves that.
mihaimaruseac
approved these changes
Feb 8, 2022
QrczakMK
added a commit
to google/riegeli
that referenced
this pull request
Jul 6, 2022
This follows tensorflow/tensorflow#51782 and tensorflow/tensorflow#54292. PiperOrigin-RevId: 459168028
Contributor
|
FYI: I'm going to send a change that reverts this PR. The reason is that Is it possible the original problem here was installation specific? |
copybara-service bot
pushed a commit
to google/tsl
that referenced
this pull request
Aug 7, 2023
The distutils module has been removed under Python 3.12, and the code here fails with a ModuleNotFoundError. This occurs because:
```
$ ipython
Python 3.12.0rc1 (main, Aug 7 2023, 13:07:47) [GCC 12.2.0]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.14.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import importlib.util
In [2]: importlib.util.find_spec('distutils.sysconfig')
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
Cell In[2], line 1
----> 1 importlib.util.find_spec('distutils.sysconfig')
File <frozen importlib.util>:91, in find_spec(name, package)
ModuleNotFoundError: No module named 'distutils'
```
However, as far as I can tell, we can just unconditionally use sysconfig since Python 3.2, which is well below the minimum Python version requirement of this code.
This change effectively reverts: tensorflow/tensorflow#54292
That change will no longer be tenable once Python 3.12 is released.
PiperOrigin-RevId: 554457984
copybara-service bot
pushed a commit
to google/tsl
that referenced
this pull request
Aug 9, 2023
The distutils module has been removed under Python 3.12, and the code here fails with a ModuleNotFoundError. This occurs because:
```
$ ipython
Python 3.12.0rc1 (main, Aug 7 2023, 13:07:47) [GCC 12.2.0]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.14.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import importlib.util
In [2]: importlib.util.find_spec('distutils.sysconfig')
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
Cell In[2], line 1
----> 1 importlib.util.find_spec('distutils.sysconfig')
File <frozen importlib.util>:91, in find_spec(name, package)
ModuleNotFoundError: No module named 'distutils'
```
However, as far as I can tell, we can just unconditionally use sysconfig since Python 3.2, which is well below the minimum Python version requirement of this code.
This change effectively reverts: tensorflow/tensorflow#54292
That change will no longer be tenable once Python 3.12 is released.
PiperOrigin-RevId: 554457984
copybara-service bot
pushed a commit
to google/tsl
that referenced
this pull request
Aug 9, 2023
The distutils module has been removed under Python 3.12, and the code here fails with a ModuleNotFoundError. This occurs because:
```
$ ipython
Python 3.12.0rc1 (main, Aug 7 2023, 13:07:47) [GCC 12.2.0]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.14.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import importlib.util
In [2]: importlib.util.find_spec('distutils.sysconfig')
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
Cell In[2], line 1
----> 1 importlib.util.find_spec('distutils.sysconfig')
File <frozen importlib.util>:91, in find_spec(name, package)
ModuleNotFoundError: No module named 'distutils'
```
However, as far as I can tell, we can just unconditionally use sysconfig since Python 3.2, which is well below the minimum Python version requirement of this code.
This change effectively reverts: tensorflow/tensorflow#54292
That change will no longer be tenable once Python 3.12 is released.
PiperOrigin-RevId: 555273752
copybara-service bot
pushed a commit
to openxla/xla
that referenced
this pull request
Aug 9, 2023
The distutils module has been removed under Python 3.12, and the code here fails with a ModuleNotFoundError. This occurs because:
```
$ ipython
Python 3.12.0rc1 (main, Aug 7 2023, 13:07:47) [GCC 12.2.0]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.14.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import importlib.util
In [2]: importlib.util.find_spec('distutils.sysconfig')
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
Cell In[2], line 1
----> 1 importlib.util.find_spec('distutils.sysconfig')
File <frozen importlib.util>:91, in find_spec(name, package)
ModuleNotFoundError: No module named 'distutils'
```
However, as far as I can tell, we can just unconditionally use sysconfig since Python 3.2, which is well below the minimum Python version requirement of this code.
This change effectively reverts: tensorflow/tensorflow#54292
That change will no longer be tenable once Python 3.12 is released.
PiperOrigin-RevId: 555273752
copybara-service bot
pushed a commit
that referenced
this pull request
Aug 9, 2023
The distutils module has been removed under Python 3.12, and the code here fails with a ModuleNotFoundError. This occurs because:
```
$ ipython
Python 3.12.0rc1 (main, Aug 7 2023, 13:07:47) [GCC 12.2.0]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.14.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import importlib.util
In [2]: importlib.util.find_spec('distutils.sysconfig')
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
Cell In[2], line 1
----> 1 importlib.util.find_spec('distutils.sysconfig')
File <frozen importlib.util>:91, in find_spec(name, package)
ModuleNotFoundError: No module named 'distutils'
```
However, as far as I can tell, we can just unconditionally use sysconfig since Python 3.2, which is well below the minimum Python version requirement of this code.
This change effectively reverts: #54292
That change will no longer be tenable once Python 3.12 is released.
PiperOrigin-RevId: 555273752
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On my latest mac sysconfig.get_path('include') fails to find the correct python include path.
This solves that.