Python Import error on installing ruamel.yaml in custom directory

只谈情不闲聊 提交于 2019-12-11 09:45:08

问题


I am using python 2.7.13 and
I am facing problems importing ruamel.yaml when I install it in a custom directory.

**ImportError: No module named ruamel.yaml**

The command used is as follows:

pip install --target=Z:\XYZ\globalpacks ruamel.yaml

I have added this custom directory to PYTHONPATH env variable
and also have a .pth file in this location with the following lines
Z:\XYZ\globalpacks\anotherApp
Z:\XYZ\globalpacks\ruamel

There is another app installed similarly with the above settings
and it works.

What am I missing here?

PS: It works when I install in site-packages folder
also it worked in the custom folder when I created an init.py file
in the ruamel folder.

EDIT:

Since our content creation software uses python 2.7 we are restricted to
using the same.We have chosen to install the same version of python on all
machines and set import paths to to point to modules/apps locacted on shared
network drive.
Like mentioned it works in pythons site-packages but not on the network drive
which is on the PYTHONPATH env-variable.
The ruamel.yaml-**.nspkg.pth and ruamel.ordereddict-*-nspkg.pth are
dutifully installed.Sorry for not giving complete details earlier.Your inputs
are much appreciated.

来源:https://stackoverflow.com/questions/46586651/python-import-error-on-installing-ruamel-yaml-in-custom-directory

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