splendidtoad / pyrealpro

A Python tool for constructing songs that can be imported into iRealPro.
MIT License
7 stars 3 forks source link

Problem with __init__.py from pip install #16

Open benco5 opened 3 years ago

benco5 commented 3 years ago

I'm having a weird issue trying to use your package after pip install. I've tried installing with different versions of pip / python and haven't encountered this sort of thing otherwise. See below for what's going on.

➜  ~ python3 -m pip install pyrealpro
Defaulting to user installation because normal site-packages is not writeable
Collecting pyrealpro
  Using cached pyrealpro-0.1.3-py3-none-any.whl (12 kB)
Installing collected packages: pyrealpro
Successfully installed pyrealpro-0.1.3
➜  ~ python3
Python 3.7.3 (default, Apr  7 2020, 14:06:47) 
[Clang 11.0.3 (clang-1103.0.32.59)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from pyrealpro import Song
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'Song' from 'pyrealpro' (/Users/me/Library/Python/3.7/lib/python/site-packages/pyrealpro/__init__.py)
➜  ~ cat /Users/me/Library/Python/3.7/lib/python/site-packages/pyrealpro/__init__.py
name = "pyrealpro"
➜  ~ echo "from .pyrealpro import *" > /Users/me/Library/Python/3.7/lib/python/site-packages/pyrealpro/__init__.py
➜  ~ cat /Users/me/Library/Python/3.7/lib/python/site-packages/pyrealpro/__init__.py                              
from .pyrealpro import *
➜  ~ python3                                                                                                             
Python 3.7.3 (default, Apr  7 2020, 14:06:47) 
[Clang 11.0.3 (clang-1103.0.32.59)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from pyrealpro import Song
>>> s = Song(title="Pip Install Blues")
>>> s.title
'Pip Install Blues'

Perhaps PyPi version is out of sync and/or related to https://github.com/splendidtoad/pyrealpro/commit/a28d30e7263034effbf3a808a6e5f83204877384#diff-8e2c1f727276d30ced72fa67cb848772a9802162bec39b42a8df5359fd063a4c ...?

mystery-house commented 3 years ago

Thanks for the report and apologies for the slow response - I haven't done any troubleshooting of this issue specifically, but I did just publish a new version on PyPi - might be worth giving it a try?

pip install pyrealpro==0.2.0