Skip to content

[0.6.0] ImportError #230

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
matthiasbeyer opened this issue Jul 19, 2015 · 22 comments
Closed

[0.6.0] ImportError #230

matthiasbeyer opened this issue Jul 19, 2015 · 22 comments
Labels

Comments

@matthiasbeyer
Copy link

When starting khal version 0.6.0, I get an import error instantly:

$ khal
[...]
    from khal.version import version
ImportError: No module named version
@geier
Copy link
Member

geier commented Jul 19, 2015

the version file should be auto-generated during setup or while creating the package. How did you get and install khal?

geier referenced this issue Jul 19, 2015
events that spanned midnight in local_timezone but not in UTC where not
properly fetched from the db as the actual timezone information was not
regarded there
@untitaker
Copy link
Member

@geier I don't see how since we use setuptools-scm now.

@geier
Copy link
Member

geier commented Jul 19, 2015

this line should do the trick 886a354#diff-2eeaed663bd0d25b7e608891384b7298R45

@untitaker
Copy link
Member

I see, it works for me too. @matthiasbeyer could you give us the full output of setup.py install?

@benjaminfrank
Copy link

Just guessing here, I think the issue manifests itself if someone uses the release tarballs and not git as in this case setuptools_scm does not find any scm info to build version.py

edit: just downloaded the tarball and did:

python setup.py install
running install
running bdist_egg
running egg_info
writing requirements to khal.egg-info/requires.txt
writing khal.egg-info/PKG-INFO
writing top-level names to khal.egg-info/top_level.txt
writing dependency_links to khal.egg-info/dependency_links.txt
writing entry points to khal.egg-info/entry_points.txt
reading manifest file 'khal.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'khal.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.10-x86_64/egg
running install_lib
running build_py
creating build/bdist.macosx-10.10-x86_64/egg
creating build/bdist.macosx-10.10-x86_64/egg/khal
copying build/lib/khal/__init__.py -> build/bdist.macosx-10.10-x86_64/egg/khal
copying build/lib/khal/aux.py -> build/bdist.macosx-10.10-x86_64/egg/khal
copying build/lib/khal/calendar_display.py -> build/bdist.macosx-10.10-x86_64/egg/khal
copying build/lib/khal/cli.py -> build/bdist.macosx-10.10-x86_64/egg/khal
copying build/lib/khal/compat.py -> build/bdist.macosx-10.10-x86_64/egg/khal
copying build/lib/khal/controllers.py -> build/bdist.macosx-10.10-x86_64/egg/khal
copying build/lib/khal/exceptions.py -> build/bdist.macosx-10.10-x86_64/egg/khal
creating build/bdist.macosx-10.10-x86_64/egg/khal/khalendar
copying build/lib/khal/khalendar/__init__.py -> build/bdist.macosx-10.10-x86_64/egg/khal/khalendar
copying build/lib/khal/khalendar/aux.py -> build/bdist.macosx-10.10-x86_64/egg/khal/khalendar
copying build/lib/khal/khalendar/backend.py -> build/bdist.macosx-10.10-x86_64/egg/khal/khalendar
copying build/lib/khal/khalendar/event.py -> build/bdist.macosx-10.10-x86_64/egg/khal/khalendar
copying build/lib/khal/khalendar/exceptions.py -> build/bdist.macosx-10.10-x86_64/egg/khal/khalendar
copying build/lib/khal/khalendar/khalendar.py -> build/bdist.macosx-10.10-x86_64/egg/khal/khalendar
copying build/lib/khal/log.py -> build/bdist.macosx-10.10-x86_64/egg/khal
creating build/bdist.macosx-10.10-x86_64/egg/khal/settings
copying build/lib/khal/settings/__init__.py -> build/bdist.macosx-10.10-x86_64/egg/khal/settings
copying build/lib/khal/settings/exceptions.py -> build/bdist.macosx-10.10-x86_64/egg/khal/settings
copying build/lib/khal/settings/khal.spec -> build/bdist.macosx-10.10-x86_64/egg/khal/settings
copying build/lib/khal/settings/settings.py -> build/bdist.macosx-10.10-x86_64/egg/khal/settings
copying build/lib/khal/settings/utils.py -> build/bdist.macosx-10.10-x86_64/egg/khal/settings
copying build/lib/khal/terminal.py -> build/bdist.macosx-10.10-x86_64/egg/khal
creating build/bdist.macosx-10.10-x86_64/egg/khal/ui
copying build/lib/khal/ui/__init__.py -> build/bdist.macosx-10.10-x86_64/egg/khal/ui
copying build/lib/khal/ui/base.py -> build/bdist.macosx-10.10-x86_64/egg/khal/ui
copying build/lib/khal/ui/calendarwidget.py -> build/bdist.macosx-10.10-x86_64/egg/khal/ui
copying build/lib/khal/ui/startendeditor.py -> build/bdist.macosx-10.10-x86_64/egg/khal/ui
copying build/lib/khal/ui/widgets.py -> build/bdist.macosx-10.10-x86_64/egg/khal/ui
byte-compiling build/bdist.macosx-10.10-x86_64/egg/khal/__init__.py to __init__.pyc
byte-compiling build/bdist.macosx-10.10-x86_64/egg/khal/aux.py to aux.pyc
byte-compiling build/bdist.macosx-10.10-x86_64/egg/khal/calendar_display.py to calendar_display.pyc
byte-compiling build/bdist.macosx-10.10-x86_64/egg/khal/cli.py to cli.pyc
byte-compiling build/bdist.macosx-10.10-x86_64/egg/khal/compat.py to compat.pyc
byte-compiling build/bdist.macosx-10.10-x86_64/egg/khal/controllers.py to controllers.pyc
byte-compiling build/bdist.macosx-10.10-x86_64/egg/khal/exceptions.py to exceptions.pyc
byte-compiling build/bdist.macosx-10.10-x86_64/egg/khal/khalendar/__init__.py to __init__.pyc
byte-compiling build/bdist.macosx-10.10-x86_64/egg/khal/khalendar/aux.py to aux.pyc
byte-compiling build/bdist.macosx-10.10-x86_64/egg/khal/khalendar/backend.py to backend.pyc
byte-compiling build/bdist.macosx-10.10-x86_64/egg/khal/khalendar/event.py to event.pyc
byte-compiling build/bdist.macosx-10.10-x86_64/egg/khal/khalendar/exceptions.py to exceptions.pyc
byte-compiling build/bdist.macosx-10.10-x86_64/egg/khal/khalendar/khalendar.py to khalendar.pyc
byte-compiling build/bdist.macosx-10.10-x86_64/egg/khal/log.py to log.pyc
byte-compiling build/bdist.macosx-10.10-x86_64/egg/khal/settings/__init__.py to __init__.pyc
byte-compiling build/bdist.macosx-10.10-x86_64/egg/khal/settings/exceptions.py to exceptions.pyc
byte-compiling build/bdist.macosx-10.10-x86_64/egg/khal/settings/settings.py to settings.pyc
byte-compiling build/bdist.macosx-10.10-x86_64/egg/khal/settings/utils.py to utils.pyc
byte-compiling build/bdist.macosx-10.10-x86_64/egg/khal/terminal.py to terminal.pyc
byte-compiling build/bdist.macosx-10.10-x86_64/egg/khal/ui/__init__.py to __init__.pyc
byte-compiling build/bdist.macosx-10.10-x86_64/egg/khal/ui/base.py to base.pyc
byte-compiling build/bdist.macosx-10.10-x86_64/egg/khal/ui/calendarwidget.py to calendarwidget.pyc
byte-compiling build/bdist.macosx-10.10-x86_64/egg/khal/ui/startendeditor.py to startendeditor.pyc
byte-compiling build/bdist.macosx-10.10-x86_64/egg/khal/ui/widgets.py to widgets.pyc
creating build/bdist.macosx-10.10-x86_64/egg/EGG-INFO
copying khal.egg-info/PKG-INFO -> build/bdist.macosx-10.10-x86_64/egg/EGG-INFO
copying khal.egg-info/SOURCES.txt -> build/bdist.macosx-10.10-x86_64/egg/EGG-INFO
copying khal.egg-info/dependency_links.txt -> build/bdist.macosx-10.10-x86_64/egg/EGG-INFO
copying khal.egg-info/entry_points.txt -> build/bdist.macosx-10.10-x86_64/egg/EGG-INFO
copying khal.egg-info/requires.txt -> build/bdist.macosx-10.10-x86_64/egg/EGG-INFO
copying khal.egg-info/top_level.txt -> build/bdist.macosx-10.10-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
khal.settings.settings: module references __file__
creating 'dist/khal-0.0.0-py2.7.egg' and adding 'build/bdist.macosx-10.10-x86_64/egg' to it
removing 'build/bdist.macosx-10.10-x86_64/egg' (and everything under it)
Processing khal-0.0.0-py2.7.egg
removing '/usr/local/lib/python2.7/site-packages/khal-0.0.0-py2.7.egg' (and everything under it)
creating /usr/local/lib/python2.7/site-packages/khal-0.0.0-py2.7.egg
Extracting khal-0.0.0-py2.7.egg to /usr/local/lib/python2.7/site-packages
khal 0.0.0 is already the active version in easy-install.pth
Installing ikhal script to /usr/local/bin
Installing khal script to /usr/local/bin

Installed /usr/local/lib/python2.7/site-packages/khal-0.0.0-py2.7.egg
Processing dependencies for khal==0.0.0
Searching for tzlocal==1.2
Best match: tzlocal 1.2
Adding tzlocal 1.2 to easy-install.pth file

Using /usr/local/lib/python2.7/site-packages
Searching for configobj==5.0.6
Best match: configobj 5.0.6
Adding configobj 5.0.6 to easy-install.pth file

Using /usr/local/lib/python2.7/site-packages
Searching for python-dateutil==2.4.2
Best match: python-dateutil 2.4.2
Adding python-dateutil 2.4.2 to easy-install.pth file

Using /usr/local/lib/python2.7/site-packages
Searching for pkginfo==1.2.1
Best match: pkginfo 1.2.1
Adding pkginfo 1.2.1 to easy-install.pth file
Installing pkginfo script to /usr/local/bin

Using /usr/local/lib/python2.7/site-packages
Searching for vdirsyncer==0.5.2
Best match: vdirsyncer 0.5.2
Adding vdirsyncer 0.5.2 to easy-install.pth file
Installing vdirsyncer script to /usr/local/bin

Using /usr/local/lib/python2.7/site-packages
Searching for pytz==2015.4
Best match: pytz 2015.4
Adding pytz 2015.4 to easy-install.pth file

Using /usr/local/lib/python2.7/site-packages
Searching for pyxdg==0.25
Best match: pyxdg 0.25
Adding pyxdg 0.25 to easy-install.pth file

Using /usr/local/lib/python2.7/site-packages
Searching for urwid==1.3.0
Best match: urwid 1.3.0
Adding urwid 1.3.0 to easy-install.pth file

Using /usr/local/lib/python2.7/site-packages
Searching for icalendar==3.9.0
Best match: icalendar 3.9.0
Adding icalendar 3.9.0 to easy-install.pth file

Using /usr/local/lib/python2.7/site-packages
Searching for click==4.1
Best match: click 4.1
Adding click 4.1 to easy-install.pth file

Using /usr/local/lib/python2.7/site-packages
Searching for six==1.9.0
Best match: six 1.9.0
Adding six 1.9.0 to easy-install.pth file

Using /usr/local/lib/python2.7/site-packages
Searching for requests==2.7.0
Best match: requests 2.7.0
Adding requests 2.7.0 to easy-install.pth file

Using /usr/local/lib/python2.7/site-packages
Searching for atomicwrites==0.1.5
Best match: atomicwrites 0.1.5
Adding atomicwrites 0.1.5 to easy-install.pth file

Using /usr/local/lib/python2.7/site-packages
Searching for requests-toolbelt==0.4.0
Best match: requests-toolbelt 0.4.0
Adding requests-toolbelt 0.4.0 to easy-install.pth file

Using /usr/local/lib/python2.7/site-packages
Searching for lxml==3.3.5
Best match: lxml 3.3.5
lxml 3.3.5 is already the active version in easy-install.pth

Using /Library/Python/2.7/site-packages
Searching for setuptools==17.1.1
Best match: setuptools 17.1.1
Processing setuptools-17.1.1-py2.7.egg
setuptools 17.1.1 is already the active version in easy-install.pth
Installing easy_install script to /usr/local/bin
Installing easy_install-2.7 script to /usr/local/bin

Using /usr/local/lib/python2.7/site-packages/setuptools-17.1.1-py2.7.egg
Finished processing dependencies for khal==0.0.0

I don't see any version.py (but neither a reference to setuptools_scm) and running khal results in

$ khal
Traceback (most recent call last):
  File "/usr/local/bin/khal", line 9, in <module>
    load_entry_point('khal==0.0.0', 'console_scripts', 'khal')()
  File "build/bdist.macosx-10.10-x86_64/egg/pkg_resources/__init__.py", line 558, in load_entry_point
  File "build/bdist.macosx-10.10-x86_64/egg/pkg_resources/__init__.py", line 2682, in load_entry_point
  File "build/bdist.macosx-10.10-x86_64/egg/pkg_resources/__init__.py", line 2355, in load
  File "build/bdist.macosx-10.10-x86_64/egg/pkg_resources/__init__.py", line 2361, in resolve
  File "/usr/local/lib/python2.7/site-packages/khal-0.0.0-py2.7.egg/khal/__init__.py", line 23, in <module>
    from khal.version import version
ImportError: No module named version

@geier
Copy link
Member

geier commented Jul 20, 2015

did you get the release tarballs from github? the official ones from pypi or khal's website should have a version.py file included.

@untitaker
Copy link
Member

cc @0-wiz-0 I think this is relevant to vdirsyncer.

@matthiasbeyer
Copy link
Author

I'm installing through my Packagemanager, which installs khal from this derivation which I updated to khal 0.6.0. I'm the package maintainer of the pkg, I tried to update and ran into the error reported here.

@plega
Copy link

plega commented Jul 20, 2015

I used the zipfile from the "download now" button (I know, I know) and there was no version.py file. Same problem as the above.

@plega
Copy link

plega commented Jul 20, 2015

The svn copy [r1021] is also missing version.py for tags/v0.6.0.

@geier
Copy link
Member

geier commented Jul 21, 2015

The SCM should never contain the version.py file, it gets generated when calling setup.py and gets included in the distribution archives. It does need the .git directory to to find the last tag. If it turns out this breaks the workflow of too many users, I'll revert to the old way of generating a version.py.

As a quick and dirty fix you can just create a file khal/version.py with the line version = 1.2.3.

And it looks like setuptools_scm does not support svn (yet?).

@plega
Copy link

plega commented Jul 21, 2015

I've switched to using git clone... but you might want to add a README
if a svn fix is going to wait for an indefinite length of time.

Philip

On Tue, Jul 21, 2015 at 10:50:51AM +0100, Christian Geier wrote:

The SCM should never contain the version.py file, it gets generated when calling setup.py and gets included in the distribution archives. It does need the .git directory to to find the last tag. If it turns out this breaks the workflow of too many users, I'll revert to the old way of generating a version.py.

As a quick and dirty fix you can just create a file khal/version.py with the line version = 1.2.3.

And it looks like setuptools_scm does not support svn (yet?).


Reply to this email directly or view it on GitHub:
#230 (comment)

Philip Allen, Executive Chairman, CoreFiling Limited
http://www.corefiling.com
Phone: +44-1865-203192 Mobile: +44-7956-160959

@untitaker
Copy link
Member

I've just introduced a check in vdirsyncer/__init__.py to deal with this, @geier you might want to copy it.

@RonnyPfannschmidt
Copy link

on a sidenote, unlike mercurial tarballs (which are supported by setuptools_scm) unpacked git tarballs completely lack metadata, (except for guessign from the folder name if one is lucky)

since git is so bad at that, i opted for not supporting git tarballs

@geier
Copy link
Member

geier commented Jul 21, 2015

@plega yes, I'll put something in the README, and make it print a warning if a svn or github tarball is used (like @untitaker suggested).

@RonnyPfannschmidt now that you mention it I remember you ranting about how bad git is in that regard

@RonnyPfannschmidt
Copy link

@geier the next version of setuptools_scm will properly error out with such occasions (devpi-client did also cause some issues),
the release will happen this week, afterwards you could just pin the version

@geier
Copy link
Member

geier commented Jul 21, 2015

@RonnyPfannschmidt awesome, thanks!

@geier geier added the cat:ui label Jul 21, 2015
@geier
Copy link
Member

geier commented Jul 21, 2015

@matthiasbeyer
Copy link
Author

I'm trying this, hang on.

@matthiasbeyer
Copy link
Author

Seems to work, thanks a lot.

@geier
Copy link
Member

geier commented Jul 21, 2015

Thanks for bringing this to our attention (and for taking care of a package!)

@matthiasbeyer
Copy link
Author

You're welcome!

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

No branches or pull requests

6 participants