Django-管理安装错误-屏幕构建轮子失败

问题描述 投票:0回答:1

我在Windows服务器上发布了我的项目,但domain.com/admin无法正常工作。根据互联网上的研究结果,我想安装 Django-admin,但出现错误。我的电脑没有出现这样的问题。

         Creating library build\temp.win-amd64-cpython-312\Release\source\str_util.cp312-win_amd64.lib and object build\temp.win-amd64-cpython-312\Release\source\str_util.cp312-win_amd64.exp
  str_util.obj : error LNK2001: unresolved external symbol PyUnicode_AS_UNICODE
  build\lib.win-amd64-cpython-312\screen\str_util.cp312-win_amd64.pyd : fatal error LNK1120: 1 unresolved externals
  error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.38.33130\\bin\\HostX86\\x64\\link.exe' failed with exit code 1120
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for screen
Failed to build screen
ERROR: Could not build wheels for screen, which is required to install pyproject.toml- 
based projects

C:\inetpub\vhosts\domain.com.tr\httpdocs>

网址.py

from django.contrib import admin

urlpatterns = [
path('admin/', admin.site.urls),
path('sitemap.xml', sitemap, {'sitemaps': sitemaps}, 
name='django.contrib.sitemaps.views.sitemap'),
] 

if settings.DEBUG:
  urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

错误详情

python django django-admin
1个回答
0
投票

我看到你有 Visual Studio 2022。我今天遇到了同样的问题,如果其他人遇到类似的问题,这个解决方案对我有用。

https://stackoverflow.com/a/50210015/6671241

© www.soinside.com 2019 - 2024. All rights reserved.