AIX Open Source

AIX Open Source

Share your experiences and connect with fellow developers to discover how to build and manage open source software for the AIX operating system

 View Only
  • 1.  How to restore the original version PIP for python 3.7

    Posted Thu April 20, 2023 10:20 AM

    Hi,

    I have upgraded pip to the latest version (22.x) from PYPI. But I now suspect this might cause the following error when I install some PYPI package. I am wondering how can I restore the original native PIP that comes with python 3.7? I see there are only python-pip and python3.9-pip in AIX Toolbox repository.

    'AttributeError: 'Distribution' object has no attribute 'convert_2to3_doctests'

    Thanks

    Mi



    ------------------------------
    Mi Wang
    ------------------------------


  • 2.  RE: How to restore the original version PIP for python 3.7

    Posted Thu April 20, 2023 11:10 AM

    You can go to /opt/freeware/lib/python3.7/site-packages and remove pip directories. Then you can run "python3.7 -m ensurepip". (Never do this for python3.9)



    ------------------------------
    Ayappan P
    ------------------------------



  • 3.  RE: How to restore the original version PIP for python 3.7

    Posted Thu April 20, 2023 04:33 PM

    Hi Ayappan,

    I did the folder removal. But running "python3.7 -m ensurepip" gave the following output:
    root: python3 -m ensurepip
    Looking in links: /tmp/tmp_dnysgu1
    Requirement already satisfied: setuptools in /opt/freeware/lib/python3.7/site-packages (59.2.0)
    Requirement already satisfied: pip in /opt/freeware/lib/python3.7/site-packages (23.0.1)
    root:

    I also tried following:
    root: python3 -m pip remove pip
    /opt/freeware/bin/python3: No module named pip
    root:

    Can you please help?

    Thanks

    Mi



    ------------------------------
    Mi Wang
    ------------------------------



  • 4.  RE: How to restore the original version PIP for python 3.7

    Posted Fri April 21, 2023 02:54 AM

    You have to remove both the pip directories "pip" & "pip-<version>.dist-info". 



    ------------------------------
    Ayappan P
    ------------------------------



  • 5.  RE: How to restore the original version PIP for python 3.7

    Posted Fri April 21, 2023 10:17 AM

    Hi  Ayappan,

    it works. By the way, can you please advise which cython version is supported by AIX Toolbox' python 3.7?

    Thanks

    Mi



    ------------------------------
    Mi Wang
    ------------------------------



  • 6.  RE: How to restore the original version PIP for python 3.7

    Posted Fri April 21, 2023 10:22 AM
    Edited by Ayappan P Fri April 21, 2023 10:22 AM

    You have two options. AIX Toolbox has cython-0.29.24 version, so you can do a dnf install python3-Cython or you can use pip to install the latest cython from pypi site ( python3.7 -m pip install Cython). But don't mix both. 



    ------------------------------
    Ayappan P
    ------------------------------



  • 7.  RE: How to restore the original version PIP for python 3.7

    Posted Fri April 21, 2023 10:27 AM

    Hi Ayappan,

    Thanks for the information. Recently I have got the following error when installing several PYPI packages like bleach, charset-normalizer. Do you know what is likely the root cause?

    Thansk

    Mi



    ------------------------------
    Mi Wang
    ------------------------------



  • 8.  RE: How to restore the original version PIP for python 3.7

    Posted Fri April 21, 2023 10:36 AM

    Sorry, I forgot to add the error message:

    AttributeError: 'Distribution' object has no attribute 'convert_2to3_doctests'



    ------------------------------
    Mi Wang
    ------------------------------