python-eggs_修复Python的“ Python Eggs”错误

python-eggs

Let me first state this for the record: I am not a server guy. The closest I've ever gotten to compiling my own versions of code is "sudo port install ..." So when I decided to teach myself Python (creating simply database interaction, record listings, etc) and kept getting "500 Internal Server Error" messages, I thought I was doomed. I opened up the Apache error log and saw this:

让我首先说明一下:我不是服务器人员。 我编译过的最接近我自己的代码版本的是“ sudo port install ...”,所以当我决定自学Python(创建简单的数据库交互,记录列表等)并不断收到“ 500 Internal Server Error ”消息,我以为我注定了。 我打开了Apache错误日志,并看到了以下内容:


[error] [client ::1] Traceback (most recent call last):
[error] [client ::1]   File "/Users/davidwalsh83/Projects/server/something.py", line 6, in <module>
[error] [client ::1]     import MySQLdb, cgi, cgitb, httplib, urllib2
[error] [client ::1]   File "build/bdist.macosx-10.6-universal/egg/MySQLdb/__init__.py", line 19, in <module>
[error] [client ::1]   File "build/bdist.macosx-10.6-universal/egg/_mysql.py", line 7, in <module>
[error] [client ::1]   File "build/bdist.macosx-10.6-universal/egg/_mysql.py", line 4, in __bootstrap__
[error] [client ::1]   File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py", line 835, in resource_filename
[error] [client ::1]     self, resource_name
[error] [client ::1]   File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py", line 1304, in get_resource_filename
[error] [client ::1]     self._extract_resource(manager, self._eager_to_zip(name))
[error] [client ::1]   File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py", line 1326, in _extract_resource
[error] [client ::1]     self.egg_name, self._parts(zip_path)
[error] [client ::1]   File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py", line 915, in get_cache_path
[error] [client ::1]     self.extraction_error()
[error] [client ::1]   File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py", line 881, in extraction_error
[error] [client ::1]     raise err
[error] [client ::1] pkg_resources.ExtractionError: Can't extract file(s) to egg cache
[error] [client ::1] 
[error] [client ::1] The following error occurred while trying to extract file(s) to the Python egg
[error] [client ::1] cache:
[error] [client ::1] 
[error] [client ::1]   [Errno 20] Not a directory: '/Library/WebServer/.python-eggs/MySQL_python-1.2.3c1-py2.6-macosx-10.6-universal.egg-tmp'
[error] [client ::1] 
[error] [client ::1] The Python egg cache directory is currently set to:
[error] [client ::1] 
[error] [client ::1]   /Library/WebServer/.python-eggs
[error] [client ::1] 
[error] [client ::1] Perhaps your account does not have write access to this directory?  You can
[error] [client ::1] change the cache directory by setting the PYTHON_EGG_CACHE environment
[error] [client ::1] variable to point to an accessible directory.
[error] [client ::1] 
[error] [client ::1] Premature end of script headers: something.py


My first thought was "Wow, that's quite a long way of telling me to 'just quit.'" Not wanting to concede defeat, I did some quick Google searching to find that the following snippet of Python code would allow me program another day:

我的第一个念头是“哇,那是告诉我'退出'的很长的路。”不想让失败,我做了一些Google快速搜索,发现以下Python代码段可以让我改天编程:


import os
os.environ['PYTHON_EGG_CACHE'] = '/tmp'


I'd like to pretend I know what that means but I really don't know. In any event, if you start receiving those errors, this snippet could be your ticket to taking a bite out of Python.

我想假装我知道那意味着什么,但我真的不知道。 无论如何,如果您开始收到这些错误,则此片段可能是您咬一口Python的门票。

翻译自: https://davidwalsh.name/python-eggs

python-eggs

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
36085 WARNING: lib not found: c10.dll dependency of D:\python\lib\site-packages\torchvision\_C.pyd 36099 WARNING: lib not found: torch_cpu.dll dependency of D:\python\lib\site-packages\torchvision\_C.pyd 36113 WARNING: lib not found: c10_cuda.dll dependency of D:\python\lib\site-packages\torchvision\_C.pyd 36127 WARNING: lib not found: torch_cuda_cpp.dll dependency of D:\python\lib\site-packages\torchvision\_C.pyd 36146 WARNING: lib not found: torch_python.dll dependency of D:\python\lib\site-packages\torch\_C_flatbuffer.cp37-win_amd64.pyd 36287 WARNING: lib not found: torch_python.dll dependency of D:\python\lib\site-packages\torch\_C.cp37-win_amd64.pyd 37214 WARNING: lib not found: api-ms-win-security-systemfunctions-l1-1-0.dll dependency of D:\python\lib\site-packages\torchvision\cudart64_110.dll 326321 INFO: Looking for eggs 326578 INFO: Using Python library D:\python\python37.dll 326578 INFO: Found binding redirects: [] 326631 INFO: Warnings written to D:\python-zuoye\pythonProject_001\build\main\warn-main.txt 327409 INFO: Graph cross-reference written to D:\python-zuoye\pythonProject_001\build\main\xref-main.html 327899 INFO: checking PYZ 327900 INFO: Building PYZ because PYZ-00.toc is non existent 327901 INFO: Building PYZ (ZlibArchive) D:\python-zuoye\pythonProject_001\build\main\PYZ-00.pyz 334452 INFO: Building PYZ (ZlibArchive) D:\python-zuoye\pythonProject_001\build\main\PYZ-00.pyz completed successfully. 334974 INFO: checking PKG 334974 INFO: Building PKG because PKG-00.toc is non existent 334975 INFO: Building PKG (CArchive) main.pkg
06-11

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值