python-shell icon indicating copy to clipboard operation
python-shell copied to clipboard

python cannot find installed module

Open dberardo-com opened this issue 1 year ago • 2 comments

i have installed numpy using pip. running python locally i can import it without problems, but when pyshell runs, then the python script cannot find the numpy module. the user running the nodejs process is the same as the user which has installed the packages.

packages are located under:

python -m site sys.path = [ ... '/usr/local/lib/python3.11/site-packages', ]

how come ?

dberardo-com avatar Jul 28 '23 16:07 dberardo-com

it seems that the path "'/usr/local/lib/python3.11/site-packages'," is missing under sys.path .. is there a way to add it from the pysehll options ?

dberardo-com avatar Jul 28 '23 19:07 dberardo-com

create a virtual env in the same directory to create run the following commands

pip install virtualenv
virtualenv venv
source  venv/scripts/activate


pip install numpy

now run the file it should work

Pavan-Rajesh avatar Aug 06 '23 10:08 Pavan-Rajesh