I installed a few new python libraries under a directory in my project. (Python 3.8, in a conda environment)
cd c:\myproj\python-libs
pip install tornado-swagger -t .
And I tried to run it after setting PYTHON_LIBRARY
set PYTHON_LIBRARY=c:\myproj\python-libs
cd c:\myproj
python myproj.py
However, it got the error of ModuleNotFoundError?
Traceback (most recent call last):
File "myproj.py", line 10, in <module>
from tornado_swagger.setup import setup_swagger
ModuleNotFoundError: No module named 'tornado_swagger'
>Solution :
PYTHON_LIBRARY isn’t a standard environment variable examined by Python. If you want to change the module search path from the command line, you can set the PYTHONPATH environment variable:
set PYTHONPATH=c:\myproj\python-libs
Note that default search path is always appended to value given by PYTHONPATH, so modules found by searching PYTHONPATH will take precedence over those on the default search path (this doesn’t include builtin modules, however, which are always searched first).