pip show and help("modules") don't agree - python

I am trying to install a company-internal package "algo_flows".
pip show algo_flows shows it
(py37) noam#9cae2d848b93:~$ pip show algo_flows
Name: algo-flows
Version: 1.0.0.dev36
Summary: UNKNOWN
Home-page: UNKNOWN
Author:
Author-email:
License: UNKNOWN
Location: /home/noam/.local/lib/python3.7/site-packages
Requires: anomalib, datetime, fastapi, matplotlib, ml-distillery, numpy, opencv-python, overrides, pydantic, pytest, pytest-dependency, pytest-order, pyyaml, torch, torchvision, uv-python-utils
Required-by: inspection-manager
but it can't be imported, and is not shown via help("modules")
There is no way I can create a reproducible of this, I have no idea what could cause this.
How can I debug it? pip install seems to work fine!

Related

What's means undefined symbol: cublasLtHSHMatmulAlgoInit, version libcublasLt.so.11

I am using SpaCy and SpaCy Stanza in Jupyter notebook with python 3, and I get the following error
OSError: /opt/conda/lib/python3.7/site-packages/torch/lib/../../nvidia/cublas/lib/libcublas.so.11: undefined symbol: cublasLtHSHMatmulAlgoInit, version libcublasLt.so.11
can anybody help me?
I tried update
pip install --user nvidia-pyindexpip install --user nvidia-tensorflow
but the error remains, How can I fix it?
I fix this error by adding the directory into LD_LIBRARY_PATH environment variable.
Like this:
export LD_LIBRARY_PATH=/opt/conda/lib/python3.9/site-packages/nvidia/cublas/lib/:$LD_LIBRARY_PATH
Hope this helps.
You can find your path by
pip show nvidia-cudnn
then
Name: nvidia-cudnn
Version: 8.2.0.51
Summary: cuDNN runtime libraries
Home-page: https://developer.nvidia.com/cuda-zone
Author: Nvidia CUDA Installer Team
Author-email: cuda_installer#nvidia.com
License: NVIDIA Proprietary Software
Location: /home/yourname/.local/lib/python3.8/site-packages
Requires: wheel, setuptools
Required-by: nvidia-tensorrt
Location: shown where your package installed.
In this case,adding following path to LD_LIBRARY_PATH solve my problem
/home/yourname/.local/lib/python3.8/site-packages/nvidia/cublas/lib/

Is there a way to generate description of libraries in Python requirement.txt

I am trying to understand an existing big python project which has lot of dependencies listed in requirement.txt. I like to understand what each libraries is meant for.
If there is a way to generate a short description given by them from pypi.org or other sources, that would greatly help.
For example:
#requirement.txt
gluonts
aiohttp
Expected outcome:
gluonts | GluonTS is a Python toolkit for probabilistic time series modeling
aiohttp | Async http client/server framework
Is there a tool (command line / online) that can provide descriptive insights on python dependencies ?
It is possible to get a description of packages installed using pip.
pip show [options] <package>
For example
pip show requests
Name: requests
Version: 2.25.1
Summary: Python HTTP for Humans.
Home-page: https://requests.readthedocs.io
Author: Kenneth Reitz
Author-email: me#kennethreitz.org
License: Apache 2.0
Location: ..\programs\python\python38\lib\site-packages
Requires: urllib3, certifi, chardet, idna
Required-by:
You can use the summary field as a description. This of course relies upon the author having provided a sufficiently clear description.
You can do this inside a python script using the following
from pip._internal import main as pipmain
description = pipmain(['show','requests'])
If you have those packages installed you can use pip show <package-name>. For example:
$ pip show aiohttp
Name: aiohttp
Version: 3.7.3
Summary: Async http client/server framework (asyncio)
Home-page: https://github.com/aio-libs/aiohttp
Author: Nikolay Kim
Author-email: fafhrd91#gmail.com
License: Apache 2
Location: /home/jack/repo/global-search-ingestion/global_search_lib/.venv/lib/python3.8/site-packages
Requires: typing-extensions, yarl, async-timeout, chardet, attrs, multidict
Required-by: faust, aiohttp-cors
To run this over your requirements.txt, you can use cut and xargs
pip show $(cat requirements.txt | cut -d "=" -f 1 | xargs)
And this will list out metadata for each library in you requirements.txt.

Check and run correct Tensorflow Version (v2.0)

i was using the previous version of tensorflow, but i wanna use tensorflow 2.0.0 alpha and i've installed it with pip using
pip install tensorflow==2.0.0-alpha0
than i run the simple code to check what version
import tensorflow as tf
print(tf.__version__)
but this is the result:
1.13.0-rc1
so i check with pip
pip3 show tensorflow
and i got:
Name: tensorflow
Version: 2.0.0a0
Summary: TensorFlow is an open source machine learning framework for
everyone.
Home-page: https://www.tensorflow.org/
Author: Google Inc.
Author-email: packages#tensorflow.org
License: Apache 2.0
Location:
c:\users\massimo\appdata\local\programs\python\python37\lib\site-packages
Requires: gast, six, protobuf, google-pasta, absl-py, astor, tb-nightly,
termcolor, grpcio, keras-applications, keras-preprocessing, tf-estimator-
nightly, wheel, numpy
Required-by:
is there something wrong? i'm expecting with tf.version something like 2.0.0
what i'm missing?
Thank you all
Max
UPDATE
while the command
python -m site
sys.path = [
'C:\\Users\\Massimo\\AppVisualCode',
'C:\\Users\\Massimo\\AppData\\Local\\Programs\\Python\\Python37\\python37.
zip',
'C:\\Users\\Massimo\\AppData\\Local\\Programs\\Python\\Python37\\DLLs',
'C:\\Users\\Massimo\\AppData\\Local\\Programs\\Python\\Python37\\lib',
'C:\\Users\\Massimo\\AppData\\Local\\Programs\\Python\\Python37',
'C:\\Users\\Massimo\\AppData\\Roaming\\Python\\Python37\\site-packages',
'C:\\Users\\Massimo\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-
packages',
]
USER_BASE: 'C:\\Users\\Massimo\\AppData\\Roaming\\Python' (exists)
USER_SITE:
'C:\\Users\\Massimo\\AppData\\Roaming\\Python\\Python37\\site-packages'
(exists)
ENABLE_USER_SITE: True
if you have two interpreters both with python version 3+ upgrade your pip to version 0.8 or above for both the interpreters and then you can also do this
pip3.5 install package1
pip3.6 install package2
pip3.7 install package3
I was about to write the same answer as what Vlad wrote in the comment but because it didn't work for you & since you are already using multiple python interpreters,
another possible suggestion could be to use them in a different virtual environment (interpreters with different or same python versions) for all your new projects (it's also highly recommended by most of the Data Scientists).
After that install the packages with exact version that you want to use and you'll be good to go. You'll never have to worry about for which interpreter/environment you installed which package.

Python easy_install wrong version conflict

I try to build docker-compose from source with setuptools like this
python setup.py develop
But I get the follwoing error:
error: requests 2.11.1 is installed but requests!=2.18.0,>=2.14.2 is required by set(['docker'])
but running
pip show requests
gives the following result:
Name: requests
Version: 2.18.4
Summary: Python HTTP for Humans.
Home-page: http://python-requests.org
Author: Kenneth Reitz
Author-email: me#kennethreitz.org
License: Apache 2.0
Location: /home/florian/.local/lib/python2.7/site-packages
Requires: certifi, chardet, idna, urllib3
Is there anything cached by setuptools or something similar?
try
sudo pip install --upgrade docker-compose
There was an issue in the git repo source code, that blocked me from building.

Have two different TensorFlow's, how to uninstall both completely?

I have TensorFlow 0.12 that I built from source for GPU support a few months. There was some problems with it that I solved right now but in the downtime I'd installed TensorFlow 1.0.1 using pip install tensorflow-gpu. I want to know how exactly to uninstall both and start over by installing TF 1.0. What else do I need to do other than deleting /home/username/anaconda2/lib/python2.7/site-packages/tensorflow/? This is the output when I use the following commands:
$ pip show tensorflow
Name: tensorflow
Version: 0.12.0rc1
Summary: TensorFlow helps the tensors flow
Home-page: http://tensorflow.org/
Author: Google Inc.
Author-email: opensource#google.com
License: Apache 2.0
Location: /home/username/anaconda2/lib/python2.7/site-packages
Requires: mock, numpy, protobuf, wheel, six
$ pip show tensorflow-gpu
Name: tensorflow-gpu
Version: 1.0.1
Summary: TensorFlow helps the tensors flow
Home-page: http://tensorflow.org/
Author: Google Inc.
Author-email: opensource#google.com
License: Apache 2.0
Location: /home/username/anaconda2/lib/python2.7/site-packages
Requires: mock, numpy, protobuf, wheel, six
On navigating to the tensorflow-gpu folder in site-packages I found some few files, mostly text
$ cd anaconda2/lib/python2.7/site-packages/tensorflow_gpu-1.0.1.dist-info/
$ ls
DESCRIPTION.rst entry_points.txt METADATA metadata.json RECORD top_level.txt WHEEL
pip uninstall tensorflow-gpu and pip uninstall tensorflow should do it. Otherwise, you can also completely remove and reinstall anaconda to start from scratch.

Categories