3

Until yesterday we works with python 2.7.5 and wheels packages was installed for python 2.7.5 by pip ( pip that is related to python 2.7.5 )

Now we install the latest python version from redhat – 3.8

We also installed the pip3 , when we installed python 3.8 the additional rpm was also pip3

So until now everything is ok

What we want to understand is about the current wheels packages that was installed with pip (pip2)

Since now we have python 3 , I guess we need to install with pip3 the new wheels for python 3 , I assume python 3 cant use the wheels for python 2

Please let me if I correct , and I will happy to get corrections

Judy
  • 1,595
  • 6
  • 19
  • 41

2 Answers2

3

Yes you will need to install new wheels and new packages as well. (Most of the time if you install the packages with PIP3 it will install the wheels automatically.)

BeeFriedman
  • 1,800
  • 1
  • 11
  • 29
  • Python2 packages don't work with python3 by default. That's why you need to reinstall all packages with python3. If you have a package that is not available for download with python3 there is a method to [covert python2 packages to python3 ones](https://stackoverflow.com/questions/33885975/) – BeeFriedman Oct 18 '20 at 18:36
  • @Judy "can you show some documentation about that?" It's obvious, try it on your own. Try importing python2 modules in a python3 program and see if it works. – BeeFriedman Oct 18 '20 at 18:40
2

dose the wheels that installed for python2 can used also for python3

Some wheels are compatible with both, some are not.

For some projects it is possible to produce wheels that are compatible with Python 2 and 3, for some it is impossible. It all comes down to the actual code of the projects.

It is is quite straightforward to identify which platforms (Python interpreter version, OS, and CPU bitness) a wheel is compatible with by looking at the file name. It is all explained in PEP 425.

sinoroc
  • 18,409
  • 2
  • 39
  • 70
  • can you give opinion about @CForce99 answer? – Judy Oct 18 '20 at 21:24
  • "_can you give opinion about @CForce99 answer?_" That answer does not seem entirely wrong to me, but not entirely accurate either. As I already mentioned, it all depends on the projects and wheels that you already have in your hands. They might be compatible with Python 3. But for sure you will have to install them again. -- I assume if you try to install them with something like `python3 -m pip install SomeProject-{python tag}-{abi tag}-{platform tag}.whl`, _pip_ would throw an error message if the wheel is not compatible. – sinoroc Oct 18 '20 at 21:32