The easiest way to see if your code is installed properly is to make sure
you are not in the folder with your code and then try to import it.

$ cd /
$ /srv/venv/bin/python
>>> import gdpr_permissions

If this doesn't work then it's not installed correctly either using
`/srv/venv/bin/pip install -e <path/to/folder/with/setup.py>` or without
the `-e` depending on your goals.

Further if you want to test that your ini file is pointing at your code
properly then you can do that similarly.

$ cd /
$ /srv/venv/bin/python
>>> from pyramid.paster import get_app
>>> app = get_app('/srv/myapp/gdpr_permissions/production.ini')

This command is almost exactly what uwsgi is doing to load your code and it
will fail with the same DistributionNotFound error you're seeing.

- Michael


On Thu, Mar 1, 2018 at 10:40 AM, Michael Merickel <mmeri...@gmail.com>
wrote:

> The DistributionNotFound error basically always means that your code is
> not installed into the virtualenv being used by uwsgi. In this case it's
> /srv/venv. You should ensure that you've run /srv/venv/bin/pip install
> appropriately.
>
> - Michael
>
> On Thu, Mar 1, 2018 at 5:57 AM, Darren Jones <djaych...@gmail.com> wrote:
>
>> Dear all.
>>
>> I've written my first (worthwhile!) app using Pyramid, and want to deploy
>> it to a raspberry pi.  I've got the pi up and running, and nginx working
>> fine - it can serve a static page or even a simple (test, three line) wsgi
>> app.  However, I am hitting a brick wall on getting the pyramid app up and
>> running using uWSGI.  I've spent the last three days (solidly!) trying to
>> get this up and running, and still I can't get it going.  I've tried loads,
>> but my current issue appears to be that I can't get uWSGI to run the
>> pyramid app from the command line - my current launch command is sudo uwsgi
>> --plugin python3 -H /srv/venv production.ini --socket/srv/myapp/uwsgi.sock
>>
>> When I run this, I just get [uWSGI] getting INI configuration from
>> production.ini, and then back to the command line.
>>
>> Yesterday, I got as far as sudo uwsgi --plugin python3 -H /srv/venv
>> --paste config:/srv/myapp/gdpr_permissions/production.ini --socket
>> /srv/myapp/uwsgi.sock which was giving me more output (what looks to be the
>> uWSGI startup info), but then errors such as
>>
>> pkg_resources.DistributionNotFound: the gdpr_permissions distribution
>> was not found and is required by gdpr_permissions
>>
>> I don't seem to be able to find an authoratitive tutorial on this - they
>> either say 'simply enter uWSGI production.ini and away you go', or seem to
>> be 5+ years out of date, and I'll get so far and then run aground again -
>> many of the links given searching on this list for nginx uwsgi lead me to
>> either dead links, things I've already tried, or impenetrably complex
>> explanations that don't go into details relevant to pyramid apps.
>>
>> If someone could point me in the right direction, it would be immensely
>> helpful.  I don't -think- I'm a complete idiot (I'm happy doing sysadmin
>> stuff, and have compiled from source back in the RH5 days,etc), but it
>> seems everyone else must be able to just get this working without issues
>> given the lack of discussion on the subject.  I'm at the point of giving up.
>>
>> Thanks
>>
>> Darren
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "pylons-discuss" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to pylons-discuss+unsubscr...@googlegroups.com.
>> To post to this group, send email to pylons-discuss@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/pylons-discuss/6e882888-2ab4-42d7-8502-6c89423104cf%40go
>> oglegroups.com
>> <https://groups.google.com/d/msgid/pylons-discuss/6e882888-2ab4-42d7-8502-6c89423104cf%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/CAKdhhwE%2BMof%2Bv-tbJy9WO4K-OsyHC-u%2B_aCkCDzmmwMjg_ON_g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to