/usr/bin/python is needed by rpm - python-3.7

I am trying to install a rpm with a python script and I see this following error
error: Failed dependencies:
/usr/bin/python is needed by smartnav-3.24-1.0.002.noarch
libnsl.so.1()(64bit) is needed by smartnav-3.24-1.0.002.noarch
but i can find python3.7 in /usr/bin
/usr/bin/python
Python 3.7.1 (default, Feb 6 2023, 06:40:16)
[GCC 8.5.0 20210514 (Red Hat 8.5.0-3)] on linux
Type "help", "copyright", "credits" or "license" for more information.
it is a RHEL Linux environment
I tried symbolic linking but didnt help
I could install with --nodeps, but I dont want to use this flag

Related

pyenv-win ignores local version

I am having some trouble to use the actual Python version specified by pyenv local.
Z:\>pyenv global
3.10.6
Z:\>pyenv local
3.9.12
Z:\>pyenv which python
C:\xxx\yyy\.pyenv\pyenv-win\versions\3.9.12\python.exe
Z:\>python
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
Check if you have another system version of Python installed. If so, check your PATH order in 'Environment Variables'. Make sure that the path to pyenv-win\shims is higher than another installed version.

Python Visual Studio Code cannot find module

I'm importing debugpy into my code and it works, but VSCode complains that it cannot be imported:
The interpreter shows that I am in the same venv as my terminal:
In my terminal (in VSCode) I can list debugpy and import it at the Python prompt.
(python4uvm_examples) raysalemi#RayProMac python4uvm_examples % pip list | grep debugpy
debugpy 1.4.1
(python4uvm_examples) raysalemi#RayProMac python4uvm_examples % python
Python 3.8.5 (default, Sep 4 2020, 02:22:02)
[Clang 10.0.0 ] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import debugpy
>>>
How do I get VSCode to see that it can be imported?
they have this bug for some time now. what I do - select another interpreter, then re-select the one I need. usually works. (using Pylance as language server).

Error in installing Python 3.7 - E: Sub-process /usr/bin/dpkg returned an error code (1)

I was trying to install python 3.7 in my Ubuntu virtualbox using 'sudo apt-get install python3.7'.
However, I got the below output: -
Building dependency tree
Reading state information... Done
python3.7 is already the newest version (3.7.4-2~16.04.york1).
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
libpython3.7 : Depends: libpython3.7-stdlib (= 3.7.4-2~16.04.york1) but 3.7.4-1+xenial2 is to be installed
libpython3.7-dev : Depends: libpython3.7-stdlib (= 3.7.4-2~16.04.york1) but 3.7.4-1+xenial2 is to be installed
libpython3.7-stdlib : Depends: libpython3.7-minimal (= 3.7.4-1+xenial2) but 3.7.4-2~16.04.york1 is to be installed
python3.7 : Depends: libpython3.7-stdlib (= 3.7.4-2~16.04.york1) but 3.7.4-1+xenial2 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
Afterwards, I tried executing 'apt-get -f install' as recommended in the above output, but then I got the below: -
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
libpython3.7-stdlib
The following packages will be upgraded:
libpython3.7-stdlib
1 upgraded, 0 newly installed, 0 to remove and 209 not upgraded.
4 not fully installed or removed.
Need to get 0 B/1,756 kB of archives.
After this operation, 66.6 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 189831 files and directories currently installed.)
Preparing to unpack .../libpython3.7-stdlib_3.7.4-2~16.04.york1_amd64.deb ...
Unpacking libpython3.7-stdlib:amd64 (3.7.4-2~16.04.york1) over (3.7.4-1+xenial2) ...
dpkg: error processing archive /var/cache/apt/archives/libpython3.7-stdlib_3.7.4-2~16.04.york1_amd64.deb (--unpack):
trying to overwrite '/usr/lib/python3.7/distutils/__init__.py', which is also in package python3.7-distutils 3.7.4-1+xenial2
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/libpython3.7-stdlib_3.7.4-2~16.04.york1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Update:
Even though the error says that python3.7 is already there, when I execute python, I get the below:
Python 2.7.12 (default, Oct 8 2019, 14:14:10)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
And below when I run 'python3': -
Python 3.5.2 (default, Oct 8 2019, 13:06:37)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
All I want to do is to install python 3.7.
Can anyone kindly help me with this error?
I see following in your logs
python3.7 is already the newest version (3.7.4-2~16.04.york1).
It says python3.7 is already install.
can you just try
python or python3 on command line, see what it says?
if you see something like below, it has successfully installed
Python 3.7.3 (v3.7.3 Oct 3 2017, 00:32:08)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on XXX
Type "help", "copyright", "credits" or "license" for more information.

Visual Studio Code and pylint not finding module issues

First, I may have more of an issue with correct environment selection. I did a fresh install of Linux Mint 19 and apt dist-upgrade... etc... and then used apt-get and pip to install pymysql, pil.intertk and pylint for both python and python3 from the cli...
All is good from cli:
~$ python3 --version
Python 3.6.5
~$ pylint3 --version
No config file found, using default configuration
pylint3 1.8.3,
astroid 1.6.0
Python 3.6.5 (default, Apr 1 2018, 05:46:30)
[GCC 7.3.0]
python3
Python 3.6.5 (default, Apr 1 2018, 05:46:30)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pymysql
>>> import PIL
>>>
After installing VSC.... the only two selection of python environments are 2.7.12 and 3.5.2 ?
I then modified VSC settings with: "python.pythonPath": "/usr/bin/python3"
Which still shows as Python 3.5.2 64-bit within VSC
But here comes my issue that I have tried many suggestions I have found from searching with no luck...
pylint is not finding any module I install. I assume its due to the mix match of version ? But not sure how to resolve that?
When I try to specify the pylint path : "python.linting.pylintPath": "/usr/bin/pylint3"
I get an invalid path error in VSC.. but its a valid path
~$ which pylint3
/usr/bin/pylint3
Any help would be greatly appreciated....
So after some frustrating trail and error I have fixed the issue by uninstalling the Flatpak version of Visual Studio Code listed in the Linux Mint's Software Center... and installing the deb package from the official site.
After installing the deb package... the proper version of python are showing and pylint is working correctly.

Can't activate anaconda environment on CentOS

I'm working on install tensorflow on my CentOS system.
I had success install miniconda in my system and created tensorflow environment.
However, I got error message while I run "source activate tensorflow".
I checked on Anaconda page and found out the reason is activate file only support bash and zsh. But my OS centOS is csh (C shell).
And I also try to add "set path " for the tensorflow environment on my ~/.cshrc file. But it looks not working, I still get ImportError while I import tensorflow.
Does anyone know how to solve this problem?
You can try the following (on CentOS 6.8 or CentOS 7):
[root#9dc1f60d1dcd ~]# csh
[root#9dc1f60d1dcd ~]# echo $0
csh
[root#9dc1f60d1dcd ~]# bash Miniconda2-4.3.11-Linux-x86_64.sh -b -p /m2
[root#9dc1f60d1dcd ~]# /m2/bin/conda install -y tensorflow
[root#9dc1f60d1dcd ~]# /m2/bin/python
Python 2.7.13 |Continuum Analytics, Inc.| (default, Dec 20 2016, 23:09:15)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
>>> import tensorflow
>>> tensorflow.__version__
'0.10.0rc0'