python cant find module in sys.path

自古美人都是妖i 提交于 2019-12-11 14:52:56

问题


I use the following command to install modules in home/.local since I dont have admin rights

pip install --install-option="--prefix=$HOME/.local" package_name

it is installed in my home dir and other cant run my script, so I move them to python lib/site-packages directory where others have access to. Then I add sys.path.insert(0, path_to_lib) in my script to import that module. This is how I install and use modules in my script and it always works fine. But when I did the same for a module "marrow.mailer", my script shows No module named marrow.mailer not sure why, the lib/site-packages folder does have that module. Please help me in finding solution for this. Thanks.

来源:https://stackoverflow.com/questions/51027943/python-cant-find-module-in-sys-path

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!