Skip to content
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

No module named flask #128

Closed
peske opened this issue May 12, 2016 · 4 comments
Closed

No module named flask #128

peske opened this issue May 12, 2016 · 4 comments
Labels

Comments

@peske
Copy link

peske commented May 12, 2016

I've just installed puppet board by following the instructions at https://forge.puppet.com/puppet/puppetboard, but I can't start it. Apache error log repeats:

[Thu May 12 16:37:31.278737 2016] [:error] [pid 6946:tid 139904046110464] [remote 10.1.200.2:55801] mod_wsgi (pid=6946): Target WSGI script '/srv/puppetboard/puppetboard/wsgi.py' cannot be loaded as Python module.
[Thu May 12 16:37:31.278829 2016] [:error] [pid 6946:tid 139904046110464] [remote 10.1.200.2:55801] mod_wsgi (pid=6946): Exception occurred processing WSGI script '/srv/puppetboard/puppetboard/wsgi.py'.
[Thu May 12 16:37:31.278876 2016] [:error] [pid 6946:tid 139904046110464] [remote 10.1.200.2:55801] Traceback (most recent call last):
[Thu May 12 16:37:31.278918 2016] [:error] [pid 6946:tid 139904046110464] [remote 10.1.200.2:55801]   File "/srv/puppetboard/puppetboard/wsgi.py", line 15, in <module>
[Thu May 12 16:37:31.279046 2016] [:error] [pid 6946:tid 139904046110464] [remote 10.1.200.2:55801]     from puppetboard.app import app as application
[Thu May 12 16:37:31.279074 2016] [:error] [pid 6946:tid 139904046110464] [remote 10.1.200.2:55801]   File "/srv/puppetboard/puppetboard/puppetboard/app.py", line 13, in <module>
[Thu May 12 16:37:31.279628 2016] [:error] [pid 6946:tid 139904046110464] [remote 10.1.200.2:55801]     from flask import (
[Thu May 12 16:37:31.279674 2016] [:error] [pid 6946:tid 139904046110464] [remote 10.1.200.2:55801] ImportError: No module named flask

Honestly I don't know anything about python, so can you suggest what to do? Workaround?

Thanks!

@peske
Copy link
Author

peske commented May 12, 2016

Well, I've had to learn few things obviously. So your module missing the following in order to actually work:

  # PuppetBoard
  class { 'puppetboard':
    manage_git        => false,
    manage_virtualenv => true,
    reports_count     => 40, 
  }->
  python::pip { 'Flask':
    virtualenv => '/srv/puppetboard/virtenv-puppetboard',
    proxy      => 'http://internal-proxy.mydomain.com:8080',
  }->
  python::pip { 'Flask-WTF':
    virtualenv => '/srv/puppetboard/virtenv-puppetboard',
    proxy      => 'http://internal-proxy.mydomain.com:8080',
  }->
  python::pip { 'WTForms':
    virtualenv => '/srv/puppetboard/virtenv-puppetboard',
    proxy      => 'http://internal-proxy.mydomain.com:8080',
  }->
  python::pip { 'pypuppetdb':
    virtualenv => '/srv/puppetboard/virtenv-puppetboard',
    proxy      => 'http://internal-proxy.mydomain.com:8080',
  }

After adding this everything went well, and everything works.

Sorry for not creating pull request, but at the moment I don't have time to go through your code. You'll change it yourself easily.

Thanks!

@igalic
Copy link
Contributor

igalic commented May 18, 2016

is there any way you can provide this as patch to our module, @peske?

@vchepkov
Copy link

vchepkov commented Feb 4, 2017

Actually, these modules are present in the repository:
https://github.com/voxpupuli/puppetboard/blob/master/requirements.txt

it looks like new setuptools module is broken, so python module just fails:

# /opt/puppetboard/virtenv-puppetboard/bin/pip install --upgrade pip setuptools
Downloading/unpacking pip from https://pypi.python.org/packages/11/b6/abcb525026a4be042b486df43905d6893fb04f05aac21c32c638e939e447/pip-9.0.1.tar.gz#md5=35f01da33009719497f01a4ba69d63c9
  Downloading pip-9.0.1.tar.gz (1.2MB): 1.2MB downloaded
  Running setup.py egg_info for package pip
    /usr/lib64/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'python_requires'
      warnings.warn(msg)
    
    warning: no previously-included files found matching '.coveragerc'
    warning: no previously-included files found matching '.mailmap'
    warning: no previously-included files found matching '.travis.yml'
    warning: no previously-included files found matching '.landscape.yml'
    warning: no previously-included files found matching 'pip/_vendor/Makefile'
    warning: no previously-included files found matching 'tox.ini'
    warning: no previously-included files found matching 'dev-requirements.txt'
    warning: no previously-included files found matching 'appveyor.yml'
    no previously-included directories found matching '.github'
    no previously-included directories found matching '.travis'
    no previously-included directories found matching 'docs/_build'
    no previously-included directories found matching 'contrib'
    no previously-included directories found matching 'tasks'
    no previously-included directories found matching 'tests'
Downloading/unpacking setuptools from https://pypi.python.org/packages/64/88/d434873ba1ce02c0ed669f574afeabaeaaeec207929a41b5c1ed947270fc/setuptools-34.1.0.zip#md5=a2f819c503b49781b1a15cfb4d49c974
  Downloading setuptools-34.1.0.zip (621kB): 621kB downloaded
  Running setup.py egg_info for package setuptools
    Traceback (most recent call last):
      File "<string>", line 3, in <module>
      File "setuptools/__init__.py", line 10, in <module>
        from six.moves import filter, map
    ImportError: No module named six.moves
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 3, in <module>

  File "setuptools/__init__.py", line 10, in <module>

    from six.moves import filter, map

ImportError: No module named six.moves

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /opt/puppetboard/virtenv-puppetboard/build/setuptools
Storing complete log in /root/.pip/pip.log

@aeciopires
Copy link

aeciopires commented Feb 22, 2017

In english:

On 22/02/2017, I had the same problem as @peske quoted in the beginning of the issue ...
I was installing PuppetBoard on Red Hat 7.3 64 bit. And I solved by adding in the site.pp file the lines of the section "Configure Puppetboard" of the statement below.

Thanks to @peske for reporting the tip and thanks to all developers of community @voxpupuli that work in this module and PuppetBoard. Helped me a lot at work.

Hug.
Stay with God. O/


Em português:

No dia 22/02/2017, eu tive o mesmo problema que o @peske citou no começo do issue...
Eu estava instalando o PuppetBoard no Red Hat 7.3 64 bits. E resolvi adicionando no arquivo site.pp as linhas da seção "Configure Puppetboard" da declaração abaixo.

Obrigado a @peske por reportar a dica e obrigado a todos os desenvolvedores da comunidade @voxpupuli que trabalham neste módulo e do PuppetBoard. Me ajudou bastante no trabalho.

Abraço.
Fica com Deus. o/


#---------------------- BEGIN DECLARATION ------------------------------#

node myserver.domain.com {
   class {'apache':
     default_vhost    => false,
     server_signature => 'Off',
     server_tokens    => 'Prod',
     trace_enable     => 'Off',
   }

   class { 'apache::mod::ssl':
     ssl_cipher    => 'HIGH:MEDIUM:!aNULL:!MD5:!SSLv3:!SSLv2:!TLSv1:!TLSv1.1',
     ssl_protocol  => [ 'all', '-SSLv2', '-SSLv3', '-TLSv1', '-TLSv1.1' ],
   }

   #Configure Apache on this server
   class { 'apache::mod::wsgi':
     wsgi_socket_prefix => '/var/run/wsgi',
   }

   #Configure Puppetboard
   class { 'puppetboard':
     default_environment => '*',
     manage_git          => 'latest',
     manage_virtualenv   => 'latest',
     reports_count       => 50
   }->
  python::pip { 'Flask':
    virtualenv => '/srv/puppetboard/virtenv-puppetboard',
  }->
  python::pip { 'Flask-WTF':
    virtualenv => '/srv/puppetboard/virtenv-puppetboard',
  }->
  python::pip { 'WTForms':
    virtualenv => '/srv/puppetboard/virtenv-puppetboard',
  }->
  python::pip { 'pypuppetdb':
    virtualenv => '/srv/puppetboard/virtenv-puppetboard',
  }

   #Configure Access Puppetboard
   class { 'puppetboard::apache::vhost':
     vhost_name => 'myserver.domain.com',
     port       => 443,
     ssl        => true,
   }
}
#---------------------- END DECLARATION  ------------------------------#

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

5 participants