1
votes

I am using centos7

my python script works fine, when i execute as

python myscripy.py (python --version is pointing to python2.7.5)

i used following link to install pyodbc https://github.com/mkleehammer/pyodbc/wiki/Connecting-to-SQL-Server-from-RHEL-6-or-Centos-7

when i run my python script using

python3.6 myscript.py

ModuleNotFoundError: No module named 'pyodbc'

On trying to install devel using

sudo yum install python3-devel,i am getting follwing error

file /usr/lib/python3.6/site-packages/pip/vcs/pycache/subversion.cpython-36.pyc from install of python3-pip-9.0.3-7.el7_7.noarch conflicts with file from package python36u-pip-9.0.1-1.ius.centos7.noarch

I tried changing alias as well,but it did not work. Please help me to run my code with python3.6 as well

1
If you have used pip to install pyodbc, then it will be installed to your default python, to find which pip is being used type: pip --versionisAif
Show what output you get, so it can be fixed.isAif
got it resolved using the following link, "community.centminmod.com/threads/… " . which says "For CentOS 7, don't use IUS Community YUM Repo's python34u and python36u packages installed from addons/python34_install.sh and addons/python36_install.sh but instead use CentOS 7's EPEL yum repo versions of python34 and python36."vidiv
@vidiv - Please post your last comment as an answer.Gord Thompson

1 Answers

1
votes

got it resolved using the following link,

https://community.centminmod.com/threads/python-conflict-on-update.17144/

which says "For CentOS 7, don't use IUS Community YUM Repo's python34u and python36u packages installed from addons/python34_install.sh and addons/python36_install.sh but instead use CentOS 7's EPEL yum repo versions of python34 and python36.