https://medium.com/analytics-vidhya/install-pyodbc-on-centos-rhel-ae5062830a2b
For further actions, you may consider blocking this person and/or reporting abuse
For further actions, you may consider blocking this person and/or reporting abuse
CyprianTinasheAarons -
Techelopment -
sivakumarmanoharan -
Daniel Azevedo -
Top comments (2)
As a regular user of CentOS and RHEL, I've found it convenient to work with software collections and virtualenv. This way I am able to target a specific version of Python that may not yet be released to the mainstream repositories. Also, I can keep my python dependencies clean for use in other projects.
Here's how to do it with the Software Collections on CentOS and RHEL. You may need to replace
yum
withdnf
depending on your distribution.On your CentOS system, install the software collections repo.
Alternately, a RHEL system would need the following:
Once you have
scl
installed, install the latest version of python3 andunixODBC-devel
:Now, let's create a virtual environment. This should be included as part of python3.
Now, instead of using
scl
, we can now usesource
to enable ourpython3.8
environment:As you can see, you are now in a virtual environment!
Now, update
pip
,wheel
,distribute
, andsetuptools
:Now that we are updated, we should be able to install
pyodbc
:Test it out if it works:
Now, if you ever need to share your project dependencies with another human being, you can do so like the following:
And then, if you did everything right, you should have something like the following:
I want to make a personal note that it is VERY important that every team member consumes the same library version. That said, it is also very important to add testing behind any code you are doing so that you can catch any errors that may occur when you do a package upgrade for whatever reason. If you are planning on releasing this to production, you will want to install specific versions of the library components. This is why a good CI/CD pipeline would help find issues early on whenever a version has changed. This can be done as a precommit hook, during a pull request, and/or during a merge. The needs depend largely on your organization. However, investing on good devops early on will reduce technical debt and dramatically decrease cost of the project.
Very true and I agree with you.
The steps I had mentioned was generic not specific to how they want to use in their environment.