Python: Difference between revisions

24 bytes removed ,  1 year ago
no edit summary
No edit summary
No edit summary
Line 26: Line 26:


===Python version supported=== <!--T:88-->
===Python version supported=== <!--T:88-->
In general in the Python ecosystem, the transition to more modern versions of python is accelerating, with many packages only supporting the latest few versions of Python 3.x. In our case, we provide pre-built python packages in our [[Available Python wheels|wheelhouse]] only for the 3 most recent Python versions available on the systems. This will result in dependencies issues when trying to install those packages with older versions of Python. See [[Python#Package_.27X.27_requires_a_different_Python:_X.Y.Z_not_in_.27.3E.3DX.Y.27|Troubleshooting]].  
In general in the Python ecosystem, the transition to more modern versions of python is accelerating, with many packages only supporting the latest few versions of Python 3.x. In our case, we provide prebuilt Python packages in our [[Available Python wheels|wheelhouse]] only for the 3 most recent Python versions available on the systems. This will result in dependencies issues when trying to install those packages with older versions of Python. See [[Python#Package_.27X.27_requires_a_different_Python:_X.Y.Z_not_in_.27.3E.3DX.Y.27|Troubleshooting]].  


<!--T:90-->
<!--T:90-->
Line 124: Line 124:


<!--T:68-->
<!--T:68-->
The <code>pip</code> command can install packages from a variety of sources, including PyPI and pre-built distribution packages called Python [https://pythonwheels.com/ wheels]. We provide Python wheels for a number of packages. In the above example, the [https://pip.pypa.io/en/stable/reference/pip_wheel/#cmdoption-no-index <code>--no-index</code>] option tells <code>pip</code> to ''not'' install from PyPI, but instead to install only from locally-available packages, i.e. our wheels.
The <code>pip</code> command can install packages from a variety of sources, including PyPI and prebuilt distribution packages called Python [https://pythonwheels.com/ wheels]. We provide Python wheels for a number of packages. In the above example, the [https://pip.pypa.io/en/stable/reference/pip_wheel/#cmdoption-no-index <code>--no-index</code>] option tells <code>pip</code> to ''not'' install from PyPI, but instead to install only from locally-available packages, i.e. our wheels.


<!--T:69-->
<!--T:69-->
Line 130: Line 130:


<!--T:34-->
<!--T:34-->
If you omit the <code>--no-index</code> option, <code>pip</code> will search both PyPI and local packages, and use the latest version available. If PyPI has a newer version, it will be installed instead of our wheel, possibly causing issues. If you are certain that you prefer to download a package from PyPI rather than use a wheel, you can use the <code>--no-binary</code> option, which tells <code>pip</code> to ignore pre-built packages entirely. Note that this will also ignore wheels that are distributed through PyPI, and will always compile the package from source.
If you omit the <code>--no-index</code> option, <code>pip</code> will search both PyPI and local packages, and use the latest version available. If PyPI has a newer version, it will be installed instead of our wheel, possibly causing issues. If you are certain that you prefer to download a package from PyPI rather than use a wheel, you can use the <code>--no-binary</code> option, which tells <code>pip</code> to ignore prebuilt packages entirely. Note that this will also ignore wheels that are distributed through PyPI, and will always compile the package from source.


<!--T:30-->
<!--T:30-->
Line 247: Line 247:
By default, it will:
By default, it will:
* only show you the '''latest version''' of a specific package (unless versions are given);
* only show you the '''latest version''' of a specific package (unless versions are given);
* only show you versions that are compatible with the python module (if one loaded) or virtual environment (if activated), otherwise all python versions will be shown;
* only show you versions that are compatible with the python module (if one loaded) or virtual environment (if activated), otherwise all versions will be shown;
* only show you versions that are compatible with the CPU architecture that you are currently running on.
* only show you versions that are compatible with the CPU architecture that you are currently running on.


Line 332: Line 332:
numpy  1.22.2    cp39      generic
numpy  1.22.2    cp39      generic
}}
}}
The <i>python</i> column tell us for which python version the wheel is available, where <code>cp39</code> stands for <code>cpython 3.9</code>.
The <i>python</i> column tell us for which version the wheel is available, where <code>cp39</code> stands for <code>cpython 3.9</code>.


==== Requirements file ==== <!--T:81-->
==== Requirements file ==== <!--T:81-->
Line 531: Line 531:


<!--T:83-->
<!--T:83-->
The current python module loaded (3.6.10 in this case) is not supported by that package. You can update to a more recent python version, such as the latest available module. Or install an older version of package 'X'.
The current python module loaded (3.6.10 in this case) is not supported by that package. You can update to a more recent version, such as the latest available module. Or install an older version of package 'X'.


=== Package has requirement X, but you'll have Y which is incompatible  === <!--T:84-->
=== Package has requirement X, but you'll have Y which is incompatible  === <!--T:84-->
Line 585: Line 585:
Two common cases are:  
Two common cases are:  
* trying to install a <code>manylinux</code> package
* trying to install a <code>manylinux</code> package
* or a python package built for a different python version (e.g. installing a package built for python 3.11 when you have python 3.9).
* or a python package built for a different Python version (e.g. installing a package built for python 3.11 when you have python 3.9).


<!--T:95-->
<!--T:95-->
rsnt_translations
56,420

edits