Closed relaytheurgency closed 9 years ago
Very strange. Seems is __package__
None? It's hard for me to guess what's wrong because I don't have access to your environment to debug this. You installed it through pip right? Try cloning the repo and installing it with pip install -e .
to see what happens. Then you can add some print statements to pirate/data.py
and try to get more clues about what's going on.
From the traceback his python version is 3.2. I've always tested pirate-get on 3.4 but I don't think there are significant differences in pkgutil.
I upgraded to debian jessie to get 3.4, reinstalled pirate-get via pip3 and it works now. Must be something in 3.2 that's not in 3.4? Either way, glad to have it working again.
On Tue, Sep 29, 2015 at 1:42 PM, Michele Guerini Rocco < notifications@github.com> wrote:
From the traceback his python version seems is 3.2. I've always tested pirate-get on 3.4 but I don't that there are significant differences in pkgutil.
— Reply to this email directly or view it on GitHub https://github.com/vikstrous/pirate-get/issues/72#issuecomment-144151736 .
@relaytheurgency It must be. I still wonder what it is though.
I have installed python3 and pip on my raspberry pi and on ubuntu on a different computer. In ubuntu pirate-get works fine. Pirate-get used to work fine on my raspberry pi too until recently, so I tried installing this new version that relies on python3.
$pirate-get -h Traceback (most recent call last): File "/usr/local/bin/pirate-get", line 9, in
load_entry_point('pirate-get==0.2.7', 'console_scripts', 'pirate-get')()
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 337, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2280, in load_entry_point
return ep.load()
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 1990, in load
entry = import(self.module_name, globals(),globals(), ['name'])
File "/usr/local/lib/python3.2/dist-packages/pirate/pirate.py", line 11, in
import pirate.data
File "/usr/local/lib/python3.2/dist-packages/pirate/data.py", line 8, in
categories = json.loads(get_resource('categories.json').decode())
File "/usr/local/lib/python3.2/dist-packages/pirate/data.py", line 6, in get_resource
return pkgutil.get_data(package, 'data/' + filename)
File "/usr/lib/python3.2/pkgutil.py", line 573, in get_data
loader = get_loader(package)
File "/usr/lib/python3.2/pkgutil.py", line 461, in get_loader
return find_loader(fullname)
File "/usr/lib/python3.2/pkgutil.py", line 471, in find_loader
for importer in iter_importers(fullname):
File "/usr/lib/python3.2/pkgutil.py", line 421, in iter_importers
if fullname.startswith('.'):
AttributeError: 'NoneType' object has no attribute 'startswith'