watsonpy / watson-framework

A Python 3 web app framework.
BSD 3-Clause "New" or "Revised" License
104 stars 12 forks source link

watson-console newproject yields ImportError: cannot import name 'ignored' #4

Closed AndydeCleyre closed 10 years ago

AndydeCleyre commented 10 years ago

Using Arch Linux and following the docs, I did:

sudo pip install watson-framework

(installed version 2.2.4)

Checking the version as the docs direct, with print(watson.__version__) fails with AttributeError: 'module' object has no attribute '__version__'. Not important, moving on.

watson-console newproject library book

Traceback (most recent call last):
  File "/usr/bin/watson-console", line 9, in <module>
    load_entry_point('watson-framework==2.2.4', 'console_scripts', 'watson-console')()
  File "/usr/lib/python3.4/site-packages/pkg_resources.py", line 351, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3.4/site-packages/pkg_resources.py", line 2363, in load_entry_point
    return ep.load()
  File "/usr/lib/python3.4/site-packages/pkg_resources.py", line 2088, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/lib/python3.4/site-packages/watson/framework/bin.py", line 2, in <module>
    from watson.framework import applications
  File "/usr/lib/python3.4/site-packages/watson/framework/applications.py", line 5, in <module>
    from watson.console.command import find_commands_in_module
  File "/usr/lib/python3.4/site-packages/watson/console/command.py", line 3, in <module>
    from watson.common.contextmanagers import ignored
ImportError: cannot import name 'ignored'
simoncoulton commented 10 years ago

I haven't actually run tests against 3.4 as of yet, but that appears that ignored (which is now named suppress in 3.4) is not being aliased correctly. I'll be running tests against 3.4 this weekend and pushing up some updates.

EDIT: I've pushed up 2.2.5 which should resolve the 3.4 issues.

AndydeCleyre commented 10 years ago

Perfect, thanks!

helambuapps commented 10 years ago

Still doesn't work for me. I have python 3.4.0 installed on my 32 bit Linux machine with virtualenv version = 1.11.4

This is what I have tried:

virtualenv -p /usr/bin/python3 kids
source kids/bin/activate
pip install https://github.com/watsonpy/watson-framework/archive/master.zip

It says: Successfully installed Pygments Jinja2 watson-common watson-cache watson-console watson-di watson-dev watson-filters watson-form watson-html watson-routing watson-validators watson-framework markupsafe watson-events watson-http

According to the following file

./kids/lib/python3.4/site-packages/watson/framework/__init__.py

I have watson 2.2.7 installed

Then I tried to print the version number as it is on the official documentation:

import watson
print(watson.__version__)

and the error is:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute '__version__'
simoncoulton commented 10 years ago

@helambuapps watson is only the top level package, and doesn't contain a version itself. You want to do the following

import watson.framework
print(watson.framework.__version__)

That said, there is an error in the documentation, and will be rectified in the next release.