How can I install and use Apache Lucene in a python program? - lucene

Can anyone please give step-by-step procedure to install and use Apache Lucene in a python program?
My Environment:
OS: Windows 11
Python: 3.10
Python Editor: IDLE Shell 3.10.7
JDK: 1.8
I am trying to use the following code but it gives me an error:
from org.apache.lucene.analysis.standard import StandardAnalyzer, StandardTokenizer
from org.apache.lucene.analysis.tokenattributes import CharTermAttribute
Error: ModuleNotFoundError: No module named 'org'
I have already tried to install lucene as:
pip install lucene
But I am getting the following error:
Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement lucene (from versions: none)
ERROR: No matching distribution found for lucene

Related

How to install dependencies to Odoo's built-in Python?

I installed Odoo and it came with built-in Python. I want to install an auto_update plugin, which needs paramiko installed with pip to Python.
This means my problem is to install, with some pip, an add-on paramiko to Python installation of Odoo instead of default Python.
This topic - https://www.odoo.com/es_ES/forum/ayuda-1/how-to-install-an-external-python-dependency-in-windows-platform-of-odoo-170983 - gives link to https://www.cybrosys.com/blog/how-to-install-odoo-in-windows#python-dependency-odoo-windows; but first, I don't want to change my python default PATH into another one, and second, trying in virtual machine, that did not work - easy_install is not recognized as command.
I tried to run pip installation in PowerShell, which is in Odoo folder of python; I went to C:\Program Files\Odoo 16..\python\Scripts with PowerShell and ran "./pip" or "./pip3" - they gave me an error "Fatal error in launcher: Unable to create process using '"c:\odoobuild\winpy64\python-3.7.7.amd64\python.exe" "C:\Program Files\Odoo 16.0.20230110\python\Scripts\pip3.exe" ': El sistema no puede encontrar el archivo especificado.", which means it tried to use python from Odoo folder they used to build it, but my python is in Program Files with Odoo. How to run this specific pip to install addons to Odoo?
Edit:
Dealing with multiple Python versions and PIP? - this is Python question about the same topic; it gives examples about using different versions of python. When I tried something in it - running the same instance of Python with -m pip, which I wanted to upgrade, python of Odoo updates the deps of it's built-in postgresql python instead.

Error while installing selenium package in pycharm

I am getting this error while installing selenium package in pycharm
Looking in indexes: https://afeed:****#gitlab.com/api/v4/projects/33757992/packages/pypi/simple
ERROR: Could not find a version that satisfies the requirement pip==22.3.1 (from versions: none)
ERROR: No matching distribution found for pip==22.3.1
WARNING: There was an error checking the latest version of pip.
I tried to install using the command given in the screenshot but i am unable to install, I want to remove the indexes url that is there

How to solve "ERROR: No matching distribution found for tensorflow==1.12.0"

I am trying to install tensorflow 1.12.0. This is the command that I am using pip install tensorflow==1.12.0. I got this command from this link. This is the error that I am getting.
ERROR: Could not find a version that satisfies the requirement
tensorflow==1.12.0 (from versions: 2.5.0rc0, 2.5.0rc1, 2.5.0rc2,
2.5.0rc3, 2.5.0) ERROR: No matching distribution found for tensorflow==1.12.0
What am I doing wrong?
You can install previous versions of Tensorflow directly from the Github release page. For example, the 1.12.0 version can be downloaded from https://github.com/tensorflow/tensorflow/releases/tag/v1.12.0.
My python version was 3.9. Intalling python version 3.6 solved the problem. I installed it in virtual environment with conda.

Installing tensorflow with pip results in errors

I'm trying to install TensorFlow with pip, but it shows me the following output:
pip install tensorflow
Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement tensorflow
ERROR: No matching distribution found for tensorflow
I'm using Python 3.9.1 on Arch Linux.
Python 3.9 is not supported as far as I can tell: https://www.tensorflow.org/install/pip#system-requirements
You would need to use a supported version of the Python interpreter. The current supported interpreters seem to be: Python 3.5–3.8

How to utilise pymssql after Upgrading from Python 3.4 to 3.7? Unable to remove error

My Python application uses the pymssql module to connect and edit SQL data in forms. I upgraded to Python 3.7 and I receive the following error:
"DLL load failed: %1 is not a valid Win32 appication."
I have the 64bit win32 version of Python 3.7. I can't seem to resolve this. Does pymssql work with Python 3.7?
I uninstalled and reinstalled both Python and pymssql to ensure I have latest version.
The fix was to completely unisntall Python 3.7 and pip, then delete the Python folder, and reinstall. I used the advanced install settings which puts Python in C:\Program Files. The only difference now is I need admin permissions to pip install/update etc but that's ok.