“importerror: no module named site” Log file says to change PYTHONHOME to a directory? uWSGI / nginx /...












0















New to web applications so please excuse the ignorance. I did go through a number of other stackoverflow posts about ImportError: no module names site but didn't see any as relevant.



I am trying to host to the web from my raspberry pi. It is running nginx, uwsgi, and flask.



I am using the following with different directories:



https://github.com/futureshocked/RaspberryPi-FullStack/blob/master/lab_app_nginx.conf (nginx config)



https://github.com/futureshocked/RaspberryPi-FullStack/blob/master/lab_app_uwsgi.ini (uwsgi config)



https://github.com/futureshocked/RaspberryPi-FullStack/blob/master/hello.py (file to be run which should start flask)



Executing hello.py with uwsgi does not start flask and the following is from the log file:



*** Starting uWSGI 2.0.17.1 (32bit) on [Wed Nov 21 03:52:10 2018] ***
compiled with version: 6.3.0 20170516 on 21 November 2018 02:28:06
os: Linux-4.14.78-v7+ #1156 SMP Tue Oct 23 14:34:39 BST 2018
nodename: pulsar
machine: armv7l
clock source: unix
detected number of CPU cores: 4
current working directory: /var/log/uwsgi
detected binary path: /usr/local/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
*** WARNING: you are running uWSGI without its master process manager ***
your processes number limit is 5918
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to UNIX address /home/bryan/Development/www/lab_app/lab_app_uwsgi.sock fd 3
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
Python version: 2.7.13 (default, Sep 26 2018, 18:42:22) [GCC 6.3.0 20170516]
Set PythonHome to /home/bryan/Development/www/lab_app
ImportError: No module named site


The Set PythonHome to /home/bryan/Development/www/lab_app is confusing because I can not set PYTHONHOME to a directory (and what would that even accomplish)?



Any suggestions for resolution and/or suggestions for reading to better understand anything involved in this project appreciated.



Thank you for your time.










share|improve this question



























    0















    New to web applications so please excuse the ignorance. I did go through a number of other stackoverflow posts about ImportError: no module names site but didn't see any as relevant.



    I am trying to host to the web from my raspberry pi. It is running nginx, uwsgi, and flask.



    I am using the following with different directories:



    https://github.com/futureshocked/RaspberryPi-FullStack/blob/master/lab_app_nginx.conf (nginx config)



    https://github.com/futureshocked/RaspberryPi-FullStack/blob/master/lab_app_uwsgi.ini (uwsgi config)



    https://github.com/futureshocked/RaspberryPi-FullStack/blob/master/hello.py (file to be run which should start flask)



    Executing hello.py with uwsgi does not start flask and the following is from the log file:



    *** Starting uWSGI 2.0.17.1 (32bit) on [Wed Nov 21 03:52:10 2018] ***
    compiled with version: 6.3.0 20170516 on 21 November 2018 02:28:06
    os: Linux-4.14.78-v7+ #1156 SMP Tue Oct 23 14:34:39 BST 2018
    nodename: pulsar
    machine: armv7l
    clock source: unix
    detected number of CPU cores: 4
    current working directory: /var/log/uwsgi
    detected binary path: /usr/local/bin/uwsgi
    !!! no internal routing support, rebuild with pcre support !!!
    uWSGI running as root, you can use --uid/--gid/--chroot options
    *** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
    *** WARNING: you are running uWSGI without its master process manager ***
    your processes number limit is 5918
    your memory page size is 4096 bytes
    detected max file descriptor number: 1024
    lock engine: pthread robust mutexes
    thunder lock: disabled (you can enable it with --thunder-lock)
    uwsgi socket 0 bound to UNIX address /home/bryan/Development/www/lab_app/lab_app_uwsgi.sock fd 3
    uWSGI running as root, you can use --uid/--gid/--chroot options
    *** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
    Python version: 2.7.13 (default, Sep 26 2018, 18:42:22) [GCC 6.3.0 20170516]
    Set PythonHome to /home/bryan/Development/www/lab_app
    ImportError: No module named site


    The Set PythonHome to /home/bryan/Development/www/lab_app is confusing because I can not set PYTHONHOME to a directory (and what would that even accomplish)?



    Any suggestions for resolution and/or suggestions for reading to better understand anything involved in this project appreciated.



    Thank you for your time.










    share|improve this question

























      0












      0








      0








      New to web applications so please excuse the ignorance. I did go through a number of other stackoverflow posts about ImportError: no module names site but didn't see any as relevant.



      I am trying to host to the web from my raspberry pi. It is running nginx, uwsgi, and flask.



      I am using the following with different directories:



      https://github.com/futureshocked/RaspberryPi-FullStack/blob/master/lab_app_nginx.conf (nginx config)



      https://github.com/futureshocked/RaspberryPi-FullStack/blob/master/lab_app_uwsgi.ini (uwsgi config)



      https://github.com/futureshocked/RaspberryPi-FullStack/blob/master/hello.py (file to be run which should start flask)



      Executing hello.py with uwsgi does not start flask and the following is from the log file:



      *** Starting uWSGI 2.0.17.1 (32bit) on [Wed Nov 21 03:52:10 2018] ***
      compiled with version: 6.3.0 20170516 on 21 November 2018 02:28:06
      os: Linux-4.14.78-v7+ #1156 SMP Tue Oct 23 14:34:39 BST 2018
      nodename: pulsar
      machine: armv7l
      clock source: unix
      detected number of CPU cores: 4
      current working directory: /var/log/uwsgi
      detected binary path: /usr/local/bin/uwsgi
      !!! no internal routing support, rebuild with pcre support !!!
      uWSGI running as root, you can use --uid/--gid/--chroot options
      *** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
      *** WARNING: you are running uWSGI without its master process manager ***
      your processes number limit is 5918
      your memory page size is 4096 bytes
      detected max file descriptor number: 1024
      lock engine: pthread robust mutexes
      thunder lock: disabled (you can enable it with --thunder-lock)
      uwsgi socket 0 bound to UNIX address /home/bryan/Development/www/lab_app/lab_app_uwsgi.sock fd 3
      uWSGI running as root, you can use --uid/--gid/--chroot options
      *** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
      Python version: 2.7.13 (default, Sep 26 2018, 18:42:22) [GCC 6.3.0 20170516]
      Set PythonHome to /home/bryan/Development/www/lab_app
      ImportError: No module named site


      The Set PythonHome to /home/bryan/Development/www/lab_app is confusing because I can not set PYTHONHOME to a directory (and what would that even accomplish)?



      Any suggestions for resolution and/or suggestions for reading to better understand anything involved in this project appreciated.



      Thank you for your time.










      share|improve this question














      New to web applications so please excuse the ignorance. I did go through a number of other stackoverflow posts about ImportError: no module names site but didn't see any as relevant.



      I am trying to host to the web from my raspberry pi. It is running nginx, uwsgi, and flask.



      I am using the following with different directories:



      https://github.com/futureshocked/RaspberryPi-FullStack/blob/master/lab_app_nginx.conf (nginx config)



      https://github.com/futureshocked/RaspberryPi-FullStack/blob/master/lab_app_uwsgi.ini (uwsgi config)



      https://github.com/futureshocked/RaspberryPi-FullStack/blob/master/hello.py (file to be run which should start flask)



      Executing hello.py with uwsgi does not start flask and the following is from the log file:



      *** Starting uWSGI 2.0.17.1 (32bit) on [Wed Nov 21 03:52:10 2018] ***
      compiled with version: 6.3.0 20170516 on 21 November 2018 02:28:06
      os: Linux-4.14.78-v7+ #1156 SMP Tue Oct 23 14:34:39 BST 2018
      nodename: pulsar
      machine: armv7l
      clock source: unix
      detected number of CPU cores: 4
      current working directory: /var/log/uwsgi
      detected binary path: /usr/local/bin/uwsgi
      !!! no internal routing support, rebuild with pcre support !!!
      uWSGI running as root, you can use --uid/--gid/--chroot options
      *** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
      *** WARNING: you are running uWSGI without its master process manager ***
      your processes number limit is 5918
      your memory page size is 4096 bytes
      detected max file descriptor number: 1024
      lock engine: pthread robust mutexes
      thunder lock: disabled (you can enable it with --thunder-lock)
      uwsgi socket 0 bound to UNIX address /home/bryan/Development/www/lab_app/lab_app_uwsgi.sock fd 3
      uWSGI running as root, you can use --uid/--gid/--chroot options
      *** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
      Python version: 2.7.13 (default, Sep 26 2018, 18:42:22) [GCC 6.3.0 20170516]
      Set PythonHome to /home/bryan/Development/www/lab_app
      ImportError: No module named site


      The Set PythonHome to /home/bryan/Development/www/lab_app is confusing because I can not set PYTHONHOME to a directory (and what would that even accomplish)?



      Any suggestions for resolution and/or suggestions for reading to better understand anything involved in this project appreciated.



      Thank you for your time.







      python nginx flask uwsgi






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 21 '18 at 19:40









      pr0me7heu2pr0me7heu2

      11




      11
























          0






          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53419423%2fimporterror-no-module-named-site-log-file-says-to-change-pythonhome-to-a-dire%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53419423%2fimporterror-no-module-named-site-log-file-says-to-change-pythonhome-to-a-dire%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          android studio warns about leanback feature tag usage required on manifest while using Unity exported app?

          SQL update select statement

          'app-layout' is not a known element: how to share Component with different Modules