当我得到这个错误时,我如何将Django应用程序部署到Vercel

deyfvvtc  于 2023-08-08  发布在  Go
关注(0)|答案(1)|浏览(177)

当我试图通过vercel部署我的django应用程序时,我被卡住了几天。和vercel给予的语法错误。

Failed to run "pip3.9 install --disable-pip-version-check --target . --upgrade -r /vercel/path0/requirements.txt"
Error: Command failed: pip3.9 install --disable-pip-version-check --target . --upgrade -r /vercel/path0/requirements.txt
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [35 lines of output]
      /tmp/pip-build-env-cc0ii6jl/overlay/lib/python3.9/site-packages/setuptools/config/setupcfg.py:293: _DeprecatedConfig: Deprecated config in `setup.cfg`
      !!
      
              ********************************************************************************
              The license_file parameter is deprecated, use license_files instead.
      
              By 2023-Oct-30, you need to update your project and remove deprecated calls
              or your builds will no longer be supported.
      
              See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
              ********************************************************************************
      
      !!
        parsed = self.parsers.get(option_name, lambda x: x)(value)
      running egg_info
      writing psycopg2.egg-info/PKG-INFO
      writing dependency_links to psycopg2.egg-info/dependency_links.txt
      writing top-level names to psycopg2.egg-info/top_level.txt
      
      Error: pg_config executable not found.
      
      pg_config is required to build psycopg2 from source.  Please add the directory
      containing pg_config to the $PATH or specify the full executable path with the
      option:
      
          python setup.py build_ext --pg-config /path/to/pg_config build ...
      
      or with the pg_config option in 'setup.cfg'.
      
      If you prefer to avoid building psycopg2 from source, please install the PyPI
      'psycopg2-binary' package instead.
      
      For further information please check the 'doc/src/install.rst' file (also at
      <https://www.psycopg.org/docs/install.html>).
      
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.

字符串
这部分我的requirements.txt
psycopg-binary==3.1.9 psycopg2==2.9.6
我安装了心理学仪器
有谁能告诉我如何修复这个错误吗?!我是否应该创建文件setup.cfg,或者我是否遗漏了任何内容

a0zr77ik

a0zr77ik1#

我也有同样的问题:我相信你应该安装psycopg 2或psycopg-binary,但不是两者都安装,对于那些不熟悉它的使用和配置的人,建议使用“二进制”版本。
在这里找到这个信息:PostgreSQL Python Libraries
一旦我切换到psycopg-binary,我的站点就成功部署了。

相关问题