Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not able to install jpype in linux server #1184

Open
SIVAPRAS329 opened this issue Apr 29, 2024 · 5 comments
Open

not able to install jpype in linux server #1184

SIVAPRAS329 opened this issue Apr 29, 2024 · 5 comments

Comments

@SIVAPRAS329
Copy link

I have downloaded the jpype package from github and unzip the contents in my linux server. i am using pip3 install to install the package. however getting below error:

gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Inative/common/include -Inative/python/include -Inative/embedded/include -Inative/jni_include -I/usr/include/python3.6m -c native/common/jp_array.cpp -o build/temp.linux-x86_64-3.6/native/common/jp_array.o -g0 -std=c++11 -O2
In file included from native/common/include/jpype.h:184,
from native/common/jp_array.cpp:16:
native/python/include/jp_pythontypes.h:18:10: fatal error: Python.h: No such file or directory
#include <Python.h>
^~~~~~~~~~
compilation terminated.
error: command 'gcc' failed with exit status 1

@Thrameos
Copy link
Contributor

Thrameos commented Apr 29, 2024 via email

@SIVAPRAS329
Copy link
Author

How to install python-3 dev package in linux server. I am very much new to python and linux.

@SIVAPRAS329
Copy link
Author

I have installed python-3 dev package and now getting below error:
native/python/pyjp_array.cpp:422:1: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
};
^
error: command 'gcc' failed with exit status 1

@SIVAPRAS329
Copy link
Author

I have downloaded the jpype-master.zip package into my local desktop. copied the zip file onto linux server. Unzipped the file to /tmp/jpype-master. used the below commnad to install the package.

cd /tmp/jpype-master and then

python -m pip install -e /tmp/jpype-master

i got below error. can some one please assist me why this error came and how to resolve it . I am new to python as well as linux.

Obtaining file:///tmp/jpype-master
Installing collected packages: UNKNOWN
Running setup.py develop for UNKNOWN
Complete output from command /usr/bin/python -c "import setuptools, tokenize;file='/tmp/jpype-master/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" develop --no-deps:
running develop
error: can't create or remove files in install directory

The following error occurred while trying to add or remove files in the
installation directory:

    [Errno 13] Permission denied: '/usr/local/lib64/python3.6'

The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

    /usr/local/lib64/python3.6/site-packages/

This directory does not currently exist.  Please create it and try again, or
choose a different installation directory (using the -d or --install-dir
option).
 
----------------------------------------

Command "/usr/bin/python -c "import setuptools, tokenize;file='/tmp/jpype-master/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" develop --no-deps" failed with error code 1 in /tmp/jpype-master/

@Thrameos
Copy link
Contributor

Thrameos commented May 1, 2024

I think there may be larger problems with your python install if it is trying to compile a C++ project with a C compiler. I would recommend getting a different python build and trying again. We have seen this before that someone was releasing busted python distributions that don't compile C++.

This isn't really a JPype problem so much as bad Python installs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants