Python virtualenvs停止了工作

时间:2014-10-10 12:16:49

标签: python python-3.x pip python-3.4

我将Raspberry Pi作为我的网络服务器,过去8个月一切正常。

但是现在,由于某些原因,我的虚拟环境停止了工作!当我通过source venv/bin/activate激活一些虚拟环境时。然后当我输入例如pip list我明白了:

Traceback (most recent call last):
  File "/var/www/sova/nvenv/bin/pip", line 7, in <module>
    from pip import main
  File "/var/www/sova/nvenv/lib/python3.4/site-packages/pip/__init__.py", line 9, in <module>
    from pip.log import logger
  File "/var/www/sova/nvenv/lib/python3.4/site-packages/pip/log.py", line 8, in <module>
    from pip import backwardcompat
  File "/var/www/sova/nvenv/lib/python3.4/site-packages/pip/backwardcompat/__init__.py", line 5, in <module>
    import imp
  File "/var/www/sova/nvenv/lib/python3.4/imp.py", line 22, in <module>
    from importlib import util
  File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
  File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1129, in _exec
  File "<frozen importlib._bootstrap>", line 1467, in exec_module
  File "<frozen importlib._bootstrap>", line 1570, in get_code
  File "<frozen importlib._bootstrap>", line 656, in _compile_bytecode
ValueError: bad marshal data (unknown type code)

gunicorn也未使用此输出运行:

Oct 10 14:08:19 smecpi systemd[1]: Started gunicorn sova  daemon.
Oct 10 14:08:19 smecpi gunicorn_start[20298]: Starting sova_app as nginx
Oct 10 14:08:20 smecpi gunicorn_start[20298]: Traceback (most recent call last):
Oct 10 14:08:20 smecpi gunicorn_start[20298]: File "/var/www/sova/nvenv/bin/gunicorn", line 5, in <module>
Oct 10 14:08:20 smecpi gunicorn_start[20298]: from pkg_resources import load_entry_point
Oct 10 14:08:20 smecpi gunicorn_start[20298]: File "/var/www/sova/nvenv/lib/python3.4/site-packages/pkg_resources.py", line 21, in <module>
Oct 10 14:08:20 smecpi gunicorn_start[20298]: import imp
Oct 10 14:08:20 smecpi gunicorn_start[20298]: File "/var/www/sova/nvenv/lib/python3.4/imp.py", line 22, in <module>
Oct 10 14:08:20 smecpi gunicorn_start[20298]: from importlib import util
Oct 10 14:08:20 smecpi gunicorn_start[20298]: File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
Oct 10 14:08:20 smecpi gunicorn_start[20298]: File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
Oct 10 14:08:20 smecpi gunicorn_start[20298]: File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
Oct 10 14:08:20 smecpi gunicorn_start[20298]: File "<frozen importlib._bootstrap>", line 1129, in _exec
Oct 10 14:08:20 smecpi gunicorn_start[20298]: File "<frozen importlib._bootstrap>", line 1467, in exec_module
Oct 10 14:08:20 smecpi gunicorn_start[20298]: File "<frozen importlib._bootstrap>", line 1570, in get_code
Oct 10 14:08:20 smecpi gunicorn_start[20298]: File "<frozen importlib._bootstrap>", line 656, in _compile_bytecode
Oct 10 14:08:20 smecpi gunicorn_start[20298]: ValueError: bad marshal data (unknown type code)
Oct 10 14:08:20 smecpi systemd[1]: gunicorn_sova.service: main process exited, code=exited, status=1/FAILURE
Oct 10 14:08:20 smecpi systemd[1]: Unit gunicorn_sova.service entered failed state.

此外,在另一个单独的virtualenv中我得到类似的错误(在pip install之后):

Traceback (most recent call last):
  File "/var/www/myweb/venv/bin/pip", line 7, in <module>
    from pip import main
  File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
  File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1129, in _exec
  File "<frozen importlib._bootstrap>", line 1467, in exec_module
  File "<frozen importlib._bootstrap>", line 1570, in get_code
  File "<frozen importlib._bootstrap>", line 656, in _compile_bytecode
ValueError: bad marshal data (invalid reference)

有什么想法吗?谢谢

0 个答案:

没有答案