How to use or install pycocoevalcap? - python

I'm new to use coco Datasets .. i got this error
# this requires the coco package, Link
from pycocoevalcap.bleu.bleu import Bleu
from pycocoevalcap.rouge.rouge import Rouge
from pycocoevalcap.cider.cider import Cider
ModuleNotFoundError: No module named 'pycocoevalcap'
i downloaded coco package with the given Link and tried to use pip3 install pycocoevalcap
but got
ERROR: Could not find a version that satisfies the requirement pycocoevalcap (from versions: none)
ERROR: No matching distribution found for pycocoevalcap
How can i fix it

So I used this command:
pip install "git+https://github.com/salaniz/pycocoevalcap.git"
and it returned
Collecting git+https://github.com/salaniz/pycocoevalcap.git
Cloning https://github.com/salaniz/pycocoevalcap.git to /tmp/pip-req-build-3u0sbfzy
Running command git clone -q https://github.com/salaniz/pycocoevalcap.git /tmp/pip-req-build-3u0sbfzy
Collecting pycocotools>=2.0.0
...
Successfully built pycocoevalcap pycocotools
Installing collected packages: cython, pycocotools, pycocoevalcap.
Successfully installed cython-0.29.20 pycocoevalcap-1.1 pycocotools-2.0.1

Related

Problem getting python to "find" the pyglet module

I am learning python via a Great Course lecture series, and in the second half of the course need to install the pyglet module. Although I have (apparently) downloaded the module successfully, my PyCharm IDE is not able to locate it, so my .py program with the instruction "import pyglet" generates the following error:
"C:\Users\the_m\PycharmProjects\Program 1\venv\Scripts\python.exe" "C:\Users\the_m\PycharmProjects\Program 1\basketball.py"
Traceback (most recent call last):
File "C:\Users\the_m\PycharmProjects\Program 1\basketball.py", line 1, in <module>
import pyglet
ModuleNotFoundError: No module named 'pyglet'
I am really enjoying the course, and enjoying getting back to coding after a multi-decade hiatus. I am working on a PC. Can anyone suggest a solution?
file locations for python and what I think are the pyglet module are as follows:
C:\Users\the_m>py -m pip --version
pip 23.0 from C:\Users\the_m\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip (python 3.11)
C:\Users\the_m>py -m pip install --upgrade pip setuptools wheel
Requirement already satisfied: pip in c:\users\the_m\appdata\local\programs\python\python311\lib\site-packages (23.0)
Requirement already satisfied: setuptools in c:\users\the_m\appdata\local\programs\python\python311\lib\site-packages (65.5.0)
Collecting setuptools
Downloading setuptools-67.2.0-py3-none-any.whl (1.1 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.1/1.1 MB 607.4 kB/s eta 0:00:00
Collecting wheel
Downloading wheel-0.38.4-py3-none-any.whl (36 kB)
Installing collected packages: wheel, setuptools
WARNING: The script wheel.exe is installed in 'C:\Users\the_m\AppData\Local\Programs\Python\Python311\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Attempting uninstall: setuptools
Found existing installation: setuptools 65.5.0
Uninstalling setuptools-65.5.0:
Successfully uninstalled setuptools-65.5.0
Successfully installed setuptools-67.2.0 wheel-0.38.4

Trying to install Calendar.py

How can I get the library for calendar.py? I'm new to this.
I tried installing it and got the following error...
pip3 install calendar.py
Collecting calendar.py
Could not find a version that satisfies the requirement calendar.py (from versions: )
No matching distribution found for calendar.py
You don't install this module at all. It's part of the standard lib. Do you get an error when you try import calendar

How to pip install from a private artifactory?

A private artifactory is available. We pushed a Python lib into it using Twine:
/python-XYZ/mylib/version/mylib-version.tar.gz
However, I do not understand how we can get this library using pip install.
I have tried the following (based on this):
pip install mylib==version --index 'https://myuser:mypassword#XYZ-DOMAIN.fr:443/artifactory/api/pypi/python-XYZ/simple
Which gives this:
ERROR: Could not find a version that satisfies the requirement mylib==version (from versions: none)
ERROR: No matching distribution found for mylib==version
The result is the same with the following endpoints:
/artifactory/api/pypi/python-XYZ/mylib/simple
/artifactory/api/pypi/mylib/simple
/artifactory/api/pypi/python-XYZ/simple
Given the location of my library, how can I pip install it ?
After some digging, here is what it should be in my case.
pip install mylib==version --index-url 'https://USERPWD#XYZ-DOMAIN.fr:443/artifactory/api/pypi/python/simple' --trusted-host=XYZ-DOMAIN.fr

Is gpt-2 unusable with python?

I was following this tutorial and ran across an issue while using train.py. the issue says
Exception has occurred: ModuleNotFoundError
No module named 'tensorflow.contrib'
File "F:\PythonFiles\Post Generator\gpt-2\src\model.py", line 3, in <module>
from tensorflow.contrib.training import HParams
I searched a lot on the internet and it turns out that tensorflow.contrib has been depreceated. So is there an alternate way to do so or the gpt-2 is not usable with python?
I also tried
pip install tensorflow==1.15
ERROR: Could not find a version that satisfies the requirement tensorflow==1.15 (from versions: 2.2.0rc1, 2.2.0rc2, 2.2.0rc3, 2.2.0rc4, 2.2.0)
ERROR: No matching distribution found for tensorflow==1.15
try this :
pip install tensorflow-gpu==1.15.0
pip install 'tensorflow-estimator<1.15.0rc0,>=1.14.0rc0' --force-reinstall

Cannot install python packages thorugh PyPi in Azure Databricks

I want to call a webservice from a Databricks Notebook through Python. The needed library for this seems to be http.client.
I have already found a code snippet to test this but when i try to execute it i get the following error:
ImportError: No module named http.client
This is correct cause i have no module installed yet.
In the next step i go to a folder within my Databricks, select Import -> Import Notebooks dialog click on (To import a library, such as a jar or egg, click here) -> Select in the Language DropDown Upload Python Egg or PyPI -> in pyPI name typehttp.client` and click on Install Library.
Then i select Attach automatically to all clusters.
I receive the following error:
Error: java.lang.RuntimeException: Installation failed with message:
Collecting http.client Collecting http.client Could not find a version
that satisfies the requirement http.client (from versions: ) No
matching distribution found for http.client You are using pip version
9.0.1, however version 18.0 is available. You should consider upgrading via the 'pip install --upgrade pip' command. Could not find
a version that satisfies the requirement http.client (from versions: )
No matching distribution found for http.client You are using pip
version 9.0.1, however version 18.0 is available. You should consider
upgrading via the 'pip install --upgrade pip' command.
How can i fix this?
Can you import httplib, it must resolve the issue

Categories

Resources