pip install of the modules required to run Python Script

I ran the Pandas.read_excel function in the Python Script component. I got the following error

ImportError: Missing optional dependency 'xlrd'. Install xlrd >= 1.0.0 for Excel support Use pip or conda to install xlrd.


In my own development environment (using Anaconda3), I can solve this problem with the "pip install xlrd" command, but how should I handle this in the Pipeline Pilot environment?
Is it better to install it in the built-in environment? Is it better to install in the built-in environment, or to create a separate Python environment (e.g. virtual environment) and install it?

Answers 3
TK
TK 2021-09-15 Best Answer

Hi YK.
I think the next page, which is one of the pages of the user community, may be useful.
https://r1132100503382-eu1-3dswym.3dexperience.3ds.com/#community:-Dq7kJ1oQkaYTPRmX-a-PA/wiki:481vs8-lR_2pBz_ULepByQ

 


NB
NB 2021-09-16

HI Yu In 2021 version, you can use the  'Install Python Packages Using Built-in Python' protocol to install packages of your interest in a specified location (eg User folder or Public folder).

AF
AF 2021-09-16

Great answers above! I just wanted to add that if you wish to use additional Python packages in the built-in Python environment in the Python Script or Python Jupyter Notebook components (as opposed to just the Python (on Server) component), after running the "Install Python Packages Using Built-in Python" protocol to install packages into a publicly available location, you then need to go into the Admin Portal --> Setup --> Global Properties, select the BIOVIA/Integration package, and set the PythonPath variable to point to the location where you installed the package. This will make the Python package available to all Python components using the built-in Python. 


Also note that in general, performance will be better with the built-in Python environment due to less overhead of calling out to an external Python environment, but external Python environments are in general easier to use and install packages into.