前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >/root/.python-eggs 报

/root/.python-eggs 报

作者头像
py3study
发布2020-01-07 16:15:32
3390
发布2020-01-07 16:15:32
举报
文章被收录于专栏:python3python3

部署过程中,使用虚环境,但是启动程序的时候报错,如下:

Traceback (most recent call last):   File "/home/himalayas/fdsearch/fdsearch/bin/fdsearch", line 34, in <module>     from fdsearch import wsgi   File "/home/himalayas/fdsearch/fdsearch/wsgi.py", line 32, in <module>     import fdsearch.domain   File "/home/himalayas/fdsearch/fdsearch/domain/__init__.py", line 20, in <module>     from notify_handler import NotifyHandler   File "/home/himalayas/fdsearch/fdsearch/domain/notify_handler.py", line 23, in <module>     from cjson import encode as json_encode   File "build/bdist.linux-x86_64/egg/cjson.py", line 7, in <module>   File "build/bdist.linux-x86_64/egg/cjson.py", line 4, in __bootstrap__   File "/home/himalayas/virtualenv/python2.7-fd/lib/python2.7/site-packages/pkg_resources.py", line 945, in resource_filename     self, resource_name   File "/home/himalayas/virtualenv/python2.7-fd/lib/python2.7/site-packages/pkg_resources.py", line 1633, in get_resource_filename     self._extract_resource(manager, self._eager_to_zip(name))   File "/home/himalayas/virtualenv/python2.7-fd/lib/python2.7/site-packages/pkg_resources.py", line 1661, in _extract_resource     self.egg_name, self._parts(zip_path)   File "/home/himalayas/virtualenv/python2.7-fd/lib/python2.7/site-packages/pkg_resources.py", line 1025, in get_cache_path     self.extraction_error()   File "/home/himalayas/virtualenv/python2.7-fd/lib/python2.7/site-packages/pkg_resources.py", line 991, in extraction_error     raise err pkg_resources.ExtractionError: Can't extract file(s) to egg cache The following error occurred while trying to extract file(s) to the Python egg cache:   [Errno 13] Permission denied: '/root/.python-eggs' The Python egg cache directory is currently set to:   /root/.python-eggs

解决办法:让开发在代码中声明一下环境变量。

代码语言:javascript
复制
export PYTHON_EGG_CACHE=/some/other/dir

注意:在系统的/etc/profile中声明是没有办法的,因为程序是在虚环境中运行。

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2019-09-15 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档