ImportError: No module named _winreg
Closed this issue · 8 comments
I installed Sketchy on Ubuntu and when I execute this
python manage.py runserver --host 0.0.0.0 --port 8000
it complains saying:::
- Running on http://0.0.0.0:8000/ (Press CTRL+C to quit)
- Restarting with stat
Traceback (most recent call last):
File "manage.py", line 141, in
manager.run()
File "/usr/local/lib/python2.7/dist-packages/flask_script/init.py", line 412, in run
result = self.handle(sys.argv[0], sys.argv[1:])
File "/usr/local/lib/python2.7/dist-packages/flask_script/init.py", line 383, in handle
res = handle(_args, *_config)
File "/usr/local/lib/python2.7/dist-packages/flask_script/commands.py", line 425, in call
*_self.server_options)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 772, in run
run_simple(host, port, self, *_options)
File "/usr/local/lib/python2.7/dist-packages/werkzeug/serving.py", line 622, in run_simple
reloader_type)
File "/usr/local/lib/python2.7/dist-packages/werkzeug/_reloader.py", line 269, in run_with_reloader
reloader.run()
File "/usr/local/lib/python2.7/dist-packages/werkzeug/_reloader.py", line 159, in run
for filename in chain(_iter_module_files(), self.extra_files):
File "/usr/local/lib/python2.7/dist-packages/werkzeug/_reloader.py", line 70, in _iter_module_files
for package_path in getattr(module, 'path', ()):
File "/usr/lib/python2.7/dist-packages/six.py", line 116, in getattr
_module = self._resolve()
File "/usr/lib/python2.7/dist-packages/six.py", line 105, in _resolve
return _import_module(self.mod)
File "/usr/lib/python2.7/dist-packages/six.py", line 76, in _import_module
import(name)
ImportError: No module named _winreg
_winreg => isn't this for Windows Registry ! Any Help ?
Thanks
Hi,
Can you give me the output of pip freeze
? Also what version of Ubuntu? This looks to be some error in the libraries.
its Ubuntu 14.04.1
pip freeze output
Cheetah==2.4.4
Flask==0.10.1
Flask-RESTful==0.3.2
Flask-SQLAlchemy==1.0
Flask-Script==2.0.5
Jinja2==2.7.3
Landscape-Client==14.01
MarkupSafe==0.23
PAM==0.4.2
PyYAML==3.10
SQLAlchemy==0.8.4
Twisted-Core==13.2.0
Werkzeug==0.10.1
amqp==1.3.3
aniso8601==0.92
anyjson==0.3.3
apt-xapian-index==0.45
argparse==1.2.1
billiard==3.3.0.15
blinker==1.3
boto==2.20.1
celery==3.1.6
chardet==2.0.1
cl==0.0.3
cloud-init==0.7.5
colorama==0.2.5
configobj==4.7.2
gunicorn==19.3.0
html5lib==0.999
itsdangerous==0.24
jsonpatch==1.3
jsonpointer==1.0
kombu==3.0.7
librabbitmq==1.0.3
lxml==3.4.2
mailer==0.7
oauth==1.0.1
prettytable==0.7.2
pyOpenSSL==0.13
pyinotify==0.9.4
pyparsing==2.0.1
pyserial==2.6
python-apt==0.9.3.5
python-dateutil==1.5
python-debian==0.1.21-nmu2ubuntu2
python-memcached==1.53
pytz==2012c
redis==2.10.3
requests==2.2.1
six==1.5.2
ssh-import-id==3.21
subprocess32==3.2.6
tldextract==1.5.1
urllib3==1.7.1
virtualenv==12.0.7
wsgiref==0.1.2
zope.interface==4.0.5
.
On Fri, Mar 13, 2015 at 6:49 PM, Scott Behrens notifications@github.com
wrote:
Hi,
Can you give me the output of pip freeze? Also what version of Ubuntu?
This looks to be some error in the libraries.—
Reply to this email directly or view it on GitHub
#15 (comment).
Can you walk me through how you installed Sketchy? I haven't seen this error and searching around it looks as though it may be a dependency issue.
installed new Ubuntu 14.04.1.
then followed those instructions:
https://github.com/Netflix/sketchy/wiki/Setup#scripted-install
I used the scripted installation.
each time I try to start Sketchy I run of a dependency issue so I install
it. until I came a cross this and could not do more.!
my bash history:
1 cd
2 ls
3 cd ..
4 ls
6 git clone https://github.com/Netflix/sketchy.git
7 apt-get install git
8 sudo apt-get install git
9 cd etc
10 cd /etc/
11 ls
12 pico sudoers
13 cd sudoers.d/
14 ls
15 cd ..
16 ls
17 exit
18 cd
19 apt-get install git
20 sudo apt-get install git
21 git clone https://github.com/Netflix/sketchy.git
22 cd sketchy/
23 bash ubuntu_install.sh
24 source sketchenv/bin/activate
25 redis-server &
26 cd sketchy/
27 celery
28 apt-get install pythn-celery
29 sudo apt-get install pythn-celery
30 sudo apt-get install python-celery
31 celery -A sketchy.celery worker &
32 python manage.py runserver --host 0.0.0.0 --port 8000
33 ImportError: No module named flask.ext.restful
34 cd
35 git clone https://github.com/jfinkels/flask-restless
36 cd flask-restless/
37 php install -r requirements-doc.txt
38 pip install -r requirements-doc.txt
39 cd
40 cd sketchy/
41 ls
42 celery -A sketchy.celery worker &
43 pip install flask-httpauth
44 celery -A sketchy.celery worker &
45 flask/bin/pip install flask-httpauth
46 pip install flask-restful
47 celery -A sketchy.celery worker &
48 pip install flask-restful
49 host
50 python manage.py runserver --host 0.0.0.0 --port 8000
51 flask.ext.restful
52 apt-get install python
53 sudo apt-get install python
54 sudo apt-get install python3.2
55 sudo apt-get insall flask
56 sudo apt-get insall flask-restful
57 sudo apt-get install flask-restful
58 sudo apt-get install flask
59 pip install flask-restful
60 sudo pip install flask-restful
61 celery -A sketchy.celery worker &
62 flask.ext.sqlalchemy
63 sudo apt-get install python-virtualenv
64 celery -A sketchy.celery worker &
65 sudo apt-get install flask..sqlalchemy
66 sudo apt-get install flask.sqlalchemy
67 celery -A sketchy.celery worker &
68 sudo apt-get install boto
69 celery -A sketchy.celery worker &
70 ImportError: No module named boto
71 sudo apt-get install python-boto
72 celery -A sketchy.celery worker &
73 lxml.html
74 sudo apt-get install libxml2-dev libxslt-dev python-dev
75 pip install lxml
76 sudo pip install lxml
77 celery -A sketchy.celery worker &
78 No module named subprocess32
79 sudo pip install subprocess32
80 celery -A sketchy.celery worker &
81 tldextract
82 sudo pip install tldextract
83 celery -A sketchy.celery worker &
84 You need to install the redis library in
order to use the Redis result store backend.
85 sudo pip install redis
86 celery -A sketchy.celery worker &
87 pip freeze
88 ls
On Mon, Mar 16, 2015 at 9:59 AM, Scott Behrens notifications@github.com
wrote:
Can you walk me through how you installed Sketchy? I haven't seen this
error and searching around it looks as though it may be a dependency issue.—
Reply to this email directly or view it on GitHub
#15 (comment).
It looks as though you may have opened another terminal but are running commands outside of the virtual env.
I would ensure each terminal you are using you run source sketchenv/bin/activate
to ensure you are in the virtual environment. That may be the reason you are seeing missing dependencies as those packages aren't going to be available globally.
As an example, after you run the ubuntu_install.sh script. You could open up 3 terminals and run the following (in each terminal):
Terminal 1:
cd sketchy/
source sketchenv/bin/activate
redis-server &
Terminal 2:
cd sketchy
source sketchenv/bin/activate
celery -A sketchy.celery worker &
Terminal 3:
cd sketchy
source sketchenv/bin/activate
python manage.py runserver --host 0.0.0.0 --port 8000
That would be for development/testing purposes only. Please follow the Production Setup instructions if you would like to configure this for Prod use. Let me know if using virtualenv in each terminal resolves you issue.
If this resolves your issue please let me know and I will close the ticket.
Regardless of the proximate cause of this error, the ultimate cause is sloppy code in the 'six' package. This bug in 'six' is being tickled in all kinds of situations, especially those that involve Flask/Werkzeug==0.10.1. The patch has only gone in a few days ago so you'll have to compile the package from source if you want a fix. https://bitbucket.org/gutworth/six/commits/c996ed1dc006