Skip to content
This repository has been archived by the owner on Oct 1, 2020. It is now read-only.

londiste3 error with import pkgloader #42

Open
shuwnyuantee opened this issue Mar 26, 2015 · 7 comments
Open

londiste3 error with import pkgloader #42

shuwnyuantee opened this issue Mar 26, 2015 · 7 comments

Comments

@shuwnyuantee
Copy link

My server is running Debian 7.8, with Postgresql-9.3 (9.3.6-1.pgdg70+1)

I want to use Londiste replication. I have installed the following Skytools package via apt-get install:

python-skytools3 3.2.6-3.pgdg70+1
skytools-modules-9.3 2.1.13-4.pgdg70+2
skytools3 3.2.6-3.pgdg70+1

After installation, upon running londiste command, or even service skytools3 start, I run into this error:

Traceback (most recent call last):
File "/usr/bin/scriptmgr3", line 48, in
import pkgloader
ImportError: No module named pkgloader

Trying locate pkgloader.py give me this:
/usr/lib/python2.7/site-packages/pkgloader.py

Any pointers here will be greatly appreciated, thanks!

@cdown
Copy link

cdown commented Mar 26, 2015

What is the output of python -c 'import sys; print(sys.version); print(sys.path)'?

You might also consider building using setuptools instead.

@shuwnyuantee
Copy link
Author

Forgot to update here, I fixed my issue by running londiste3 this way:

PYTHONPATH=PYTHONPATH:/usr/lib/python2.7/site-packages/ londiste3 .......

@cdown Thanks for your quick reply :)

@grayhemp
Copy link

I have just faced the same error on Ubuntu 12.0.4, PostgreSQL 9.2 and Skytools3 3.2.6-3.pgdg12.4+1 when I was setting up a new server.

root@xxx:~# service skytools3 start
Traceback (most recent call last):
File "/usr/bin/scriptmgr3", line 48, in
import pkgloader
ImportError: No module named pkgloader

Please note that there were no such issues with the other 7 servers with Ubuntu 12.0.4, PostgreSQL 9.2 and Skytools3 3.1.5-1.pgdg12.4+1 that I setup several months ago.

@grayhemp
Copy link

I've found out that earlier skytools was installed under /usr/lib/pymodules/python2.7/

root@yyy:~# ls -l /usr/lib/pymodules/python2.7/
total 8
lrwxrwxrwx 1 root root 32 Oct 24 2014 pkgloader.py -> /usr/share/pyshared/pkgloader.py
-rw-r--r-- 1 root root 2647 Oct 24 2014 pkgloader.pyc
drwxr-xr-x 5 root root 4096 Oct 24 2014 skytools-3.0

root@xxx:~# python -c 'import sys; print(sys.version); print(sys.path)'
2.7.3 (default, Dec 18 2014, 19:10:20)
[GCC 4.6.3]
['', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/pymodules/python2.7']

and now it is installed under /usr/lib/python2.7/site-packages/

root@xxx:~# ls -l /usr/lib/python2.7/site-packages/
total 8
-rw-r--r-- 1 root root 2453 Nov 5 2014 pkgloader.py
drwxr-xr-x 5 root root 4096 May 26 11:18 skytools-3.0

root@yyy:~# python -c 'import sys; print(sys.version); print(sys.path)'
2.7.3 (default, Feb 27 2014, 19:58:35)
[GCC 4.6.3]
['', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages']

that is not in the python path.

@cdown @markokr @dimitri

@grayhemp
Copy link

So my workaround is

root@yyy:# ln -s /usr/lib/python2.7/site-packages/pkgloader.py /usr/lib/python2.7/dist-packages/
root@yyy:
# ln -s /usr/lib/python2.7/site-packages/skytools-3.0/ /usr/lib/python2.7/dist-packages/

@nicl
Copy link

nicl commented Jun 3, 2015

I had a similar error though for completely different reasons. It looks like Skytools installed everything under /usr/local/local/.. (i.e. an extra local) which broke all the paths stuff.

This is running on:

  • latest amazon linux ami (a centos variant)
  • building from the github tar.gz using make

Am going to try and find out why it installed to a bad path.

@booleanbetrayal
Copy link

modifying PYTHONPATH seems like the easiest remediation, but the make install process should probably link appropriately like @grayhemp has implied.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants