-
Notifications
You must be signed in to change notification settings - Fork 256
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
Errors in Pyjnius installation doc - Linux #574
Comments
The documentation is written with the assumption that you've cloned the pyjnius repository and are trying to install from there. I appreciate that this is unclear if you aren't familiar with how setup.py is normally used. The pip installation method should also be written there, there isn't any special reason it's omitted. Likewise with make, this should be run from the pyjnius directory.
This is Python 2 syntax, the documentation is out of date.
You should be able to make a pull request to the repository, is that not the case? |
I don't have experience with pull requests. I just saw that the edit icon was gray and the 'caption' said I was not allowed to edit it. Anyway...: /usr/local/lib/python3.8/dist-packages/jnius/ And why isn't it inside my 'venv' virtual environment, where I was, when I installed it? |
I mean the directory of pyjnius the software project, obtained by cloning https://github.com/kivy/pyjnius, not the python package that you have installed.
You installed it with sudo, maybe that is simply the root package directory it's set up to use. Also, don't install python packages with sudo as they can end up conflicting with system installs, use a virtualenv or |
I installed various packages into the venv a few months ago, and now I forgot everything about how to do it... Sh*t! So I guess I should do this?: $ sudo pip uninstall cython And then install them in the venv. |
Yes, that should work. |
Thank you! (venv) henrik@henrik-thinkpad-20-04:/mnt/4AF15A0435E762B4/mypython/GeoESP$ sudo pip uninstall cython Installing CORRECTLY in the 'venv' will have to wait till tomorrow... |
I am a thorough person... In Terminal, with current directory being the Python/Kivy project directory, where the 'venv' is situated and while having activated my venv I did this: $ sudo apt-get update And I tested that Pyjnius still works in PyCharm! |
👋 We use the issue tracker exclusively for bug reports and feature requests. However, this issue appears to be a support request. Please use our support channels to get help with the project. |
I interpreted this as no reason to change the documentation. If you disagree let us know (and consider a PR). |
The Pyjnius installation doc - https://pyjnius.readthedocs.io/en/stable/installation.html - contains the following - which is quite erroneous:
" You need the GNU Compiler Collection (GCC), the JDK and JRE installed (openjdk will do), and Cython. Then, just type:
sudo python setup.py install
If you want to compile the extension within the directory for any development, just type:
make
You can run the tests suite to make sure everything is running right:
make tests "
If you change "sudo python setup.py install" to the following (in Terminal), it seems to work. (In my case I did it after activating my Python 'venv'.):
sudo apt-get update
sudo pip install cython
sudo pip install pyjnius
The command "make" results in:
make: *** No targets specified and no makefile found. Stop.
The command "make tests" results in
make: *** No rule to make target 'tests'. Stop.
I have tested the installation in PyCharm using the following code. It worked!:
from jnius import autoclass
Stack = autoclass('java.util.Stack')
stack = Stack()
stack.push('hello')
stack.push('world')
print(stack.pop()) # --> 'world'
print(stack.pop()) # --> 'hello'
But why does the Quickstart doc - https://pyjnius.readthedocs.io/en/stable/quickstart.html - contain the following erroneous lines??:
print stack.pop() # --> 'world'
print stack.pop() # --> 'hello'
PS: I am not allowed to edit the documents!
The text was updated successfully, but these errors were encountered: