pserve: "No such file or directory --reload" (or any other option flag)

192 прегледа
Пређи на прву непрочитану поруку

Chris Shenton

непрочитано,
23. 6. 2016. 17:08:1923.6.16.
– pylons-discuss
I've been using "pserve --reload myenv.ini" forever and recently the flags stopped working. Perhaps it's me, or perhaps I didn't pin versions in my setup.py file, but the "--reload" and other flags which used to work with pserve are no longer recognized. 

My .ini has:

[server:main]
use = egg:waitress#main
host = 0.0.0.0
port = 54321


I tried pinning the versions and saw this on pyramid==1.6.1 and today on pyramid==1.7.

```
./.venv3/bin/pserve --reload chris.ini
Starting subprocess with file monitor
Traceback (most recent call last):
  File "./.venv3/bin/pserve", line 9, in <module>
    load_entry_point('pyramid==1.7', 'console_scripts', 'pserve')()
  File "/Users/chris/Projects/vstudios/MessageM8/messagem8/.venv3/lib/python3.4/site-packages/pyramid-1.7-py3.4.egg/pyramid/scripts/pserve.py", line 60, in main
    return command.run()
  File "/Users/chris/Projects/vstudios/MessageM8/messagem8/.venv3/lib/python3.4/site-packages/pyramid-1.7-py3.4.egg/pyramid/scripts/pserve.py", line 371, in run
    global_conf=vars)
  File "/Users/chris/Projects/vstudios/MessageM8/messagem8/.venv3/lib/python3.4/site-packages/pyramid-1.7-py3.4.egg/pyramid/scripts/pserve.py", line 406, in loadapp
    return loadapp(app_spec, name=name, relative_to=relative_to, **kw)
  File "/Users/chris/Projects/vstudios/MessageM8/messagem8/.venv3/lib/python3.4/site-packages/PasteDeploy-1.5.2-py3.4.egg/paste/deploy/loadwsgi.py", line 247, in loadapp
    return loadobj(APP, uri, name=name, **kw)
  File "/Users/chris/Projects/vstudios/MessageM8/messagem8/.venv3/lib/python3.4/site-packages/PasteDeploy-1.5.2-py3.4.egg/paste/deploy/loadwsgi.py", line 272, in loadobj
    return context.create()
  File "/Users/chris/Projects/vstudios/MessageM8/messagem8/.venv3/lib/python3.4/site-packages/PasteDeploy-1.5.2-py3.4.egg/paste/deploy/loadwsgi.py", line 710, in create
    return self.object_type.invoke(self)
  File "/Users/chris/Projects/vstudios/MessageM8/messagem8/.venv3/lib/python3.4/site-packages/PasteDeploy-1.5.2-py3.4.egg/paste/deploy/loadwsgi.py", line 146, in invoke
    return fix_call(context.object, context.global_conf, **context.local_conf)
  File "/Users/chris/Projects/vstudios/MessageM8/messagem8/.venv3/lib/python3.4/site-packages/PasteDeploy-1.5.2-py3.4.egg/paste/deploy/util.py", line 55, in fix_call
    val = callable(*args, **kw)
  File "/Users/chris/Projects/vstudios/MessageM8/messagem8/messagem8/__init__.py", line 54, in main
    config.scan()
  File "/Users/chris/Projects/vstudios/MessageM8/messagem8/.venv3/lib/python3.4/site-packages/pyramid-1.7-py3.4.egg/pyramid/config/__init__.py", line 976, in scan
    ignore=ignore)
  File "/Users/chris/Projects/vstudios/MessageM8/messagem8/.venv3/lib/python3.4/site-packages/venusian-1.0-py3.4.egg/venusian/__init__.py", line 205, in scan
    __import__(modname)
  File "/Users/chris/Projects/vstudios/MessageM8/messagem8/messagem8/scripts/render_template.py", line 41, in <module>
    body = open(template_file).read()
FileNotFoundError: [Errno 2] No such file or directory: '--reload'
```

Trying other flags has the same failure:

./.venv3/bin/pserve --browser chris.ini
[...]
FileNotFoundError: [Errno 2] No such file or directory: '--browser'

Flipping order, same problem:

./.venv3/bin/pserve chris.ini --reload 
[...]
FileNotFoundError: [Errno 2] No such file or directory: '--reload'

I've tried it by drilling down to the 'pserve' script in the Pyramid distribution and see the same thing:

python ./.venv3/lib/python3.4/site-packages/pyramid-1.7-py3.4.egg/pyramid/scripts/pserve.py --reload chris.ini
[...]
FileNotFoundError: [Errno 2] No such file or directory: '--reload'

Its as if the  optparse in pserve.py isn't parsing options properly but that seems unlikely to me. 

If nobody else is seeing this (nothing found in searches), do you have any ideas what I'm doing wrong? 

Thanks!

Michael Merickel

непрочитано,
23. 6. 2016. 17:10:4623.6.16.
– Pylons
Something has likely become corrupt in your virtualenv. I'd try creating a new one. This is not a but with the pserve code itself but rather your environment.

--
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-discus...@googlegroups.com.
To post to this group, send email to pylons-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/493bf640-0c49-4dab-ae8c-206469b6eac1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jonathan Vanasco

непрочитано,
23. 6. 2016. 19:19:2523.6.16.
– pylons-discuss


On Thursday, June 23, 2016 at 5:10:46 PM UTC-4, Michael Merickel wrote:
Something has likely become corrupt in your virtualenv. I'd try creating a new one. This is not a but with the pserve code itself but rather your environment.

This same thing has happened to me a few times when environment vars got screwed up.  You may just need to `source ./.venv3/bin/activate`

Bert JW Regeer

непрочитано,
23. 6. 2016. 20:29:4623.6.16.
– pylons-...@googlegroups.com
No. He is calling pserve from his bin directory directly, that’s perfectly acceptable, and is actually what we recommend in the docs.

We don’t recommend “activating” the virtualenv.

Bert
> --
> 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-discus...@googlegroups.com.
> To post to this group, send email to pylons-...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/9070f9a3-236e-46a4-b343-186207a4b873%40googlegroups.com.

Chris Shenton

непрочитано,
24. 6. 2016. 09:28:1024.6.16.
– pylons-discuss
FWIW, I've recreated the virtualenv a couple times, before pinning all the versions, and after pinning with pyramid-1.7. Same behavior. :-(
Одговори свима
Одговори аутору
Проследи
0 нових порука