Python Forum

Full Version: Package cannot be loaded into PBS queue file
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
The skopt package (https://scikit-optimize.github.io/stable/install.html) was installed on a cluster I use.

When I run the code in python directly in the terminal (i.e., in the cluster terminal executing "python3 ./code.py" command), no problem occurs and the code works as expected.

However when I simply place the command to execute the code in a PBS queue system file (e.g., python3 ./code.py), I cannot load the installed package and I get the following message:

Traceback (most recent call last):
File "./code.py", line 22, in <module>
from skopt import gp_minimize
ModuleNotFoundError: No module named 'skopt'

Could someone give me an insight on how to solve the problem?

If I need to provide any more information, let me know.

If my question is out of scope, please delete.

ps1: the package is installed on /usr/local/lib/python3.6/site-packages/skopt directory.
ps2: the package was installed by "pip3 install skopt" command.
ps3: in my code I'm calling the installed package with the following commands: "from skopt import gp_minimize" and "from skopt.space import Real, Integer, Categorical"
ps4: when i run pip3 list, i can verify that the package is installed

Thanks.
The solution was easier than I thought, as the skopt package was in the path "/usr/local/lib/python3.6/site-packages/" just use the command "export PYTHONPATH=$PYTHONPATH:/usr/local/ lib/python3.6/site-packages", before running the code in python

I was using the "export" command wrongly.