Hi,
I have miniconda installed in my system. How can let Plone use packages installed in one of conda evns?
When I start Plone command line using bin/instance debug in any conda evn and try to see the installed packages by
os.system('pip list')
I can see the packages installed in this evn. However, when I import some installed packages, such as pandas, I got error: No module named 'pandas'. Why is that?
Plone typically uses buildout to build its Python environment. One buildout aim is to ensure an isolated virtual environment - with few dependencies on other Python installations.
When you run buildout, typically scripts are generated in the bin directory. Those scripts extend Python's sys.path near their beginning and thereby provide access to the configured "eggs". Extend those "eggs" definitions to include all packages you need for your Plone installation; then rerun buildout (to get new scripts with the new packages generated).
buildout typically does not control the envvar PATH. It is this envvar which controls how shell commands are found. That's why os.system("pip ...") locates your system Python, not that used by the buildout installation.
buildout sits on top of a Python installation. Typically, this is a virtual env. You may install packages in this installation and Plone may be able to access them. However, I made the experience that (likely due to a Python bug) namespace packages (those are packages with "distributed" subpackages) can make problems when some subpackage of a namespace package is installed in the Python installation and other subpackgaes are installed via buildout. That's why I started to avoid this.
Plone is not published as Conda packages. Anyway, you can use a Conda enviroment to install Plone inside. If Pandas is installed in the same enviroment it is available inside Plone as well.
Thus said, there are always two paths to go
You can use Conda to install and run Buildout (given your buildout.cfg is located in the current directory):