Summary: | app-admin/webapp-config-1.50.16-r3: broken. ImportError: No module named portage | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Vilhelm von Ehrenheim <vonehrenheim> |
Component: | Current packages | Assignee: | Gentoo Web Application Packages Maintainers <web-apps> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | binki, patrickjmccarty+gentoobugzilla, proxy-maint, vonehrenheim |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | x86 | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Vilhelm von Ehrenheim
2009-03-04 13:26:04 UTC
I had exactly the same problem with webapp-config and I just figured out how to at least work around it. If I ran python and typed import portage, it gave me the same error as webapp-config. However, running sudo python and typing import portage worked. The webapp-config program installs its files into /usr/local/lib/python2.5/site-packages/WebappConfig on my server. I don't know enough about python and gentoo to know if this is normal or not, and I don't understand why there are two python directories /usr/local/lib/python2.5 and /usr/lib/python2.5. At any rate, I figured that maybe python code running from the local version didn't have the portage directory in its search path. So I learned how to add a directory to python's path using a .pth file: cd /usr/local/lib/python2.5/site-packages sudo vim portage.pth type the following into the file and save: /usr/lib/portage/pym After creating this file, I was able to do import portage from a regular (non-sudo) python, and webapp-config finally worked and other webapps that depend on it finally emerged. So I got it working at least, though I don't know why the problem occurred in the first place, or why there are two python directories. I would appreciate advice on how to fix the root of the problem if that can be determined. -Patrick (In reply to comment #1) > I had exactly the same problem with webapp-config and I just figured out how to > at least work around it. > If I ran python and typed import portage, it gave me the same error as > webapp-config. > However, running sudo python and typing import portage worked. > The webapp-config program installs its files into > /usr/local/lib/python2.5/site-packages/WebappConfig on my server. I don't know > enough about python and gentoo to know if this is normal or not, and I don't > understand why there are two python directories /usr/local/lib/python2.5 and > /usr/lib/python2.5. > At any rate, I figured that maybe python code running from the local version > didn't have the portage directory in its search path. So I learned how to add a > directory to python's path using a .pth file: > cd /usr/local/lib/python2.5/site-packages > sudo vim portage.pth > type the following into the file and save: > /usr/lib/portage/pym > After creating this file, I was able to do import portage from a regular > (non-sudo) python, and webapp-config finally worked and other webapps that > depend on it finally emerged. So I got it working at least, though I don't know > why the problem occurred in the first place, or why there are two python > directories. I would appreciate advice on how to fix the root of the problem if > that can be determined. > -Patrick This workaround worked for me to. Thanks, this has been bugging me like crazy. I would also like to know why this happends. Shouldn't the files be placed in the right folder to begin with and if there are two folders why isn't python looking for modules in both dirs? // Vilhelm Bug has been fixed or is not reproducible on my system, regardless of whether I run it directly through my terminal, or through python. I'm using the latest version from the git HEAD^. |