gpt4 book ai didi

python - 生产服务器上的 IOError

转载 作者:太空宇宙 更新时间:2023-11-03 14:25:35 26 4
gpt4 key购买 nike

我正在使用以下第三方库在 Django 中编写网络应用程序:

Django==1.6.1
argparse==1.2.1
cffi==0.8.1
pycparser==2.10
pylast==0.5.11
pyspotify==2.0.0a1
wsgiref==0.1.2

我一直在使用 sudo pip install git+git://github.com/mopidy/pyspotify.git 安装 pyspotify,因为我想要开发版本。

当我在本地运行 Django 应用程序时,一切正常。当我将更改拉到我的 Apache 服务器时,pip install -r requirements.txt,重新启动服务器并访问 IP,我收到以下错误:

Environment:


Request Method: GET
Request URL: http://ec2-54-196-205-226.compute-1.amazonaws.com/

Django Version: 1.6.1
Python Version: 2.7.3
Installed Applications:
('django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'raudio')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware')


Traceback:
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
101. resolver_match = resolver.resolve(request.path_info)
File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py" in resolve
320. sub_match = pattern.resolve(new_path)
File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py" in resolve
222. return ResolverMatch(self.callback, args, kwargs, self.name)
File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py" in callback
229. self._callback = get_callable(self._callback_str)
File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py" in wrapper
32. result = func(*args)
File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py" in get_callable
96. mod = import_module(mod_name)
File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py" in import_module
40. __import__(name)
File "/home/ubuntu/public_html/clupus.com/clupus/raudio/views.py" in <module>
9. import spotify
File "/usr/local/lib/python2.7/dist-packages/spotify/__init__.py" in <module>
53. ext_package='spotify')
File "/usr/local/lib/python2.7/dist-packages/cffi/api.py" in verify
339. lib = self.verifier.load_library()
File "/usr/local/lib/python2.7/dist-packages/cffi/verifier.py" in load_library
73. self._write_source()
File "/usr/local/lib/python2.7/dist-packages/cffi/verifier.py" in _write_source
125. file = open(self.sourcefilename, 'w')

Exception Type: IOError at /
Exception Value: [Errno 2] No such file or directory: '/usr/local/lib/python2.7/dist-packages/spotify/__pycache__/_cffi__x3868ddbbx77caf6c5.c'

当我在服务器上pip freeze 时,所有依赖项似乎都已满足,所以我不确定问题出在哪里。有人有想法吗?

最佳答案

假设您在尝试安装时遇到与我相同的编译器错误:

c/_cffi_backend.c:14:17: fatal error: ffi.h: No such file or directory

#include <ffi.h>

^

compilation terminated.

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

我找到了修复 here 通过执行 apt-get install libffi-dev

关于python - 生产服务器上的 IOError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21158317/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com