Solved Python module with different flavors using same location



Reaction score: 5
Messages: 50

Hi All,

I need a pkg which required py36-babel to works.
I already py27-babel module installed for an another package and unfortunately both use the same repository :

Checking integrity... done (2 conflicting)
  - py27-Babel-2.7.0 [private] conflicts with py36-Babel-2.7.0 [installed] on /usr/local/bin/pybabel
Do you know a workaround to avoid those kind of issue ?




Reaction score: 1,484
Messages: 2,436

How are you installing this, with pkg or with pip? Actually, I can answer my own question: given the package names, you are using pkg.

Sadly, you found one of the messy aspects of the Python 2 -> 3 transition, and in general running multiple python versions next to each other (like for exampke for a while I ran 3.6 and 3.7): People have to be very neat and organized about separating different versions into different files or different directories.

I can only give two vague suggestions. First: Find whatever other package is still using the 2.7 version, and upgrade it to python 3. This has to happen sooner or even sooner anyway, so it might be easiest to just get on with it. (By the way, do as I say, not do as I do: I still have a major self-written package in Python2 running at home, and haven't ported it yet, because it also needs a total overhaul of its database infrastructure from BerkeleyDB -> SQLite, and I don't feel like working on it.)

Second: Instead of installing using pkg, try installing using pip. Pip is usually very good about putting things into separate directories, because it uses /usr/local/lib/python{version}/..., and when it installs executables, it uses softlinks. It might just work this way.