9 Replies Latest reply on Mar 6, 2018 1:59 AM by Intel Corporation

    pip not working

    Shadab.Khan

      Hi,

       

      pip has stopped working on my login node and gives the following error, even for " pip -V "

       

      Traceback (most recent call last):

        File "/glob/intel-python/python3/bin/pip", line 4, in <module>

          import pip

        File "/glob/intel-python/versions/2018u1/intelpython3/lib/python3.6/site-packages/pip/__init__.py", line 26, in <module>

          from pip.utils import get_installed_distributions, get_prog

        File "/glob/intel-python/versions/2018u1/intelpython3/lib/python3.6/site-packages/pip/utils/__init__.py", line 27, in <module>

          from pip._vendor import pkg_resources

        File "/glob/intel-python/versions/2018u1/intelpython3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3018, in <module>

          @_call_aside

        File "/glob/intel-python/versions/2018u1/intelpython3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3004, in _call_aside

          f(*args, **kwargs)

        File "/glob/intel-python/versions/2018u1/intelpython3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3046, in _initialize_master_working_set

          dist.activate(replace=False)

        File "/glob/intel-python/versions/2018u1/intelpython3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2578, in activate

          declare_namespace(pkg)

        File "/glob/intel-python/versions/2018u1/intelpython3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2152, in declare_namespace

          _handle_ns(packageName, path_item)

        File "/glob/intel-python/versions/2018u1/intelpython3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2092, in _handle_ns

          _rebuild_mod_path(path, packageName, module)

        File "/glob/intel-python/versions/2018u1/intelpython3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2121, in _rebuild_mod_path

          orig_path.sort(key=position_in_sys_path)

      AttributeError: '_NamespacePath' object has no attribute 'sort'

       

       

      Reinstalling pip or modifying file "/glob/intel-python/versions/2018u1/intelpython3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py" can solve the problem but it requires root access.

        • 1. Re: pip not working
          Intel Corporation
          This message was posted on behalf of Intel Corporation

          Hi,
          Can i know where is your pip and which pip your using by running the below commands.
          1)whereis pip
          2)which pip
          And the path that is obtained after executing "which pip" command, try install setuptools and upgrade pip using the below two commands      
          1)/path/bin/pip  install --upgrade setuptools 
          2)/path/bin/pip install --upgrade pip
          Please find attachment for more information

          • 2. Re: pip not working
            Shadab.Khan

            [u7530@c009-n003 ~]$ which pip

            glob/intel-python/python3/bin/pip

            [u7530@c009-n003 ~]$ whereis pip

            pip: /glob/intel-python/versions/2018u1/intelpython3/bin/pip /glob/intel-python/versions/2018u1/intelpython2/bin/pip

             

            I'm getting the same error on doing install setuptools and upgrade pip.

             

            [u7530@c009-n003 ~]$ /glob/intel-python/python3/bin/pip install --upgrade pip

            Traceback (most recent call last):

              File "/glob/intel-python/python3/bin/pip", line 4, in <module>

                import pip

              File "/glob/intel-python/versions/2018u1/intelpython3/lib/python3.6/site-packages/pip/__init__.py", line 26, in <module>

                from pip.utils import get_installed_distributions, get_prog

              File "/glob/intel-python/versions/2018u1/intelpython3/lib/python3.6/site-packages/pip/utils/__init__.py", line 27, in <module>

                from pip._vendor import pkg_resources

              File "/glob/intel-python/versions/2018u1/intelpython3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3018, in<module>

                @_call_aside

              File "/glob/intel-python/versions/2018u1/intelpython3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3004, in_call_aside

                f(*args, **kwargs)

              File "/glob/intel-python/versions/2018u1/intelpython3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3046, in_initialize_master_working_set

                dist.activate(replace=False)

              File "/glob/intel-python/versions/2018u1/intelpython3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2578, inactivate

                declare_namespace(pkg)

              File "/glob/intel-python/versions/2018u1/intelpython3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2152, indeclare_namespace

                _handle_ns(packageName, path_item)

              File "/glob/intel-python/versions/2018u1/intelpython3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2092, in_handle_ns

                _rebuild_mod_path(path, packageName, module)

              File "/glob/intel-python/versions/2018u1/intelpython3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2121, in_rebuild_mod_path

                orig_path.sort(key=position_in_sys_path)

            AttributeError: '_NamespacePath' object has no attribute 'sort'

            • 3. Re: pip not working
              Rajeswari_Ponnuru

              Hi,

               

              Can you please give the error output of "setuptools"?

              • 4. Re: pip not working
                Rajeswari_Ponnuru

                Please use --user option. (double hyphen)

                 

                1)/path/bin/pip  install --upgrade setuptools --user

                2)/path/bin/pip install --upgrade pip --user

                • 5. Re: pip not working
                  Shadab.Khan

                  [u7530@c009 ~]$ which pip

                  /glob/intel-python/python3/bin/pip

                   

                  [u7530@c009 ~]$ /glob/intel-python/python3/bin/pip install --upgrade setuptools --user

                  Traceback (most recent call last):

                    File "/glob/intel-python/python3/bin/pip", line 4, in <module>

                      import pip

                    File "/glob/intel-python/versions/2018u1/intelpython3/lib/python3.6/site-packages/pip/__init__.py", line 26, in <module>

                      from pip.utils import get_installed_distributions, get_prog

                    File "/glob/intel-python/versions/2018u1/intelpython3/lib/python3.6/site-packages/pip/utils/__init__.py", line 27, in <module>

                      from pip._vendor import pkg_resources

                    File "/glob/intel-python/versions/2018u1/intelpython3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3018, in <module>

                      @_call_aside

                    File "/glob/intel-python/versions/2018u1/intelpython3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3004, in _call_aside

                      f(*args, **kwargs)

                    File "/glob/intel-python/versions/2018u1/intelpython3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3046, in _initialize_master_working_set

                      dist.activate(replace=False)

                    File "/glob/intel-python/versions/2018u1/intelpython3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2578, in activate

                      declare_namespace(pkg)

                    File "/glob/intel-python/versions/2018u1/intelpython3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2152, in declare_namespace

                      _handle_ns(packageName, path_item)

                    File "/glob/intel-python/versions/2018u1/intelpython3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2092, in _handle_ns

                      _rebuild_mod_path(path, packageName, module)

                    File "/glob/intel-python/versions/2018u1/intelpython3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2121, in _rebuild_mod_path

                      orig_path.sort(key=position_in_sys_path)

                  AttributeError: '_NamespacePath' object has no attribute 'sort'

                   

                  [u7530@c009 ~]$ /glob/intel-python/python3/bin/pip install --upgrade pip --user

                  Traceback (most recent call last):

                    File "/glob/intel-python/python3/bin/pip", line 4, in <module>

                      import pip

                    File "/glob/intel-python/versions/2018u1/intelpython3/lib/python3.6/site-packages/pip/__init__.py", line 26, in <module>

                      from pip.utils import get_installed_distributions, get_prog

                    File "/glob/intel-python/versions/2018u1/intelpython3/lib/python3.6/site-packages/pip/utils/__init__.py", line 27, in <module>

                      from pip._vendor import pkg_resources

                    File "/glob/intel-python/versions/2018u1/intelpython3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3018, in <module>

                      @_call_aside

                    File "/glob/intel-python/versions/2018u1/intelpython3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3004, in _call_aside

                      f(*args, **kwargs)

                    File "/glob/intel-python/versions/2018u1/intelpython3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3046, in _initialize_master_working_set

                      dist.activate(replace=False)

                    File "/glob/intel-python/versions/2018u1/intelpython3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2578, in activate

                      declare_namespace(pkg)

                    File "/glob/intel-python/versions/2018u1/intelpython3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2152, in declare_namespace

                      _handle_ns(packageName, path_item)

                    File "/glob/intel-python/versions/2018u1/intelpython3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2092, in _handle_ns

                      _rebuild_mod_path(path, packageName, module)

                    File "/glob/intel-python/versions/2018u1/intelpython3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2121, in _rebuild_mod_path

                      orig_path.sort(key=position_in_sys_path)

                  AttributeError: '_NamespacePath' object has no attribute 'sort'

                   

                   

                  This solution may work but it requires root access.

                  • 6. Re: pip not working
                    Intel Corporation
                    This message was posted on behalf of Intel Corporation

                    Hi
                    First can you please try install setuptools then you can upgrade.
                    Please follow the below steps,
                    1) /glob/intel-python/python3/bin/pip install  setuptools --user
                    2) /glob/intel-python/python3/bin/pip install --upgrade setuptools --user
                    3)
                     /glob/intel-python/python3/bin/pip install --upgrade pip --user

                    • 7. Re: pip not working
                      Shadab.Khan

                      Same error for all 3 commands.

                       

                       

                      Traceback (most recent call last):

                        File "/glob/intel-python/python3/bin/pip", line 4, in <module>

                          import pip

                        File "/glob/intel-python/versions/2018u1/intelpython3/lib/python3.6/site-packages/pip/__init__.py", line 26, in <module>

                          from pip.utils import get_installed_distributions, get_prog

                        File "/glob/intel-python/versions/2018u1/intelpython3/lib/python3.6/site-packages/pip/utils/__init__.py", line 27, in <module>

                          from pip._vendor import pkg_resources

                        File "/glob/intel-python/versions/2018u1/intelpython3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3018, in <module>

                          @_call_aside

                        File "/glob/intel-python/versions/2018u1/intelpython3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3004, in _call_aside

                          f(*args, **kwargs)

                        File "/glob/intel-python/versions/2018u1/intelpython3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3046, in _initialize_master_working_set

                          dist.activate(replace=False)

                        File "/glob/intel-python/versions/2018u1/intelpython3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2578, in activate

                          declare_namespace(pkg)

                        File "/glob/intel-python/versions/2018u1/intelpython3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2152, in declare_namespace

                          _handle_ns(packageName, path_item)

                        File "/glob/intel-python/versions/2018u1/intelpython3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2092, in _handle_ns

                          _rebuild_mod_path(path, packageName, module)

                        File "/glob/intel-python/versions/2018u1/intelpython3/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2121, in _rebuild_mod_path

                          orig_path.sort(key=position_in_sys_path)

                      AttributeError: '_NamespacePath' object has no attribute 'sort'

                      • 8. Re: pip not working
                        Intel Corporation
                        This message was posted on behalf of Intel Corporation

                        Hi 
                        Please try install on compute node using  the below command
                        qsub -I
                        installation steps
                        1) /glob/intel-python/python3/bin/pip install setuptools --user
                        2) /glob/intel-python/python3/bin/pip install --upgrade setuptools --user
                        3)
                         /glob/intel-python/python3/bin/pip install --upgrade pip --user
                         

                        • 9. Re: pip not working
                          Intel Corporation
                          This message was posted on behalf of Intel Corporation

                          Hi 
                          As i am not hearing any response from you.I am closing this ticket.