Product: TIBCO Spotfire®
Python Tools error: "Package repository not accessible" "Python Package Index is not accessible"
==============================
IMPORTANT NOTE (2020-12-16):
"pip search" is used in both the original implementation of the "Python Tools" feature in Spotfire and the original workaround (for dealing with proxies) outlined at the end of this knowledge base article's Resolution section.
"pip search" is a feature in an online Python API that was disabled this week (mid-December, 2020).
This is discussed online at the following (non-TIBCO) website:
https://github.com/pypa/pip/issues/5216
Attempts to use "pip search" from a commands window currently fail with the following error:
-----
raise Fault(**self._stack[0])
xmlrpc.client.Fault: <Fault -32500: 'RuntimeError: This API has been temporarily disabled due to unmanageable load and will be deprecated in the near future. Please use the Simple or JSON API instead.'>
-----
Update: A fix for the "pip search" issue in Python Tools has been implemented in the following Spotfire Analyst desktop client hotfixes for Spotfire 10.10 LTS and Spotfire 11.1 (released January 19, 2021):
TS_10.10.2.51 LTS HF-010
TS_11.1.0.61 HF-001
Below is a link for the list of hotfixes and the related fix details:
https://community.tibco.com/wiki/list-hotfixes-tibco-spotfire-clients-analyst-web-player-consumerbusiness-author-and-automation#toc-4
TS-65377 - In Python Tools, the Package Management tab ceased to work after removal of an underlying API at pypi.org (the Python Package Index). You would receive an error with the message 'Python Package Index is not accessible.
~~~~~~~
For Spotfire desktop clients that do not have this fix implemented (or available), you may find the following command-line workaround useful:
-------------------
Question: What is the manual workaround for Spotfire users who need to install Python packages, without using "pip search" to find them in the Python Index?
Answer: You need to install them by name from the command line:
1. Copy the path to Python from the Spotfire desktop client's "Tools > Python Tools" dialog.
2. Use the Windows operating system's "cmd" command to open a Windows command prompt window.
3. Paste in <path to python.exe> -m pip install --user <package name>
-------------------
An example (for installing the 'xgboost' package, with quotation marks inserted around the example's <path to python.exe> because it contains spaces):
"C:\Program Files (x86)\TIBCO\Spotfire\10.10.0\Modules\Modules\Python Interpreter_3.7.5.0\python\python.exe" -m pip install --user xgboost
==============================
~~~~~~~~~~~~~
For reference, the following is the original Summary for this knowledge base article (from before the Python community's "pip search" feature was disabled):
Under some conditions, an attempt to use the Spotfire desktop client's point-and-click "Tools > Python Tools > Package Management" feature may return the following error in a pop-up window:
_____________________________________________________
Python Tools x
Engine /Package Management\
-----------------------------------------------------
Package repository not accessible
Python Package Index is not accessible.
Most functionality will be unavailable.
See logs for more information.
[OK]
-----------------------------------------------------
_____________________________________________________
For reference, the following is the original Resolution for this knowledge base article (from before the Python community's "pip search" feature was disabled):
--
The most common cause for the "package index is not accessible" error message from Python Tools is a connectivity issue, such as a firewall, proxy, or machine security setting that prevents successful connection to the Python community's Python Package Index (PyPI) (https://pypi.org/).
Spotfire's point-and-click "Tools > Python Tools > Package Management" feature uses pip (the Python package manager) to download and install Python packages from the PyPI repository.
The "Python Tools" feature uses the following command to check the accessibility of the package index:
python -m pip search pip
(A) The first troubleshooting step for the "package index is not accessible" error is to see if you can reach the following URL from the machine that threw the error, using a web browser:
https://pypi.org/
(B) If that works, the next step is to see if the following test works, using a commands window on the same machine:
(1) Select "Tools > Python Tools" from the Spotfire desktop client's main menu
(2) In the "Python Tools" dialog, left-click on "Copy Python Interpreter Path to Clipboard"
(3) On the same machine, open a Windows command prompt (cmd) window
(4) In that cmd window, using the path pasted from the clipboard, run the following command:
<pasted path to Python> -m pip search pip
For Spotfire 10.10.0, the complete line to execute should look something like this:
"C:\Program Files\TIBCO\Spotfire\10.10.0\Modules\Python Interpreter_3.7.5.0\python\python.exe" -m pip search pip
(C) If that test fails, there is a configuration change that you can make to pip (the Python package manager) to get past it. The Python community has documented various ways to make that change, at the following URL:
https://pip.pypa.io/en/stable/user_guide/#configuration.
The easiest way to set the configuration on a single machine would be to run the following command in the same cmd window (see the steps in section B, above):
<pasted path to Python> -m pip config set global.trusted-host pypi.org
For Spotfire 10.10.0, the complete line to execute should look something like this:
"C:\Program Files\TIBCO\Spotfire\10.10.0\Modules\Python Interpreter_3.7.5.0\python\python.exe" -m pip config set global.trusted-host pypi.org
(D) The same pip configuration page also describes various ways to set that parameter for many users:
https://pip.pypa.io/en/stable/user_guide/#configuration.
https://pip.pypa.io/en/stable/user_guide/#configuration.
https://github.com/pypa/pip/issues/5216
Comments
0 comments
Article is closed for comments.