首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法使用opam安装ctype

问无法使用opam安装ctype
EN

Stack Overflow用户
提问于 2016-05-07 07:40:01
回答 3查看 691关注 0票数 3

我希望在我的Ubuntu 14.04计算机上安装ctype。我正在尝试使用opam来完成此操作,但失败了。这是我得到的回应:

代码语言:javascript
复制
opam install ctypes
The following actions will be performed:
  ∗  install conf-ncurses 1                   [required by ocamlfind]
  ∗  install ocamlfind    1.6.2               [required by ctypes]
  ∗  install base-bytes   base                [required by ctypes]
  ∗  install ctypes       0.5.1
===== ∗  4 =====
Do you want to continue ? [Y/n] Y

=-=- Gathering sources =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

[ctypes] Archive in cache
[ocamlfind] Archive in cache

=-=- Processing actions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[ERROR] The compilation of conf-ncurses failed at "pkg-config ncurses".

#=== ERROR while installing conf-ncurses.1 ====================================#
# opam-version 1.2.2
# os           linux
# command      pkg-config ncurses
# path         ~/.opam/4.02.1/build/conf-ncurses.1
# compiler     4.02.1
# exit-code    1
# env-file     ~/.opam/4.02.1/build/conf-ncurses.1/conf-ncurses-3089-ccabea.env
# stdout-file  ~/.opam/4.02.1/build/conf-ncurses.1/conf-ncurses-3089-ccabea.out
# stderr-file  ~/.opam/4.02.1/build/conf-ncurses.1/conf-ncurses-3089-ccabea.err



=-=- Error report -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
The following actions were aborted
  ∗  install base-bytes base 
  ∗  install ctypes     0.5.1
  ∗  install ocamlfind  1.6.2
The following actions failed
  ∗  install conf-ncurses 1
No changes have been performed

=-=- conf-ncurses.1 troobleshooting -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
=> This package relies on external (system) dependencies that may be missing. `opam depext conf-ncurses.1' may help you find the correct installation for your system.

我已经安装了依赖项,但仍然无法安装ncurses。

代码语言:javascript
复制
~$ opam depext conf-ncurses.1
# Detecting depexts using flags: x86_64 linux ubuntu
# The following system packages are needed:
#  - ncurses-dev
#  - pkg-config
# The following new OS packages need to be installed: ncurses-dev
Not running as root, the following command will be run through "sudo":
    apt-get install -qq -yy ncurses-dev
[sudo] password for ask: 
# OS packages installation successful

我想知道为什么我会遇到这些问题,ncurses-dev和pkg-config已经安装在我的系统上了。

关于执行Tobias的建议的更新:-

代码语言:javascript
复制
# Detecting depexts using flags: x86_64 linux ubuntu
# The following system packages are needed:
#  - m4
#  - ncurses-dev
#  - pkg-config
# The following new OS packages need to be installed: ncurses-dev
Not running as root, the following command will be run through "sudo":
    apt-get install -qq -yy ncurses-dev
# OS packages installation successful
The following actions will be performed:
  ∗  install conf-pkg-config 1.0              [required by ctypes]
  ∗  install conf-m4         1                [required by ocamlfind]
  ∗  install conf-ncurses    1                [required by ocamlfind]
  ∗  install ocamlfind       1.6.2            [required by ctypes]
  ∗  install base-bytes      base             [required by ctypes]
  ∗  install ctypes          0.5.1
===== ∗  6 =====
Do you want to continue ? [Y/n] Y

=-=- Gathering sources =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[ctypes] Archive in cache
[ocamlfind] Archive in cache

=-=- Processing actions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
∗  installed conf-pkg-config.1.0
∗  installed conf-m4.1
[ERROR] The compilation of conf-ncurses failed at "pkg-config ncurses".

#=== ERROR while installing conf-ncurses.1 ====================================#
# opam-version 1.2.2
# os           linux
# command      pkg-config ncurses
# path         ~/.opam/4.03.0/build/conf-ncurses.1
# compiler     4.03.0
# exit-code    1
# env-file     ~/.opam/4.03.0/build/conf-ncurses.1/conf-ncurses-10261-9b8556.env
# stdout-file  ~/.opam/4.03.0/build/conf-ncurses.1/conf-ncurses-10261-9b8556.out
# stderr-file  ~/.opam/4.03.0/build/conf-ncurses.1/conf-ncurses-10261-9b8556.err



=-=- Error report -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
The following actions were aborted
  ∗  install base-bytes base 
  ∗  install ctypes     0.5.1
  ∗  install ocamlfind  1.6.2
The following actions failed
  ∗  install conf-ncurses 1
The following changes have been performed
  ∗  install conf-m4         1  
  ∗  install conf-pkg-config 1.0

=-=- conf-ncurses.1 troobleshooting -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
=> This package relies on external (system) dependencies that may be missing.
   `opam depext conf-ncurses.1' may help you find the correct installation for
   your system.

The former state can be restored with:
    opam switch import "~/.opam/4.03.0/backup/state-20160410155208.export"

错误文件中仍然没有文本。

谢谢。

EN

回答 3

Stack Overflow用户

发布于 2016-05-08 03:44:20

当您处理此类错误时,您可以通过查看opam指出的错误文件中的所有错误来获得更多详细信息,该文件如下:

代码语言:javascript
复制
cat /home/ask/.opam/4.02.1/build/conf-ncurses.1/conf-ncurses-3089-ccabea.err

请注意,这里也有经典输出:

代码语言:javascript
复制
cat /home/ask/.opam/4.02.1/build/conf-ncurses.1/conf-ncurses-3089-ccabea.out

您可能有其他信息可供您结束安装。有时,在depext命令中会忘记一些deps。

附言:我在这里写是因为我没有足够的名气来要求评论的准确性

票数 1
EN

Stack Overflow用户

发布于 2016-05-11 15:30:53

尝试以下操作:

代码语言:javascript
复制
$ apt-get install libncurses5-dev
$ pkg-config --print-provides ncurses

验证ncurses和pkg-config是否已安装并正常工作。

进一步的诊断:

代码语言:javascript
复制
$ dpkg-query -L libncurses5-dev | grep pc$

# results for my machine
/usr/lib/x86_64-linux-gnu/pkgconfig/form.pc
/usr/lib/x86_64-linux-gnu/pkgconfig/ncurses++.pc
/usr/lib/x86_64-linux-gnu/pkgconfig/panel.pc
/usr/lib/x86_64-linux-gnu/pkgconfig/ncurses.pc
/usr/lib/x86_64-linux-gnu/pkgconfig/menu.pc

$ pkg-config --variable pc_path pkg-config

# results for my machine
/usr/local/lib/x86_64-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig

请注意,libncurses5-dev已将其ncurses.pc文件安装在pkg-config默认搜索路径下的目录中。

如果您的系统不是这样,请尝试将$PKG_CONFIG_PATH显式设置为指向libncurses5-dev安装ncurses.pc的位置。(还要检查文件是否确实存在!)

这个讨论可能也会有帮助:https://askubuntu.com/questions/210210/pkg-config-path-environment-variable/373217

票数 0
EN

Stack Overflow用户

发布于 2016-08-09 18:52:14

如果我在系统中添加

代码语言:javascript
复制
export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig/

然后执行

代码语言:javascript
复制
opam install conf-ncurses

它起作用了

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/37082880

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档