/root/.python-eggs 报错

简介:

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

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


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

export PYTHON_EGG_CACHE=/some/other/dir

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






      本文转自Tenderrain 51CTO博客,原文链接:http://blog.51cto.com/tenderrain/1670301,如需转载请自行联系原作者


相关文章
|
3月前
|
Web App开发 Python
Python使用selenium的Chrome下载文件报错解决
Python使用selenium的Chrome下载文件报错解决
49 0
|
7月前
|
关系型数据库 MySQL Linux
Python安装mysqlclient报错避坑
MySQL是常用的开源数据库,Python环境下django框架连接MySQL数据库用的是mysqlclient库,今天在用pip安装mysqlclient库时报错,特记录一下,避免后续继续踩坑。
296 0
|
7月前
|
JavaScript Python 内存技术
error C:\Users\Acer\Downloads\Desktop\hrsaas-84\node_modules\deasync: 莫名其妙报错一堆python问题
error C:\Users\Acer\Downloads\Desktop\hrsaas-84\node_modules\deasync: 莫名其妙报错一堆python问题
126 0
|
6月前
|
Python
python flask 后端报错 ImportError: cannot import name ‘cached_prope‘
问题python flask 后端报错 ImportError: cannot import name ‘cached_prope‘flask程序启动但抛出该错误,是因为werkzeug 版本过高,需要降低版本即可 解决:一般这种情况是需要注意第三方库版本的对应,werkzeug需要0.16.0 版本时 flask的版本应该时1.x.x 的版本,不能是2.x过高的版本。
66 0
|
2月前
|
安全 网络安全 API
python调用openai api报错self._sslobj.do_handshake()OSError: [Errno 0] Error
python调用openai api报错self._sslobj.do_handshake()OSError: [Errno 0] Error
74 1
python调用openai api报错self._sslobj.do_handshake()OSError: [Errno 0] Error
|
4月前
|
Python
Python Playwright 打包报错 Please run the following command to download new browsers
Python Playwright 打包报错 Please run the following command to download new browsers
83 0
|
10天前
|
Python
IDA3.12版本的python,依旧报错IDAPython: error executing init.py.No module named ‘impRefer to the message win
IDA3.12版本的python,依旧报错IDAPython: error executing init.py.No module named ‘impRefer to the message win
|
4月前
|
Ubuntu Python
Python(六)使用pycharm创建项目报错:ModuleNotFoundError No module named distutils.util
在ubuntu上使用pycharm创建项目的时候报错: ModuleNotFoundError: No module named 'distutils.util'
612 0
|
1月前
|
索引 Python
Python程序报错合集
Python程序报错合集
14 0
|
1月前
|
文字识别 Python
python代码运行报错:No module named 'aliyunsdkcore'
用python调用阿里云图片OCR识别,使用的是阿里云官方给的传本地图片文件进行检测的代码,运行报错:No module named 'aliyunsdkcore'。在pycharm python软件包和终端里安装aliyunsdkcore这个模块都失败了。