bjarneo / Pytify

A CLI application for controlling Spotify
MIT License
741 stars 40 forks source link

ImportError: No module named 'pytifylib' #21

Closed spcmd closed 8 years ago

spcmd commented 8 years ago

Installation went fine with pip, dependecy check is okay:

Requirement already satisfied (use --upgrade to upgrade): requests in /usr/lib/python3.5/site-packages

When I try to run pytify I got this error:

Traceback (most recent call last):
  File "/usr/bin/pytify", line 9, in <module>
    load_entry_point('pytify==2.0.5', 'console_scripts', 'pytify')()
  File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 568, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2720, in load_entry_point
    return ep.load()
  File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2380, in load
    return self.resolve()
  File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2386, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python3.5/site-packages/pytify/cli.py", line 2, in <module>
    import pytifylib
ImportError: No module named 'pytifylib'

I'm using Arch Linux, python2 and python 3 packages are installed.

bjarneo commented 8 years ago

Thanks for letting me know. It's a bug that occurs in python >= 3.4 that I haven't fixed yet. I notice you use python 3.5 so that's probably the reason. Hopefully I'll get some spare time to fix it soon.

Spicychckn commented 8 years ago

I was able to fix it by adding pytify. before each of the imports in python3.4. so

'import pytifylib' 

becomes

'import pytify.pytifylib'  

I had to make this change in all the files the import pytify libraries.

I am not sure if that is the clean solution to the problem but it seemed to worked for me.

spcmd commented 8 years ago

Spicychckn: Thanks! Now it works for me too. With python 3.5 (at least under Arch Linux) I had to correct these too, otherwise it couldn't load the modules:

/usr/lib/python3.5/site-packages/pytify

cli.py

import pytify.pytifylib
from pytify.strategy import get_pytify_class_by_platform
from pytify.menu import Menu

darwinpytify.py from pytify.pytifylib import Pytifylib

linuxpytify.py from pytify.pytifylib import Pytifylib

menu.py from pytify.strategy import get_pytify_class_by_platform

strategy.py

from pytify.linuxpytify import LinuxPytify
from pytify.darwinpytify import DarwinPytify
bjarneo commented 8 years ago

Thanks for your feedback.

I guess I need to check what version is in use before importing modules. Tried with pytify.pytifylib in python 2.7, and that failed.

bjarneo commented 8 years ago

Solved: #22

Waiting for pypi to work so I can publish.

Registering pytify to https://pypi.python.org/pypi Server response (500): Internal Server Error

bjarneo commented 8 years ago

Should be a new release: https://pypi.python.org/pypi/pytify/2.1.0