如何解决 CPanite 上的 psycopg2 和枕头安装问题(

how to solve the psycopg2 and pillow installation problem on cpanel (

提问人:Roy Akany 提问时间:11/15/2023 更新时间:11/15/2023 访问量:26

问:

几个小时以来,我一直在尝试在 lws 的 cpanel 上部署我的 django 项目,我创建了一个 python 应用程序并激活了虚拟环境,但是一旦我尝试安装依赖项,我就收到一个错误

 error: subprocess-exited-with-error

  × Building wheel for Pillow (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [143 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-39
      creating build/lib.linux-x86_64-cpython-39/PIL
      copying src/PIL/BlpImagePlugin.py -> build/lib.linux-x86_64-cpython-39/PIL
      copying src/PIL/ImageFilter.py -> build/lib.linux-x86_64-cpython-39/PIL
      copying src/PIL/SpiderImagePlugin.py -> build/lib.linux-x86_64-cpython-39/PIL
      copying src/PIL/ImageGrab.py -> build/lib.linux-x86_64-cpython-39/PIL
      copying src/PIL/GimpPaletteFile.py -> build/lib.linux-x86_64-cpython-39/PIL
      copying src/PIL/FpxImagePlugin.py -> build/lib.linux-x86_64-cpython-39/PIL
      copying src/PIL/DdsImagePlugin.py -> build/lib.linux-x86_64-cpython-39/PIL
      copying src/PIL/XpmImagePlugin.py -> build/lib.linux-x86_64-cpython-39/PIL
      running egg_info
      writing src/Pillow.egg-info/PKG-INFO
      writing dependency_links to src/Pillow.egg-info/dependency_links.txt
      writing requirements to src/Pillow.egg-info/requires.txt
      writing top-level names to src/Pillow.egg-info/top_level.txt
      reading manifest file 'src/Pillow.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      warning: no files found matching '*.c'
      warning: no files found matching '*.h'
      warning: no files found matching '*.sh'
      writing manifest file 'src/Pillow.egg-info/SOURCES.txt'
      running build_ext
      building 'PIL._imaging' extension
      creating build/temp.linux-x86_64-cpython-39/src/Tk
declaration -fPIC -DHAVE_LIBJPEG -DHAVE_LIBZ -DHAVE_LIBTIFF-DHAVE_XCB -DPILLOW_VERSION=\"10.0.1\" -I/usr/include/freetype2 -I/usr/include -I/home/uloyxtlb/virtualenv/core/Ulc_loyola_core/3.9/include -I/opt/alt/python39/include/python3.9 -c src/_imaging.c -o build/temp.linux-x86_64-cpython-39/src/_imaging.o
      error: command '/usr/bin/gcc' failed: Permission denied
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for Pillow
  Building wheel for psycopg2-binary (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [33 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-39
      creating build/lib.linux-x86_64-cpython-39/psycopg2
      copying lib/extras.py -> build/lib.linux-x86_64-cpython-39/psycopg2
      copying lib/_json.py -> build/lib.linux-x86_64-cpython-39/psycopg2
      copying lib/__init__.py -> build/lib.linux-x86_64-cpython-39/psycopg2
      copying lib/_range.py -> build/lib.linux-x86_64-cpython-39/psycopg2
      copying lib/_ipaddress.py -> build/lib.linux-x86_64-cpython-39/psycopg2
      copying lib/sql.py -> build/lib.linux-x86_64-cpython-39/psycopg2
      copying lib/errors.py -> build/lib.linux-x86_64-cpython-39/psycopg2
      copying lib/tz.py -> build/lib.linux-x86_64-cpython-39/psycopg2
      copying lib/pool.py -> build/lib.linux-x86_64-cpython-39/psycopg2
      copying lib/extensions.py -> build/lib.linux-x86_64-cpython-39/psycopg2
      copying lib/errorcodes.py -> build/lib.linux-x86_64-cpython-39/psycopg2
      running build_ext
      building 'psycopg2._psycopg' extension
      creating build/temp.linux-x86_64-cpython-39
      creating build/temp.linux-x86_64-cpython-39/psycopg
      gcc -Wno-unused-result -Wsign-compare -DNDEBUG -D_GNU_SOURCE -fPIC -fwrapv -O2 -pthread -Wno-ext)" -DPSYCOPG_DEBUG=1 -DPG_VERSION_NUM=80420 -DPSYCOPG_DEBUG=1 -I/home/uloyxtlb/virtualenv/core/Ulc_loyola_core/3.9/include -I/opt/alt/python39/include/python3.9 -I. -I/usr/include -I/usr/include/pgsql/server -I/usr/include/libxml2 -c psycopg/adapter_asis.c -o build/temp.linux-x86_64-cpython-39/psycopg/adapter_asis.o -Wdeclaration-after-statement

      It appears you are missing some prerequisite to build the package from source.

      You may install a binary package by installing 'psycopg2-binary' from PyPI.
      If you want to install psycopg2 from source, please install the packages
      required for the build and try again.

      For further information please check the 'doc/src/install.rst' file (also at
      <https://www.psycopg.org/docs/install.html>).

      error: command '/usr/bin/gcc' failed: Permission denied
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for psycopg2-binary
  Running setup.py clean for psycopg2-binary
Failed to build Pillow psycopg2-binary
ERROR: Could not build wheels for Pillow, psycopg2-binary, which is required to install pyproject.toml-based projec


我尝试安装 psycog2-binary 和一些 sudo 命令,但没有一个有效,
找不到所有 sudo 命令
sudo apt-get install libpq-dev or sudo yum install postgresql-devel

蟒蛇 django python-imaging-library cpanel psycopg2

评论

0赞 AKX 11/15/2023
“在 LWS 的 cPanel 上”?
0赞 Roy Akany 11/16/2023
AKX:是的,它是 lws cpanel
0赞 snakecharmerb 11/16/2023
看起来您需要root权限才能安装此软件,但您没有这些权限。您可以通过创建虚拟环境并在其中安装您的要求来解决此问题。否则,您将需要请求服务器管理员授予您所需的权限,或为您安装要求。
0赞 AKX 11/16/2023
什么是“lws cpanel”?

答: 暂无答案