当前位置: 首页 > 知识库问答 >
问题:

在Mac OS 10.14.2上的Python 3.7中安装JPype1时出错

华英睿
2023-03-14

我在系统中安装JPype1时出错。我使用的是Python 3.7。Jaydebeapi需要JPype1作为依赖项。

pip install Jpype1

以下是错误消息:


    Collecting jpype1
    Using cached 
    https://files.pythonhosted.org/packages/c4/4b/60a3e63d51714d4d7ef1b1efdf84315d118a0a80a5b085bb52a7e2428cdc/JPype1-0.6.3.tar.gz
    Building wheels for collected packages: jpype1
      Running setup.py bdist_wheel for jpype1 ... error
      Complete output from command /Users/citius/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/kw/ykkdj1vn7qj_2hms02xmtz6h0000gn/T/pip-install-1rreficl/jpype1/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /private/var/folders/kw/ykkdj1vn7qj_2hms02xmtz6h0000gn/T/pip-wheel-swsvni4l --python-tag cp36:
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.macosx-10.7-x86_64-3.6
      creating build/lib.macosx-10.7-x86_64-3.6/jpype
      copying jpype/_jcollection.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
      copying jpype/_classpath.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
      copying jpype/_jio.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
      copying jpype/_pykeywords.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
      copying jpype/_jproxy.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
      copying jpype/_gui.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
      copying jpype/_darwin.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
      copying jpype/nio.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
      copying jpype/_cygwin.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
      copying jpype/_properties.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
      copying jpype/__init__.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
      copying jpype/_refdaemon.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
      copying jpype/_jboxed.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
      copying jpype/JClassUtil.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
      copying jpype/_jvmfinder.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
      copying jpype/imports.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
      copying jpype/_core.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
      copying jpype/_linux.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
      copying jpype/_jarray.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
      copying jpype/_jobject.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
      copying jpype/_jclass.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
      copying jpype/_windows.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
      copying jpype/_jwrapper.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
      copying jpype/_jexception.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
      copying jpype/reflect.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
      copying jpype/_jpackage.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
      creating build/lib.macosx-10.7-x86_64-3.6/jpype/awt
      copying jpype/awt/__init__.py -> build/lib.macosx-10.7-x86_64-3.6/jpype/awt
      creating build/lib.macosx-10.7-x86_64-3.6/jpype/awt/event
      copying jpype/awt/event/__init__.py -> build/lib.macosx-10.7-x86_64-3.6/jpype/awt/event
      copying jpype/awt/event/WindowAdapter.py -> build/lib.macosx-10.7-x86_64-3.6/jpype/awt/event
      creating build/lib.macosx-10.7-x86_64-3.6/jpypex
      copying jpypex/__init__.py -> build/lib.macosx-10.7-x86_64-3.6/jpypex
      creating build/lib.macosx-10.7-x86_64-3.6/jpypex/swing
      copying jpypex/swing/AbstractAction.py -> build/lib.macosx-10.7-x86_64-3.6/jpypex/swing
      copying jpypex/swing/__init__.py -> build/lib.macosx-10.7-x86_64-3.6/jpypex/swing
      copying jpypex/swing/pyutils.py -> build/lib.macosx-10.7-x86_64-3.6/jpypex/swing
      running build_ext
      /private/var/folders/kw/ykkdj1vn7qj_2hms02xmtz6h0000gn/T/pip-install-1rreficl/jpype1/setup.py:173: FeatureNotice: Turned ON Numpy support for fast Java array access
        FeatureNotice)
      building '_jpype' extension
      creating build/temp.macosx-10.7-x86_64-3.6
      creating build/temp.macosx-10.7-x86_64-3.6/native
      creating build/temp.macosx-10.7-x86_64-3.6/native/python
      creating build/temp.macosx-10.7-x86_64-3.6/native/common
      gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Users/citius/anaconda3/include -arch x86_64 -I/Users/citius/anaconda3/include -arch x86_64 -DMACOSX=1 -DHAVE_NUMPY=1 -Inative/common/include -Inative/python/include -Inative/jni_include -I/Users/citius/anaconda3/lib/python3.6/site-packages/numpy/core/include -I/Users/citius/anaconda3/include/python3.6m -c native/python/jpype_python.cpp -o build/temp.macosx-10.7-x86_64-3.6/native/python/jpype_python.o -ggdb
      In file included from /Users/citius/anaconda3/lib/gcc/x86_64-apple-darwin11.4.2/4.8.5/include-fixed/syslimits.h:7:0,
                       from /Users/citius/anaconda3/lib/gcc/x86_64-apple-darwin11.4.2/4.8.5/include-fixed/limits.h:34,
                       from /Users/citius/anaconda3/include/python3.6m/Python.h:11,
                       from native/python/include/jpype_python.h:23,
                       from native/python/jpype_python.cpp:19:
      /Users/citius/anaconda3/lib/gcc/x86_64-apple-darwin11.4.2/4.8.5/include-fixed/limits.h:168:61: fatal error: limits.h: No such file or directory
       #include_next   /* recurse down to the real one */
                                                                   ^
      compilation terminated.
      error: command 'gcc' failed with exit status 1

      ----------------------------------------
      Failed building wheel for jpype1
      Running setup.py clean for jpype1
    Failed to build jpype1
    Installing collected packages: jpype1
      Running setup.py install for jpype1 ... error
        Complete output from command /Users/citius/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/kw/ykkdj1vn7qj_2hms02xmtz6h0000gn/T/pip-install-1rreficl/jpype1/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/kw/ykkdj1vn7qj_2hms02xmtz6h0000gn/T/pip-record-3pg5yd08/install-record.txt --single-version-externally-managed --compile:
        running install
        running build
        running build_py
        creating build
        creating build/lib.macosx-10.7-x86_64-3.6
        creating build/lib.macosx-10.7-x86_64-3.6/jpype
        copying jpype/_jcollection.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
        copying jpype/_classpath.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
        copying jpype/_jio.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
        copying jpype/_pykeywords.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
        copying jpype/_jproxy.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
        copying jpype/_gui.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
        copying jpype/_darwin.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
        copying jpype/nio.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
        copying jpype/_cygwin.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
        copying jpype/_properties.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
        copying jpype/__init__.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
        copying jpype/_refdaemon.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
        copying jpype/_jboxed.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
        copying jpype/JClassUtil.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
        copying jpype/_jvmfinder.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
        copying jpype/imports.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
        copying jpype/_core.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
        copying jpype/_linux.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
        copying jpype/_jarray.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
        copying jpype/_jobject.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
        copying jpype/_jclass.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
        copying jpype/_windows.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
        copying jpype/_jwrapper.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
        copying jpype/_jexception.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
        copying jpype/reflect.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
        copying jpype/_jpackage.py -> build/lib.macosx-10.7-x86_64-3.6/jpype
        creating build/lib.macosx-10.7-x86_64-3.6/jpype/awt
        copying jpype/awt/__init__.py -> build/lib.macosx-10.7-x86_64-3.6/jpype/awt
        creating build/lib.macosx-10.7-x86_64-3.6/jpype/awt/event
        copying jpype/awt/event/__init__.py -> build/lib.macosx-10.7-x86_64-3.6/jpype/awt/event
        copying jpype/awt/event/WindowAdapter.py -> build/lib.macosx-10.7-x86_64-3.6/jpype/awt/event
        creating build/lib.macosx-10.7-x86_64-3.6/jpypex
        copying jpypex/__init__.py -> build/lib.macosx-10.7-x86_64-3.6/jpypex
        creating build/lib.macosx-10.7-x86_64-3.6/jpypex/swing
        copying jpypex/swing/AbstractAction.py -> build/lib.macosx-10.7-x86_64-3.6/jpypex/swing
        copying jpypex/swing/__init__.py -> build/lib.macosx-10.7-x86_64-3.6/jpypex/swing
        copying jpypex/swing/pyutils.py -> build/lib.macosx-10.7-x86_64-3.6/jpypex/swing
        running build_ext
        /private/var/folders/kw/ykkdj1vn7qj_2hms02xmtz6h0000gn/T/pip-install-1rreficl/jpype1/setup.py:173: FeatureNotice: Turned ON Numpy support for fast Java array access
          FeatureNotice)
        building '_jpype' extension
        creating build/temp.macosx-10.7-x86_64-3.6
        creating build/temp.macosx-10.7-x86_64-3.6/native
        creating build/temp.macosx-10.7-x86_64-3.6/native/python
        creating build/temp.macosx-10.7-x86_64-3.6/native/common
        gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Users/citius/anaconda3/include -arch x86_64 -I/Users/citius/anaconda3/include -arch x86_64 -DMACOSX=1 -DHAVE_NUMPY=1 -Inative/common/include -Inative/python/include -Inative/jni_include -I/Users/citius/anaconda3/lib/python3.6/site-packages/numpy/core/include -I/Users/citius/anaconda3/include/python3.6m -c native/python/jpype_python.cpp -o build/temp.macosx-10.7-x86_64-3.6/native/python/jpype_python.o -ggdb
        In file included from /Users/citius/anaconda3/lib/gcc/x86_64-apple-darwin11.4.2/4.8.5/include-fixed/syslimits.h:7:0,
                         from /Users/citius/anaconda3/lib/gcc/x86_64-apple-darwin11.4.2/4.8.5/include-fixed/limits.h:34,
                         from /Users/citius/anaconda3/include/python3.6m/Python.h:11,
                         from native/python/include/jpype_python.h:23,
                         from native/python/jpype_python.cpp:19:
        /Users/citius/anaconda3/lib/gcc/x86_64-apple-darwin11.4.2/4.8.5/include-fixed/limits.h:168:61: fatal error: limits.h: No such file or directory
         #include_next   /* recurse down to the real one */
                                                                     ^
        compilation terminated.
        error: command 'gcc' failed with exit status 1

        ----------------------------------------
    Command "/Users/citius/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/kw/ykkdj1vn7qj_2hms02xmtz6h0000gn/T/pip-install-1rreficl/jpype1/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/kw/ykkdj1vn7qj_2hms02xmtz6h0000gn/T/pip-record-3pg5yd08/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/kw/ykkdj1vn7qj_2hms02xmtz6h0000gn/T/pip-install-1rreficl/jpype1/

共有2个答案

江航
2023-03-14

对于Amazon Linux或其他基于RedHat的:

< code > dnf install red hat-rpm-config gcc-c python 3-devel unixODBC-devel

壤驷敏学
2023-03-14

首先使用conda安装gcc

conda install gcc

然后对jpype1使用二进制安装。从康达-福吉软件频道安装。

conda install -c conda-forge jpype1

它对我有用。

它也适用于Python2.7

 类似资料:
  • 编辑18/02:因为我仍然没有解决方案,我正在更新我目前所知道的。 我已经成功安装了python 3.7。我可以使用pip(或pip3)安装模块,但这些模块是在Python3.6(ubuntu附带)中安装的。因此,我无法在Python3.7中导入这些模块(找不到模块)。Python3.7无法识别pip/pip3,因此我无法通过pip/pip3进行安装。我需要Python3.7 -- 我已经在我的U

  • 当我尝试在ubuntu上安装Yeoman时,我得到了以下错误。 编辑 尝试MortezaLSC的解决方案后-我得到以下错误

  • HTTP请求已发送,正在等待响应...404找不到2018-07-18 14:49:48错误404:找不到。

  • 问题内容: 我一直在尝试在Catalina的Mac上安装PyGame,但不知道该如何做。我得到的错误消息是:SystemExit:错误:命令’gcc’失败,退出状态为1。与python设置不正确有关吗?我已经尝试了多种安装软件包的方法,但是每当我运行setup.py时,它都会显示错误消息。我可以将pygame文件夹移到某个地方,使其成为python模块的一部分吗?您的帮助将不胜感激!这是错误消息:

  • 我试图安装Android ADT的Eclipse从http://developer.android.com/sdk/installing/installing-adt.html 并得到以下错误: 如果有帮助的话,我正在运行windows8.1并使用最新版本的Eclipse。非常感谢。

  • 问题内容: Node和npm均已安装并且是最新的,但是在尝试安装coffeescript时始终出现此错误。我还是编程新手,所以任何建议都将不胜感激。 问题答案: 错误消息非常清楚: 您没有必要的权限,因此无法安装。尝试使用: npm作者建议不要使用,因为软件包可以运行任意命令,因此很危险。他建议将的所有权切换到您的用户。我认为这是一种可怕的建议,只会给您一种错误的安全感:如果一个程序包可以运行任意